Warning, /include/Geant4/tools/rroot/tree_index 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_tree_index
0005 #define tools_rroot_tree_index
0006
0007 #include "named"
0008
0009 namespace tools {
0010 namespace rroot {
0011
0012 class tree_index : public virtual iro {
0013 static const std::string& s_store_class() {
0014 static const std::string s_v("TTreeIndex");
0015 return s_v;
0016 }
0017 public:
0018 static const std::string& s_class() {
0019 static const std::string s_v("tools::rroot::tree_index");
0020 return s_v;
0021 }
0022 public: //iro
0023 virtual void* cast(const std::string& a_class) const {
0024 if(void* p = cmp_cast<tree_index>(this,a_class)) return p;
0025 return 0;
0026 }
0027 virtual const std::string& s_cls() const {return s_class();}
0028 public:
0029 static cid id_class() {return branch_cid();}
0030 virtual void* cast(cid a_class) const {
0031 if(void* p = cmp_cast<tree_index>(this,a_class)) {return p;}
0032 else return 0;
0033 }
0034 public:
0035 virtual iro* copy() const {return new tree_index(*this);}
0036 virtual bool stream(buffer& a_buffer) {
0037 uint32 startpos = a_buffer.length();
0038
0039 unsigned int _s,_c;
0040 short v;
0041 if(!a_buffer.read_version(v,_s,_c)) return false;
0042
0043 if(!virtual_index_stream(a_buffer)) return false;
0044
0045 std::string ds;
0046 if(!a_buffer.read(ds)) return false; //fMajorName
0047 if(!a_buffer.read(ds)) return false; //fMinorName
0048
0049 int64 m_n;
0050 if(!a_buffer.read(m_n)) return false; //fN
0051
0052 if(!dummy_array_stream<int64>(a_buffer,int(m_n))) return false;
0053 if(!dummy_array_stream<int64>(a_buffer,int(m_n))) return false;
0054
0055 //FIXME : still problem with this streamer.
0056
0057 a_buffer.set_offset(startpos+_c+sizeof(unsigned int));
0058
0059 if(!a_buffer.check_byte_count(_s,_c,s_store_class())) return false;
0060
0061 return true;
0062 }
0063
0064 public:
0065 tree_index()
0066 {
0067 }
0068 virtual ~tree_index(){
0069 }
0070 protected:
0071 tree_index(const tree_index& a_from):iro(a_from){}
0072 tree_index& operator=(const tree_index&){return *this;}
0073 protected:
0074 static const std::string& virtual_index_s_store_class() {
0075 static const std::string s_v("TVirtualIndex");
0076 return s_v;
0077 }
0078 bool virtual_index_stream(buffer& a_buffer){
0079 short v;
0080 unsigned int _s,_c;
0081 if(!a_buffer.read_version(v,_s,_c)) return false;
0082 std::string ds;
0083 if(!Named_stream(a_buffer,ds,ds)) return false;
0084 if(!a_buffer.check_byte_count(_s,_c,virtual_index_s_store_class()))
0085 return false;
0086 return true;
0087 }
0088
0089 };
0090
0091 }}
0092
0093 #endif