Diana Software
Classes | Macros
QBaseModuleFactory.hh File Reference

Go to the source code of this file.

Classes

class  QModFactory< T >
 abstract module factory and definition of macros that builds modulefactories and register function. More...
 

Macros

#define DECLARE_MODULE_FACTORY(clazz, modtype)
 
#define REGISTER_MOD(clazz, modtype)
 

Macro Definition Documentation

◆ DECLARE_MODULE_FACTORY

#define DECLARE_MODULE_FACTORY (   clazz,
  modtype 
)
Value:
class clazz ## Factory : public Diana::QModFactory<modtype>{\
public:\
clazz ## Factory() : Diana::QModFactory<modtype>(#clazz) {}\
private:\
modtype *GetObject(Diana::QSequence* s) {\
modtype* obj = new clazz();\
Diana::QBaseModule* bobj = (Diana::QBaseModule*) obj;\
bobj->Update(s,fOccurrence);\
return obj;\
}\
};
abstract module factory and definition of macros that builds modulefactories and register function.
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...

Definition at line 47 of file QBaseModuleFactory.hh.

◆ REGISTER_MOD

#define REGISTER_MOD (   clazz,
  modtype 
)
Value:
DECLARE_MODULE_FACTORY(clazz,modtype);\
extern "C" void registerInFactory ## clazz() {\
Diana::QModFactory<modtype>* pt = new clazz ## Factory;\
Diana::QGeneralFactory::GetInstance().Register(pt);\
}
#define DECLARE_MODULE_FACTORY(clazz, modtype)

Definition at line 60 of file QBaseModuleFactory.hh.