Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Geant4/tools/sg/action 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_sg_action
0005 #define tools_sg_action
0006 
0007 #include "../S_STRING"
0008 #include "../scast"
0009 
0010 #include <ostream>
0011 
0012 namespace tools {
0013 namespace sg {
0014 
0015 class action {
0016 public:
0017   TOOLS_SCLASS(tools::sg::action)
0018 public:
0019   virtual void* cast(const std::string& a_class) const {
0020     if(void* p = cmp_cast<action>(this,a_class)) return p;
0021     return 0;
0022   }
0023   virtual const std::string& s_cls() const = 0;
0024 public:
0025   action(std::ostream& a_out)
0026   :m_out(a_out)
0027   {
0028   }
0029   virtual ~action(){
0030   }
0031 protected:
0032   action(const action& a_from)
0033   :m_out(a_from.m_out)
0034   {
0035   }
0036   action& operator=(const action&){return *this;}
0037 public:
0038   std::ostream& out() const {return m_out;}
0039 protected:
0040   std::ostream& m_out;
0041 };
0042 
0043 #include "../HEADER"
0044 
0045 #define TOOLS_ACTION(a__class,a__sclass,a__parent)\
0046   TOOLS_HEADER(a__class,a__sclass,a__parent)\
0047   virtual tools::sg::action* copy() const {return new a__class(*this);}
0048 
0049 #define TOOLS_T_ACTION(a__T,a__class,a__sclass,a__parent)\
0050   TOOLS_T_HEADER(a__T,a__class,a__sclass,a__parent)\
0051   virtual tools::sg::action* copy() const {return new a__class(*this);}
0052 
0053 #define TOOLS_ACTION_NO_COPY(a__class,a__sclass,a__parent)\
0054   TOOLS_HEADER(a__class,a__sclass,a__parent)
0055 
0056 }}
0057 
0058 #endif