g4tools  5.4.0
branch_object
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_rroot_branch_object
5 #define tools_rroot_branch_object
6 
7 #include "branch"
8 
9 namespace tools {
10 namespace rroot {
11 
12 class branch_object : public branch {
13  typedef branch parent;
14 public:
15  static const std::string& s_class() {
16  static const std::string s_v("tools::rroot::branch_object");
17  return s_v;
18  }
19 public: //iro
20  virtual void* cast(const std::string& a_class) const {
21  if(void* p = cmp_cast<branch_object>(this,a_class)) return p;
22  return parent::cast(a_class);
23  }
24  virtual const std::string& s_cls() const {return s_class();}
25 public:
26  static cid id_class() {return branch_object_cid();}
27  virtual void* cast(cid a_class) const {
28  if(void* p = cmp_cast<branch_object>(this,a_class)) {return p;}
29  return parent::cast(a_class);
30  }
31 public:
32  virtual bool stream(buffer& a_buffer) {
33  short v;
34  unsigned int s, c;
35  if(!a_buffer.read_version(v,s,c)) return false;
36  if(!parent::stream(a_buffer)) return false;
37  if(!a_buffer.read(fClassName)) return false;
38  if(!a_buffer.check_byte_count(s,c,"TBranchObject")) return false;
39  return true;
40  }
41 public: //branch
42 public:
43  branch_object(std::ostream& a_out,ifac& a_fac)
44  :parent(a_out,a_fac)
45  //,m_obj(0)
46  ,fClassName()
47  {}
48 
49  virtual ~branch_object(){
50  //delete m_obj;
51  }
52 protected:
54  :iro(a_from),parent(a_from){}
55  branch_object& operator=(const branch_object&){return *this;}
56 public:
57  const std::string& class_name() const {return fClassName;}
58 // iro* object() {return m_obj;}
59 protected:
60 // iro* m_obj;
61 protected:
62  std::string fClassName; //Class name of referenced object
63 };
64 
65 }}
66 
67 #endif
tools::rroot::branch_object::class_name
const std::string & class_name() const
Definition: branch_object:57
tools::rroot::branch_object::stream
virtual bool stream(buffer &a_buffer)
Definition: branch_object:32
tools::rroot::branch::cast
virtual void * cast(const std::string &a_class) const
Definition: branch:31
tools::rroot::branch_object::branch_object
branch_object(const branch_object &a_from)
Definition: branch_object:53
tools::rroot::branch
Definition: branch:23
tools::rroot::buffer::check_byte_count
bool check_byte_count(uint32 a_start_pos, uint32 a_byte_count, const std::string &a_store_cls)
Definition: buffer:568
tools::rroot::branch_object::id_class
static cid id_class()
Definition: branch_object:26
tools::rroot::branch_object::cast
virtual void * cast(cid a_class) const
Definition: branch_object:27
tools::rroot::branch_object::operator=
branch_object & operator=(const branch_object &)
Definition: branch_object:55
tools::rroot::branch_object_cid
cid branch_object_cid()
Definition: cids:42
tools::rroot::branch_object::s_class
static const std::string & s_class()
Definition: branch_object:15
tools::rroot::buffer::read_version
bool read_version(short &a_version)
Definition: buffer:503
tools::rroot::branch_object
Definition: branch_object:12
branch
tools::rroot::ifac
Definition: ifac:19
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::rroot::branch_object::fClassName
std::string fClassName
Definition: branch_object:62
tools::rroot::branch::stream
virtual bool stream(buffer &a_buffer)
Definition: branch:44
tools::rroot::buffer
Definition: buffer:43
tools::rroot::branch_object::cast
virtual void * cast(const std::string &a_class) const
Definition: branch_object:20
tools::rroot::branch_object::s_cls
virtual const std::string & s_cls() const
Definition: branch_object:24
tools::rroot::branch_object::branch_object
branch_object(std::ostream &a_out, ifac &a_fac)
Definition: branch_object:43
tools::rroot::rbuf::read
bool read(unsigned char &a_x)
Definition: rbuf:146
tools::rroot::iro
Definition: iro:19
tools::rroot::branch_object::~branch_object
virtual ~branch_object()
Definition: branch_object:49
tools::cid
unsigned short cid
Definition: cid:9