g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::rroot::streamer_info Class Reference
Inheritance diagram for tools::rroot::streamer_info:
Inheritance graph
[legend]
Collaboration diagram for tools::rroot::streamer_info:
Collaboration graph
[legend]

Public Member Functions

virtual void * cast (const std::string &a_class) const
 
virtual void * cast (cid a_class) const
 
virtual const std::string & s_cls () const
 
virtual irocopy () const
 
virtual bool stream (buffer &a_buffer)
 
void out (std::ostream &a_out) const
 
 streamer_info (ifac &a_fac)
 
virtual ~streamer_info ()
 
const std::string & name () const
 
streamer_elementfind_streamer_element (size_t a_index) const
 
- Public Member Functions inherited from tools::rroot::iro
virtual ~iro ()
 

Static Public Member Functions

static const std::string & s_class ()
 
static cid id_class ()
 

Protected Member Functions

 streamer_info (const streamer_info &a_from)
 
streamer_infooperator= (const streamer_info &a_from)
 

Protected Attributes

ifacm_fac
 
std::string m_name
 
std::string m_title
 
unsigned int m_check_sum
 
int m_streamed_class_version
 
obj_array< streamer_elementm_elements
 

Detailed Description

Definition at line 153 of file info.

Constructor & Destructor Documentation

◆ streamer_info() [1/2]

tools::rroot::streamer_info::streamer_info ( ifac a_fac)
inline

Definition at line 209 of file info.

210  :m_fac(a_fac)
211  ,m_name()
212  ,m_title()
213  ,m_check_sum(0)
215  ,m_elements(a_fac)
216  {
217 #ifdef TOOLS_MEM
218  mem::increment(s_class().c_str());
219 #endif
220  }

◆ ~streamer_info()

virtual tools::rroot::streamer_info::~streamer_info ( )
inlinevirtual

Definition at line 221 of file info.

221  {
222 #ifdef TOOLS_MEM
223  mem::decrement(s_class().c_str());
224 #endif
225  }

◆ streamer_info() [2/2]

tools::rroot::streamer_info::streamer_info ( const streamer_info a_from)
inlineprotected

Definition at line 227 of file info.

228  :iro(a_from)
229  ,m_fac(a_from.m_fac)
230  ,m_name(a_from.m_name)
231  ,m_title(a_from.m_name)
232  ,m_check_sum(a_from.m_check_sum)
233  ,m_streamed_class_version(a_from.m_streamed_class_version)
234  ,m_elements(a_from.m_elements)
235  {
236 #ifdef TOOLS_MEM
237  mem::increment(s_class().c_str());
238 #endif
239  }

Member Function Documentation

◆ cast() [1/2]

virtual void* tools::rroot::streamer_info::cast ( cid  a_class) const
inlinevirtual

Implements tools::rroot::iro.

Definition at line 169 of file info.

169  {
170  if(void* p = cmp_cast<streamer_info>(this,a_class)) {return p;}
171  else return 0;
172  }

◆ cast() [2/2]

virtual void* tools::rroot::streamer_info::cast ( const std::string &  a_class) const
inlinevirtual

Implements tools::rroot::iro.

Definition at line 165 of file info.

165  {
166  if(void* p = cmp_cast<streamer_info>(this,a_class)) return p;
167  return 0;
168  }

◆ copy()

virtual iro* tools::rroot::streamer_info::copy ( ) const
inlinevirtual

Implements tools::rroot::iro.

Definition at line 174 of file info.

174 {return new streamer_info(*this);}

◆ find_streamer_element()

streamer_element* tools::rroot::streamer_info::find_streamer_element ( size_t  a_index) const
inline

Definition at line 250 of file info.

250  {
251  if(a_index>=m_elements.size()) return 0;
252  return m_elements[a_index];
253  }

◆ id_class()

static cid tools::rroot::streamer_info::id_class ( )
inlinestatic

Definition at line 163 of file info.

163 {return streamer_info_cid();}

◆ name()

const std::string& tools::rroot::streamer_info::name ( ) const
inline

Definition at line 249 of file info.

249 {return m_name;}

◆ operator=()

streamer_info& tools::rroot::streamer_info::operator= ( const streamer_info a_from)
inlineprotected

Definition at line 240 of file info.

240  {
241  m_name = a_from.m_name;
242  m_title = a_from.m_name;
243  m_check_sum = a_from.m_check_sum;
244  m_streamed_class_version = a_from.m_streamed_class_version;
245  m_elements = a_from.m_elements;
246  return *this;
247  }

◆ out()

void tools::rroot::streamer_info::out ( std::ostream &  a_out) const
inline

Definition at line 202 of file info.

202  {
203  a_out << "streamer_info for class :"
204  << " " << m_name << ", version=" << m_streamed_class_version
205  << std::endl;
206  tools_vforcit(streamer_element*,m_elements,it) (*it)->out(a_out);
207  }

◆ s_class()

static const std::string& tools::rroot::streamer_info::s_class ( )
inlinestatic

Definition at line 159 of file info.

159  {
160  static const std::string s_v("tools::rroot::streamer_info");
161  return s_v;
162  }

◆ s_cls()

virtual const std::string& tools::rroot::streamer_info::s_cls ( ) const
inlinevirtual

Implements tools::rroot::iro.

Definition at line 173 of file info.

173 {return s_class();}

◆ stream()

virtual bool tools::rroot::streamer_info::stream ( buffer a_buffer)
inlinevirtual

Implements tools::rroot::iro.

Definition at line 176 of file info.

176  {
177  short v;
178  unsigned int s, c;
179  if(!a_buffer.read_version(v,s,c)) return false;
180 
181  if(!Named_stream(a_buffer,m_name,m_title)) return false;
182  if(!a_buffer.read(m_check_sum)) return false;
183  if(!a_buffer.read(m_streamed_class_version)) return false;
184 
185  //TObjArray *fElements; //Array of TStreamerElements
186  {obj_array<streamer_element>* obj;
187  ifac::args args;
188  args[ifac::arg_class()] = (void*)&(streamer_element::s_class());
189  bool obj_created;
190  if(!pointer_stream(a_buffer,m_fac,args,obj,obj_created)) {
191  a_buffer.out() << "tools::rroot::streamer_info::stream : "
192  << "can't read fElements."
193  << std::endl;
194  return false;
195  }
196  if(obj) m_elements.operator=(*obj);
197  if(obj_created) delete obj;}
198 
199  return a_buffer.check_byte_count(s,c,s_store_class());
200  }

Member Data Documentation

◆ m_check_sum

unsigned int tools::rroot::streamer_info::m_check_sum
protected

Definition at line 260 of file info.

◆ m_elements

obj_array<streamer_element> tools::rroot::streamer_info::m_elements
protected

Definition at line 263 of file info.

◆ m_fac

ifac& tools::rroot::streamer_info::m_fac
protected

Definition at line 255 of file info.

◆ m_name

std::string tools::rroot::streamer_info::m_name
protected

Definition at line 257 of file info.

◆ m_streamed_class_version

int tools::rroot::streamer_info::m_streamed_class_version
protected

Definition at line 261 of file info.

◆ m_title

std::string tools::rroot::streamer_info::m_title
protected

Definition at line 258 of file info.


The documentation for this class was generated from the following file:
tools::rroot::streamer_info::m_elements
obj_array< streamer_element > m_elements
Definition: info:263
tools::rroot::streamer_info::m_streamed_class_version
int m_streamed_class_version
Definition: info:261
tools::rroot::streamer_element::s_class
static const std::string & s_class()
Definition: info:22
tools::rroot::Named_stream
bool Named_stream(buffer &a_buffer, std::string &a_name, std::string &a_title)
Definition: named:15
tools::rroot::streamer_info::m_check_sum
unsigned int m_check_sum
Definition: info:260
tools::rroot::streamer_info::s_class
static const std::string & s_class()
Definition: info:159
tools::rroot::pointer_stream
bool pointer_stream(buffer &a_buffer, ifac &a_fac, ifac::args &a_args, const std::string &a_T_class, T *&a_obj, bool &a_created)
Definition: buffer:646
tools::rroot::streamer_info::m_title
std::string m_title
Definition: info:258
tools::rroot::streamer_info_cid
cid streamer_info_cid()
Definition: cids:34
tools::rroot::streamer_info::m_name
std::string m_name
Definition: info:257
tools::rroot::ifac::arg_class
static char arg_class()
Definition: ifac:34
tools::rroot::streamer_info::streamer_info
streamer_info(ifac &a_fac)
Definition: info:209
tools::rroot::streamer_info::m_fac
ifac & m_fac
Definition: info:255
tools::rroot::ifac::args
std::map< char, void * > args
Definition: ifac:21
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7