Warning, /include/Geant4/tools/rroot/graph 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_rroot_graph
0005 #define tools_rroot_graph
0006
0007 #include "../scast"
0008 #include "buffer"
0009
0010 #include "cids"
0011
0012 namespace tools {
0013 namespace rroot {
0014
0015 class graph : public virtual iro {
0016 static const std::string& s_store_class() {
0017 static const std::string s_v("TGraph");
0018 return s_v;
0019 }
0020 public:
0021 static const std::string& s_class() {
0022 static const std::string s_v("tools::rroot::graph");
0023 return s_v;
0024 }
0025 public: //iro
0026 virtual void* cast(const std::string& a_class) const {
0027 if(void* p = cmp_cast<graph>(this,a_class)) return p;
0028 return 0;
0029 }
0030 virtual const std::string& s_cls() const {return s_class();}
0031 public:
0032 static cid id_class() {return graph_cid();}
0033 virtual void* cast(cid a_class) const {
0034 if(void* p = cmp_cast<graph>(this,a_class)) {return p;}
0035 else return 0;
0036 }
0037 public:
0038 virtual iro* copy() const {return new graph(*this);}
0039 virtual bool stream(buffer& a_buffer) {
0040 uint32 startpos = a_buffer.length();
0041 short v;
0042 unsigned int _s,_c;
0043 if(!a_buffer.read_version(v,_s,_c)) return false;
0044 a_buffer.set_offset(startpos+_c+sizeof(unsigned int));
0045 if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
0046 return true;
0047 }
0048 public:
0049 graph(){
0050 #ifdef TOOLS_MEM
0051 mem::increment(s_class().c_str());
0052 #endif
0053 }
0054 virtual ~graph(){
0055 #ifdef TOOLS_MEM
0056 mem::decrement(s_class().c_str());
0057 #endif
0058 }
0059 protected:
0060 graph(const graph& a_from): iro(a_from){}
0061 graph& operator=(const graph&){return *this;}
0062 };
0063
0064 }}
0065
0066 #endif