Logo ROOT  
Reference Guide
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
8namespace PyROOT {
9
10// general place holder for function parameters
11 struct TParameter {
12 union Value {
25 void* fVoidp;
27 void* fRef;
29 };
30
31// extra call information
32 struct TCallContext {
33 TCallContext( std::vector< TParameter >::size_type sz = 0 ) : fArgs( sz ), fFlags( 0 ) {}
34
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
51
52 // signal safety
55
56 // payload
57 std::vector< TParameter > fArgs;
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
75 }
76
77 inline Bool_t ReleasesGIL( UInt_t flags ) {
78 return flags & TCallContext::kReleaseGIL;
79 }
80
82 return ctxt ? (ctxt->fFlags & TCallContext::kReleaseGIL) : kFALSE;
83 }
84
86 if ( ctxt && (ctxt->fFlags & TCallContext::kUseStrict) )
87 return kTRUE;
88 if ( ctxt && (ctxt->fFlags & TCallContext::kUseHeuristics) )
89 return kFALSE;
90
92 }
93
94} // namespace PyROOT
95
96#endif // !PYROOT_TCALLCONTEXT_H
#define e(i)
Definition: RSha256.hxx:103
unsigned short UShort_t
Definition: RtypesCore.h:36
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
short Short_t
Definition: RtypesCore.h:35
double Double_t
Definition: RtypesCore.h:55
long double LongDouble_t
Definition: RtypesCore.h:57
long long Long64_t
Definition: RtypesCore.h:69
unsigned long long ULong64_t
Definition: RtypesCore.h:70
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
Bool_t ReleasesGIL(UInt_t flags)
Definition: TCallContext.h:77
Bool_t IsCreator(UInt_t flags)
Definition: TCallContext.h:65
Bool_t IsConstructor(UInt_t flags)
Definition: TCallContext.h:69
Bool_t UseStrictOwnership(TCallContext *ctxt)
Definition: TCallContext.h:85
Bool_t ManagesSmartPtr(TCallContext *ctxt)
Definition: TCallContext.h:73
Bool_t IsSorted(UInt_t flags)
Definition: TCallContext.h:61
TCallContext(std::vector< TParameter >::size_type sz=0)
Definition: TCallContext.h:33
static Bool_t SetMemoryPolicy(ECallFlags e)
Set the global memory policy, which affects object ownership when objects are passed as function argu...
std::vector< TParameter > fArgs
Definition: TCallContext.h:57
static ECallFlags sSignalPolicy
Definition: TCallContext.h:53
static ECallFlags sMemoryPolicy
Definition: TCallContext.h:49
static Bool_t SetSignalPolicy(ECallFlags e)
Set the global signal policy, which determines whether a jmp address should be saved to return to aft...
union PyROOT::TParameter::Value fValue