Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
Pointer.h
1
/*
2
* VoidObject.h
3
*
4
* Created on: 10 cze 2024
5
* Author: daniel
6
*/
7
8
#ifndef HAL_FEATURES_IO_OBJECTVOID_H_
9
#define HAL_FEATURES_IO_OBJECTVOID_H_
10
11
#include "Object.h"
17
namespace
Hal
{
18
template
<
class
T>
19
class
Pointer
:
public
Object
{
20
T* fPointer = {
nullptr
};
21
Bool_t fOwner = {kFALSE};
22
23
public
:
24
Pointer
() {};
25
Pointer
(T* obj, Bool_t owner) : fPointer(obj), fOwner(owner) {}
26
T* GetPointer()
const
{
return
fPointer; }
27
virtual
~Pointer
() {
28
if
(fOwner && fPointer)
delete
fPointer;
29
}
30
ClassDef(
Pointer
, 0)
31
};
32
37
template
<
class
T>
38
class
DoublePointer
:
public
Object
{
39
T** fPointer = {
nullptr
};
40
Bool_t fOwner = {kFALSE};
41
42
public
:
43
DoublePointer
() {};
44
DoublePointer
(T** obj, Bool_t owner) : fPointer(obj), fOwner(owner) {};
49
T*
GetPointer
()
const
{
return
*fPointer; }
54
T**
GetDoublePointer
()
const
{
return
fPointer; }
58
void
DeleteDoublePointer
() {
59
delete
fPointer;
60
fPointer =
nullptr
;
61
}
62
virtual
~DoublePointer
() {
63
if
(fPointer && fOwner) {
64
delete
*fPointer;
65
delete
fPointer;
66
}
67
}
68
ClassDef(DoublePointer, 0)
69
};
70
typedef
Pointer<TObject> ObjectPointer;
71
typedef
DoublePointer<TObject> ObjectDoublePointer;
72
}
// namespace Hal
73
74
#endif
/* HAL_FEATURES_IO_OBJECTVOID_H_ */
Hal::DoublePointer
Definition
Pointer.h:38
Hal::DoublePointer::GetDoublePointer
T ** GetDoublePointer() const
Definition
Pointer.h:54
Hal::DoublePointer::GetPointer
T * GetPointer() const
Definition
Pointer.h:49
Hal::DoublePointer::DeleteDoublePointer
void DeleteDoublePointer()
Definition
Pointer.h:58
Hal::Object
Definition
Object.h:28
Hal::Pointer
Definition
Pointer.h:19
Hal
Definition
EventAnaChain.cxx:28
features
io
Pointer.h
Generated on Wed Oct 23 2024 15:07:52 for Heavy ion Analysis Libriares by
1.12.0