I am trying to instantiate a class that uses member function pointers in CINT and PyROOT after creating a dictionary for it. Is this possible? Please find the class definition below and the reflex file attached.
Thank you in advance,
Bruno
namespace HggReader {
class HggD3PDCutFlow;
typedef bool (HggD3PDCutFlow::*HGGc0)(void);
typedef bool (HggD3PDCutFlow::*HGGc1)(int);
class HggCut
{
public:
HggCut() : name(""), onEvent(0), onPair(0), onPhoton(0) {};
HggCut(std::string n, HGGc0 a, HGGc1 b = 0, HGGc1 c = 0) : name(n), onEvent(a), onPair(b), onPhoton(c) {};
virtual ~HggCut() {};
std::string name;
// Pointers to HGGD3PDCutFlow cuts
HGGc0 onEvent;
HGGc1 onPair, onPhoton;
};
}
root [0] HggCut c1
Error: class,struct,union or type bool(HggReader not defined {CINTEX dictionary translator}:-1:
Error: class,struct,union or type bool(HggReader not defined {CINTEX dictionary translator}:-1:
Error: class,struct,union or type bool(HggReader not defined {CINTEX dictionary translator}:-1:
Error: class,struct,union or type bool(HggReader not defined {CINTEX dictionary translator}:-1:
Error: class,struct,union or type bool(HggReader not defined {CINTEX dictionary translator}:-1:
Error: class,struct,union or type bool(HggReader not defined {CINTEX dictionary translator}:-1:
HGGReader_rflx.cxx (620 KB)
Thanks, indeed it seems to work. Now I see a difference between interactive and compiled code when testing a null pointer. Do you understand or maybe there is error on what I am doing?
root [0] .L test_HggCut.C+
Info in <TUnixSystem::ACLiC>: creating shared library /home/blenzi/teste/./test_HggCut_C.so
In file included from /home/blenzi/teste/test_HggCut_C_ACLiC_dict.h:34,
from /home/blenzi/teste/test_HggCut_C_ACLiC_dict.cxx:16:
/home/blenzi/teste/./HggCut.h: In function ‘void test_HggCut()’:
/home/blenzi/teste/./HggCut.h:15: warning: ‘c0.bool (HggD3PDCutFlow::*)()::__delta’ may be used uninitialized in this function
/home/blenzi/teste/./test_HggCut.C:10: note: ‘c0.bool (HggD3PDCutFlow::*)()::__delta’ was declared here
/home/blenzi/teste/./HggCut.h:15: warning: ‘c0.bool (HggD3PDCutFlow::*)()::__pfn’ may be used uninitialized in this function
/home/blenzi/teste/./test_HggCut.C:10: note: ‘c0.bool (HggD3PDCutFlow::*)()::__pfn’ was declared here
/home/blenzi/teste/./HggCut.h:15: warning: ‘c1.bool (HggD3PDCutFlow::*)(int)::__delta’ may be used uninitialized in this function
/home/blenzi/teste/./test_HggCut.C:11: note: ‘c1.bool (HggD3PDCutFlow::*)(int)::__delta’ was declared here
/home/blenzi/teste/./HggCut.h:15: warning: ‘c1.bool (HggD3PDCutFlow::*)(int)::__pfn’ may be used uninitialized in this function
/home/blenzi/teste/./test_HggCut.C:11: note: ‘c1.bool (HggD3PDCutFlow::*)(int)::__pfn’ was declared here
root [1] test_HggCut()
1
1
1
1