Coherent WaveBurst
Reference Guide
CWB Documentation
Main Page
Namespaces
All Classes
Files
gitlab
ROOT
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
SOFT
cWB
library
master_0bc430d
tools
cwb
plugins
CWB_Plugin.h
Go to the documentation of this file.
1
#ifndef CWB_PLUGIN_H
2
#define CWB_PLUGIN_H
3
4
// plugin macros, used to share parameters between Plugin and configPlugin
5
6
#define CWB_PLUGIN_IMPORT(TYPE,VAR) { \
7
TGlobal* _global = (TGlobal*)gROOT->GetGlobal("__p"#VAR,true); \
8
if(_global!=NULL) { \
9
void* gPOINTER=NULL; \
10
memcpy((void*)&gPOINTER,(void*)_global->GetAddress(),sizeof(void*)); \
11
VAR = (TYPE)gPOINTER; \
12
} else { \
13
cout << "CWB_PLUGIN_IMPORT : global variable not found " << #VAR << endl; \
14
exit(1); \
15
} \
16
}
17
18
#define CWB_PLUGIN_EXPORT(VAR) { \
19
char __cmdline[128]; \
20
TGlobal* _global = (TGlobal*)gROOT->GetGlobal("__p"#VAR,true); \
21
if(_global==NULL) sprintf(__cmdline,"void* __p"#VAR" = (void*)%p;",&VAR); \
22
else sprintf(__cmdline,"__p"#VAR" = (void*)%p;",&VAR); \
23
gROOT->ProcessLine(__cmdline); \
24
}
25
26
#endif