inlib  1.2.0
Public Member Functions | Protected Member Functions | Protected Attributes
inlib::rroot::ObjArray< T > Class Template Reference
Inheritance diagram for inlib::rroot::ObjArray< T >:
Inheritance graph
[legend]
Collaboration diagram for inlib::rroot::ObjArray< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ObjArray (bool a_owner)
virtual ~ObjArray ()
void cleanup ()
bool stream (buffer &a_buffer, ifac &a_fac, const ifac::args &a_args, bool a_accept_null=false)

Protected Member Functions

 ObjArray (const ObjArray &)
ObjArrayoperator= (const ObjArray &)
void _clear ()

Protected Attributes

bool m_owner

Detailed Description

template<class T>
class inlib::rroot::ObjArray< T >

Definition at line 90 of file named.


Constructor & Destructor Documentation

template<class T>
inlib::rroot::ObjArray< T >::ObjArray ( bool  a_owner) [inline]

Definition at line 92 of file named.

:m_owner(a_owner){}
template<class T>
virtual inlib::rroot::ObjArray< T >::~ObjArray ( ) [inline, virtual]

Definition at line 93 of file named.

{_clear();}
template<class T>
inlib::rroot::ObjArray< T >::ObjArray ( const ObjArray< T > &  ) [inline, protected]

Definition at line 95 of file named.

: std::vector<T*>(){}

Member Function Documentation

template<class T>
void inlib::rroot::ObjArray< T >::_clear ( ) [inline, protected]

Definition at line 149 of file named.

                {
    if(m_owner) {
      inlib::clear<T>(*this);
    } else {
      std::vector<T*>::clear();
    }
  }
template<class T>
void inlib::rroot::ObjArray< T >::cleanup ( ) [inline]

Definition at line 98 of file named.

{_clear();}
template<class T>
ObjArray& inlib::rroot::ObjArray< T >::operator= ( const ObjArray< T > &  ) [inline, protected]

Definition at line 96 of file named.

{return *this;}
template<class T>
bool inlib::rroot::ObjArray< T >::stream ( buffer a_buffer,
ifac a_fac,
const ifac::args a_args,
bool  a_accept_null = false 
) [inline]

Definition at line 100 of file named.

                                                                                              {
    _clear();

    short v;
    unsigned int s, c;
    if(!a_buffer.read_version(v,s,c)) return false;

    //::printf("debug : ObjArray::stream : version %d count %d\n",v,c);

   {uint32 id,bits;
    if(!Object_stream(a_buffer,id,bits)) return false;}
    std::string name;
    if(!a_buffer.read(name)) return false;
    int nobjects;
    if(!a_buffer.read(nobjects)) return false;
    int lowerBound;
    if(!a_buffer.read(lowerBound)) return false;

    //::printf("debug : ObjArray : nobject \"%s\" %d %d\n",
    //  name.c_str(),nobjects,lowerBound);

    for (int i=0;i<nobjects;i++) {
      //::printf("debug : ObjArray :    n=%d i=%d ...\n",nobjects,i);
      iro* obj;
      if(!a_buffer.read_object(a_fac,a_args,obj)){
        a_buffer.out() << "inlib::rroot::ObjArray::stream :"
                       << " can't read object."
                       << std::endl;
        return false;
      }
      //::printf("debug : ObjArray :    n=%d i=%d : ok\n",nobjects,i);
      if(obj) {
        T* to = inlib::cast<iro,T>(*obj);
        if(!to) {
          a_buffer.out() << "inlib::rroot::ObjArray::stream :"
                         << " inlib::cast failed."
                         << std::endl;
        } else {
          push_back(to);
        }
      } else {
        //a_accept_null for branch::stream m_baskets.
        if(a_accept_null) this->push_back(0);
      }
    }

    return a_buffer.check_byte_count(s,c,"TObjArray");
  }

Member Data Documentation

template<class T>
bool inlib::rroot::ObjArray< T >::m_owner [protected]

Definition at line 157 of file named.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines