ROOT
6.14/05
Reference Guide
bindings
pyroot
src
TCallContext.h
Go to the documentation of this file.
1
#ifndef PYROOT_TCALLCONTEXT_H
2
#define PYROOT_TCALLCONTEXT_H
3
4
// Standard
5
#include <vector>
6
7
8
namespace
PyROOT
{
9
10
// general place holder for function parameters
11
struct
TParameter
{
12
union
Value
{
13
Bool_t
fBool
;
14
Short_t
fShort
;
15
UShort_t
fUShort
;
16
Int_t
fInt
;
17
UInt_t
fUInt
;
18
Long_t
fLong
;
19
ULong_t
fULong
;
20
Long64_t
fLongLong
;
21
ULong64_t
fULongLong
;
22
Float_t
fFloat
;
23
Double_t
fDouble
;
24
LongDouble_t
fLongDouble
;
25
void
*
fVoidp
;
26
}
fValue
;
27
void
*
fRef
;
28
char
fTypeCode
;
29
};
30
31
// extra call information
32
struct
TCallContext
{
33
TCallContext
( std::vector< TParameter >::size_type sz = 0 ) : fArgs( sz ), fFlags( 0 ) {}
34
35
enum
ECallFlags
{
36
kNone
= 0,
37
kIsSorted = 1,
// if method overload priority determined
38
kIsCreator = 2,
// if method creates python-owned objects
39
kIsConstructor
= 4,
// if method is a C++ constructor
40
kUseHeuristics = 8,
// if method applies heuristics memory policy
41
kUseStrict = 16,
// if method applies strict memory policy
42
kManageSmartPtr = 32,
// if executor should manage smart pointers
43
kReleaseGIL = 64,
// if method should release the GIL
44
kFast = 128,
// if method should NOT handle signals
45
kSafe = 256
// if method should return on signals
46
};
47
48
// memory handling
49
static
ECallFlags
sMemoryPolicy
;
50
static
Bool_t
SetMemoryPolicy(
ECallFlags
e
);
51
52
// signal safety
53
static
ECallFlags
sSignalPolicy
;
54
static
Bool_t
SetSignalPolicy(
ECallFlags
e
);
55
56
// payload
57
std::vector< TParameter >
fArgs
;
58
UInt_t
fFlags
;
59
};
60
61
inline
Bool_t
IsSorted
(
UInt_t
flags ) {
62
return
flags &
TCallContext::kIsSorted
;
63
}
64
65
inline
Bool_t
IsCreator
(
UInt_t
flags ) {
66
return
flags &
TCallContext::kIsCreator
;
67
}
68
69
inline
Bool_t
IsConstructor
(
UInt_t
flags ) {
70
return
flags &
TCallContext::kIsConstructor
;
71
}
72
73
inline
Bool_t
ManagesSmartPtr
(
TCallContext
* ctxt ) {
74
return
ctxt->
fFlags
&
TCallContext::kManageSmartPtr
;
75
}
76
77
inline
Bool_t
ReleasesGIL
(
UInt_t
flags ) {
78
return
flags &
TCallContext::kReleaseGIL
;
79
}
80
81
inline
Bool_t
ReleasesGIL
(
TCallContext
* ctxt ) {
82
return
ctxt ? (ctxt->
fFlags
&
TCallContext::kReleaseGIL
) :
kFALSE
;
83
}
84
85
inline
Bool_t
UseStrictOwnership
(
TCallContext
* ctxt ) {
86
if
( ctxt && (ctxt->
fFlags
&
TCallContext::kUseStrict
) )
87
return
kTRUE
;
88
if
( ctxt && (ctxt->
fFlags
&
TCallContext::kUseHeuristics
) )
89
return
kFALSE
;
90
91
return
TCallContext::sMemoryPolicy
==
TCallContext::kUseStrict
;
92
}
93
94
}
// namespace PyROOT
95
96
#endif // !PYROOT_TCALLCONTEXT_H
PyROOT::TCallContext::ECallFlags
ECallFlags
Definition:
TCallContext.h:35
PyROOT::TCallContext::kUseHeuristics
Definition:
TCallContext.h:40
kIsConstructor
Definition:
TDictionary.h:120
PyROOT::TCallContext::TCallContext
TCallContext(std::vector< TParameter >::size_type sz=0)
Definition:
TCallContext.h:33
PyROOT::TParameter::Value::fFloat
Float_t fFloat
Definition:
TCallContext.h:22
Long64_t
long long Long64_t
Definition:
RtypesCore.h:69
PyROOT::TCallContext::fFlags
UInt_t fFlags
Definition:
TCallContext.h:58
PyROOT::TParameter::Value::fVoidp
void * fVoidp
Definition:
TCallContext.h:25
Float_t
float Float_t
Definition:
RtypesCore.h:53
PyROOT::TCallContext::sSignalPolicy
static ECallFlags sSignalPolicy
Definition:
TCallContext.h:53
PyROOT::kNone
Definition:
PropertyProxy.cxx:15
UShort_t
unsigned short UShort_t
Definition:
RtypesCore.h:36
PyROOT::TCallContext::kIsCreator
Definition:
TCallContext.h:38
PyROOT::ManagesSmartPtr
Bool_t ManagesSmartPtr(TCallContext *ctxt)
Definition:
TCallContext.h:73
PyROOT::TCallContext
Definition:
TCallContext.h:32
PyROOT::TParameter::Value::fShort
Short_t fShort
Definition:
TCallContext.h:14
Int_t
int Int_t
Definition:
RtypesCore.h:41
Bool_t
bool Bool_t
Definition:
RtypesCore.h:59
PyROOT::TParameter::Value::fUShort
UShort_t fUShort
Definition:
TCallContext.h:15
PyROOT::TParameter::Value::fDouble
Double_t fDouble
Definition:
TCallContext.h:23
PyROOT::TCallContext::kIsSorted
Definition:
TCallContext.h:37
PyROOT::TParameter::Value::fLong
Long_t fLong
Definition:
TCallContext.h:18
PyROOT::TParameter::Value::fUInt
UInt_t fUInt
Definition:
TCallContext.h:17
PyROOT::TCallContext::fArgs
std::vector< TParameter > fArgs
Definition:
TCallContext.h:57
PyROOT::IsSorted
Bool_t IsSorted(UInt_t flags)
Definition:
TCallContext.h:61
PyROOT::UseStrictOwnership
Bool_t UseStrictOwnership(TCallContext *ctxt)
Definition:
TCallContext.h:85
PyROOT::ReleasesGIL
Bool_t ReleasesGIL(UInt_t flags)
Definition:
TCallContext.h:77
PyROOT::TParameter::Value::fInt
Int_t fInt
Definition:
TCallContext.h:16
PyROOT::TParameter::Value::fLongLong
Long64_t fLongLong
Definition:
TCallContext.h:20
PyROOT::TParameter::fValue
union PyROOT::TParameter::Value fValue
PyROOT::TCallContext::kManageSmartPtr
Definition:
TCallContext.h:42
PyROOT::TCallContext::kUseStrict
Definition:
TCallContext.h:41
PyROOT::TParameter::Value::fULong
ULong_t fULong
Definition:
TCallContext.h:19
PyROOT::IsConstructor
Bool_t IsConstructor(UInt_t flags)
Definition:
TCallContext.h:69
PyROOT::TParameter::fRef
void * fRef
Definition:
TCallContext.h:27
UInt_t
unsigned int UInt_t
Definition:
RtypesCore.h:42
Short_t
short Short_t
Definition:
RtypesCore.h:35
LongDouble_t
long double LongDouble_t
Definition:
RtypesCore.h:57
PyROOT::TParameter::Value
Definition:
TCallContext.h:12
PyROOT::TCallContext::kIsConstructor
Definition:
TCallContext.h:39
kFALSE
const Bool_t kFALSE
Definition:
RtypesCore.h:88
PyROOT::TParameter::Value::fULongLong
ULong64_t fULongLong
Definition:
TCallContext.h:21
Long_t
long Long_t
Definition:
RtypesCore.h:50
Double_t
double Double_t
Definition:
RtypesCore.h:55
PyROOT::TParameter::Value::fLongDouble
LongDouble_t fLongDouble
Definition:
TCallContext.h:24
PyROOT::TParameter
Definition:
TCallContext.h:11
ULong64_t
unsigned long long ULong64_t
Definition:
RtypesCore.h:70
ULong_t
unsigned long ULong_t
Definition:
RtypesCore.h:51
e
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition:
TRolke.cxx:630
PyROOT
Definition:
TPyException.h:40
PyROOT::IsCreator
Bool_t IsCreator(UInt_t flags)
Definition:
TCallContext.h:65
PyROOT::TParameter::fTypeCode
char fTypeCode
Definition:
TCallContext.h:28
PyROOT::TParameter::Value::fBool
Bool_t fBool
Definition:
TCallContext.h:13
kTRUE
const Bool_t kTRUE
Definition:
RtypesCore.h:87
PyROOT::TCallContext::sMemoryPolicy
static ECallFlags sMemoryPolicy
Definition:
TCallContext.h:49
PyROOT::TCallContext::kReleaseGIL
Definition:
TCallContext.h:43