g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::rroot::streamer_element Class Reference
Inheritance diagram for tools::rroot::streamer_element:
Inheritance graph
[legend]
Collaboration diagram for tools::rroot::streamer_element:
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)
 
virtual void out (std::ostream &aOut) const
 
 streamer_element ()
 
virtual ~streamer_element ()
 
virtual void fullName (std::string &a_s) const
 
const std::string & type_name () 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_element (const streamer_element &a_from)
 
streamer_elementoperator= (const streamer_element &a_from)
 

Protected Attributes

std::string fName
 
std::string fTitle
 
int fType
 
int fSize
 
int fArrayLength
 
int fArrayDim
 
int fMaxIndex [5]
 
int fOffset
 
std::string fTypeName
 element offset in class More...
 

Detailed Description

Definition at line 16 of file info.

Constructor & Destructor Documentation

◆ streamer_element() [1/2]

tools::rroot::streamer_element::streamer_element ( )
inline

Definition at line 62 of file info.

63  :fName(),fTitle(),fType(-1)
64  ,fSize(0),fArrayLength(0),fArrayDim(0),fOffset(0)
65  ,fTypeName(){
66 #ifdef TOOLS_MEM
67  mem::increment(s_class().c_str());
68 #endif
69  for(int i=0;i<5;i++) fMaxIndex[i] = 0;
70  }

◆ ~streamer_element()

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

Definition at line 71 of file info.

71  {
72 #ifdef TOOLS_MEM
73  mem::decrement(s_class().c_str());
74 #endif
75  }

◆ streamer_element() [2/2]

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

Definition at line 77 of file info.

78  :iro(a_from)
79  ,fName(a_from.fName),fTitle(a_from.fTitle)
80  ,fType(a_from.fType),fSize(a_from.fSize)
81  ,fArrayLength(a_from.fArrayLength)
82  ,fArrayDim(a_from.fArrayDim),fOffset(a_from.fOffset)
83  ,fTypeName(a_from.fTypeName){
84 #ifdef TOOLS_MEM
85  mem::increment(s_class().c_str());
86 #endif
87  for(int i=0;i<5;i++) fMaxIndex[i] = a_from.fMaxIndex[i];
88  }

Member Function Documentation

◆ cast() [1/2]

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

Implements tools::rroot::iro.

Definition at line 32 of file info.

32  {
33  if(void* p = cmp_cast<streamer_element>(this,a_class)) {return p;}
34  else return 0;
35  }

◆ cast() [2/2]

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

Implements tools::rroot::iro.

Definition at line 28 of file info.

28  {
29  if(void* p = cmp_cast<streamer_element>(this,a_class)) return p;
30  return 0;
31  }

◆ copy()

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

Implements tools::rroot::iro.

Reimplemented in tools::rroot::dummy_streamer_element.

Definition at line 37 of file info.

37 {return new streamer_element(*this);}

◆ fullName()

virtual void tools::rroot::streamer_element::fullName ( std::string &  a_s) const
inlinevirtual

Definition at line 102 of file info.

102  {
103  a_s = fName;
104  for (int i=0;i<fArrayDim;i++) {
105  char cdim[32];
106  snpf(cdim,sizeof(cdim),"[%d]",fMaxIndex[i]);
107  a_s += cdim;
108  }
109  }

◆ id_class()

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

Definition at line 26 of file info.

26 {return streamer_element_cid();}

◆ operator=()

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

Definition at line 89 of file info.

89  {
90  fName = a_from.fName;
91  fTitle = a_from.fTitle;
92  fType = a_from.fType;
93  fSize = a_from.fSize;
94  fArrayLength = a_from.fArrayLength;
95  fArrayDim = a_from.fArrayDim;
96  fOffset = a_from.fOffset;
97  fTypeName = a_from.fTypeName;
98  for(int i=0;i<5;i++) fMaxIndex[i] = a_from.fMaxIndex[i];
99  return *this;
100  }

◆ out()

virtual void tools::rroot::streamer_element::out ( std::ostream &  aOut) const
inlinevirtual

Definition at line 53 of file info.

53  {
54  std::string _fname;
55  fullName(_fname);
56  char s[128];
57  snpf(s,sizeof(s)," %-14s%-15s offset=%3d type=%2d %-20s",
58  fTypeName.c_str(),_fname.c_str(),fOffset,fType,fTitle.c_str());
59  aOut << s << std::endl;
60  }

◆ s_class()

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

Definition at line 22 of file info.

22  {
23  static const std::string s_v("tools::rroot::streamer_element");
24  return s_v;
25  }

◆ s_cls()

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

Implements tools::rroot::iro.

Definition at line 36 of file info.

36 {return s_class();}

◆ stream()

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

Implements tools::rroot::iro.

Reimplemented in tools::rroot::dummy_streamer_element.

Definition at line 39 of file info.

39  {
40  short v;
41  unsigned int s, c;
42  if(!a_buffer.read_version(v,s,c)) return false;
43  if(!Named_stream(a_buffer,fName,fTitle)) return false;
44  if(!a_buffer.read(fType)) return false;
45  if(!a_buffer.read(fSize)) return false;
46  if(!a_buffer.read(fArrayLength)) return false;
47  if(!a_buffer.read(fArrayDim)) return false;
48  if(!a_buffer.read_fast_array<int>(fMaxIndex,5)) return false;
49  if(!a_buffer.read(fTypeName)) return false;
50  return a_buffer.check_byte_count(s,c,s_store_class());
51  }

◆ type_name()

const std::string& tools::rroot::streamer_element::type_name ( ) const
inline

Definition at line 110 of file info.

110 {return fTypeName;}

Member Data Documentation

◆ fArrayDim

int tools::rroot::streamer_element::fArrayDim
protected

Definition at line 118 of file info.

◆ fArrayLength

int tools::rroot::streamer_element::fArrayLength
protected

Definition at line 117 of file info.

◆ fMaxIndex

int tools::rroot::streamer_element::fMaxIndex[5]
protected

Definition at line 119 of file info.

◆ fName

std::string tools::rroot::streamer_element::fName
protected

Definition at line 112 of file info.

◆ fOffset

int tools::rroot::streamer_element::fOffset
protected

Definition at line 120 of file info.

◆ fSize

int tools::rroot::streamer_element::fSize
protected

Definition at line 116 of file info.

◆ fTitle

std::string tools::rroot::streamer_element::fTitle
protected

Definition at line 113 of file info.

◆ fType

int tools::rroot::streamer_element::fType
protected

Definition at line 115 of file info.

◆ fTypeName

std::string tools::rroot::streamer_element::fTypeName
protected

element offset in class

Definition at line 122 of file info.


The documentation for this class was generated from the following file:
tools::rroot::streamer_element::streamer_element
streamer_element()
Definition: info:62
tools::rroot::streamer_element::fSize
int fSize
Definition: info:116
tools::rroot::streamer_element::fTypeName
std::string fTypeName
element offset in class
Definition: info:122
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::snpf
int snpf(char *a_s, size_t a_n, const char *a_fmt,...)
Definition: snpf:27
tools::rroot::streamer_element::fName
std::string fName
Definition: info:112
tools::rroot::streamer_element::fullName
virtual void fullName(std::string &a_s) const
Definition: info:102
tools::rroot::streamer_element::fArrayDim
int fArrayDim
Definition: info:118
tools::rroot::streamer_element::fArrayLength
int fArrayLength
Definition: info:117
tools::rroot::streamer_element::fType
int fType
Definition: info:115
tools::rroot::streamer_element::fOffset
int fOffset
Definition: info:120
tools::rroot::streamer_element::fTitle
std::string fTitle
Definition: info:113
tools::rroot::streamer_element_cid
cid streamer_element_cid()
Definition: cids:35
tools::rroot::streamer_element::fMaxIndex
int fMaxIndex[5]
Definition: info:119