Warning, /include/Geant4/tools/HEADER is written in an unsupported language. File is not indexed.
0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003
0004 #ifndef tools_HEADER
0005 #define tools_HEADER
0006
0007 #include "S_STRING"
0008 #include "scast"
0009
0010 #define TOOLS_HEADER(a__class,a__sclass,a__parent)\
0011 private:\
0012 typedef a__parent parent;\
0013 public:\
0014 TOOLS_SCLASS(a__sclass)\
0015 /*public:\
0016 static bool is_a(const std::string& a_class) {\
0017 if(!rcmp(a_class,s_class())) return true;\
0018 return parent::is_a(a_class);\
0019 }*/\
0020 public:\
0021 virtual void* cast(const std::string& a_class) const {\
0022 if(void* p = tools::cmp_cast<a__class>(this,a_class)) return p;\
0023 return parent::cast(a_class);\
0024 }\
0025 virtual const std::string& s_cls() const {return s_class();}
0026
0027 #define TOOLS_HEADER_COPY(a__class,a__sclass,a__parent,a__to)\
0028 TOOLS_HEADER(a__class,a__sclass,a__parent)\
0029 virtual a__to* copy() const {return new a__class(*this);}
0030
0031 #define TOOLS_T_HEADER(a__T,a__class,a__sclass,a__parent)\
0032 private:\
0033 typedef a__parent parent;\
0034 public:\
0035 TOOLS_T_SCLASS(a__T,a__sclass)\
0036 public:\
0037 virtual void* cast(const std::string& a_class) const {\
0038 if(void* p = tools::cmp_cast<a__class>(this,a_class)) return p;\
0039 return parent::cast(a_class);\
0040 }\
0041 virtual const std::string& s_cls() const {return s_class();}
0042
0043 #endif