g4tools  5.4.0
Public Member Functions | List of all members
tools::wroot::obj_array< T > Class Template Reference
Inheritance diagram for tools::wroot::obj_array< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::wroot::obj_array< T >:
Collaboration graph
[legend]

Public Member Functions

virtual const std::string & store_cls () const
 
virtual bool stream (buffer &a_buffer) const
 
 obj_array ()
 
virtual ~obj_array ()
 
 obj_array (const obj_array &a_from)
 
obj_arrayoperator= (const obj_array &a_from)
 
void clear_objs ()
 
- Public Member Functions inherited from tools::wroot::ibo
virtual ~ibo ()
 

Detailed Description

template<class T>
class tools::wroot::obj_array< T >

Definition at line 34 of file named.

Constructor & Destructor Documentation

◆ obj_array() [1/2]

template<class T >
tools::wroot::obj_array< T >::obj_array ( )
inline

Definition at line 64 of file named.

64 {}

◆ ~obj_array()

template<class T >
virtual tools::wroot::obj_array< T >::~obj_array ( )
inlinevirtual

Definition at line 65 of file named.

65 {safe_clear<T>(*this);}

◆ obj_array() [2/2]

template<class T >
tools::wroot::obj_array< T >::obj_array ( const obj_array< T > &  a_from)
inline

Definition at line 67 of file named.

67  : ibo(a_from),std::vector<T*>() {
68  typedef typename std::vector<T*>::const_iterator it_t;
69  it_t it;
70  for(it=a_from.begin();it!=a_from.end();++it) {
71  std::vector<T*>::push_back((*it)->copy());
72  }
73  }

Member Function Documentation

◆ clear_objs()

template<class T >
void tools::wroot::obj_array< T >::clear_objs ( )
inline

Definition at line 86 of file named.

86 {safe_clear<T>(*this);}

◆ operator=()

template<class T >
obj_array& tools::wroot::obj_array< T >::operator= ( const obj_array< T > &  a_from)
inline

Definition at line 74 of file named.

74  {
75  if(&a_from==this) return *this;
76  safe_clear<T>(*this);
77 
78  typedef typename std::vector<T*>::const_iterator it_t;
79  it_t it;
80  for(it=a_from.begin();it!=a_from.end();++it) {
81  std::vector<T*>::push_back((*it)->copy());
82  }
83  return *this;
84  }

◆ store_cls()

template<class T >
virtual const std::string& tools::wroot::obj_array< T >::store_cls ( ) const
inlinevirtual

Implements tools::wroot::ibo.

Definition at line 37 of file named.

37  {
38  static const std::string s_v("TObjArray");
39  return s_v;
40  }

◆ stream()

template<class T >
virtual bool tools::wroot::obj_array< T >::stream ( buffer a_buffer) const
inlinevirtual

Implements tools::wroot::ibo.

Definition at line 41 of file named.

41  {
42  unsigned int c;
43  if(!a_buffer.write_version(3,c)) return false;
44  if(!Object_stream(a_buffer)) return false;
45  if(!a_buffer.write(std::string(""))) return false;
46  int nobjects = int(std::vector<T*>::size());
47  if(!a_buffer.write(nobjects)) return false;
48  int lowerBound = 0;
49  if(!a_buffer.write(lowerBound)) return false;
50 
51  typedef typename std::vector<T*>::const_iterator it_t;
52  it_t it;
53  for(it=std::vector<T*>::begin();it!=std::vector<T*>::end();++it) {
54  if(*it) {
55  if(!a_buffer.write_object(*(*it))) return false;
56  } else { //Could happen with branch::m_baskets.
57  if(!a_buffer.write(kNullTag())) return false;
58  }
59  }
60  if(!a_buffer.set_byte_count(c)) return false;
61  return true;
62  }

The documentation for this class was generated from the following file:
tools::waxml::begin
void begin(std::ostream &a_writer)
Definition: begend:15
tools::file::size
bool size(const std::string &a_file, long &a_size)
Definition: fsize:13
tools::wroot::Object_stream
bool Object_stream(buffer &a_buffer)
Definition: named:14
tools::waxml::end
void end(std::ostream &a_writer)
Definition: begend:31