Gaudi Framework, version v23r8

Home   Generated: Fri May 31 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
GaudiRoot::IOHandler< T > Class Template Reference
Inheritance diagram for GaudiRoot::IOHandler< T >:
Inheritance graph
[legend]
Collaboration diagram for GaudiRoot::IOHandler< T >:
Collaboration graph
[legend]

Public Member Functions

 IOHandler (TClass *c)
 Initializing constructor.
 
virtual ~IOHandler ()
 Standard destructor.
 
virtual void operator() (TBuffer &b, void *obj)
 ROOT I/O callback.
 
virtual void get (TBuffer &b, void *obj)
 Callback for reading the object.
 
virtual void put (TBuffer &b, void *obj)
 Callback for writing the object.
 
template<>
void get (TBuffer &b, void *obj)
 
template<>
void put (TBuffer &b, void *obj)
 
template<>
void get (TBuffer &b, void *obj)
 
template<>
void put (TBuffer &b, void *obj)
 
template<>
void get (TBuffer &b, void *obj)
 
template<>
void put (TBuffer &, void *)
 

Protected Attributes

TClass * m_root
 ROOT persistent class description.
 

Detailed Description

template<class T>
class GaudiRoot::IOHandler< T >

Definition at line 54 of file RootIOHandler.cpp.

Constructor & Destructor Documentation

template<class T >
GaudiRoot::IOHandler< T >::IOHandler ( TClass *  c)
inline

Initializing constructor.

Definition at line 60 of file RootIOHandler.cpp.

: m_root(c) { }
template<class T >
virtual GaudiRoot::IOHandler< T >::~IOHandler ( )
inlinevirtual

Standard destructor.

Definition at line 62 of file RootIOHandler.cpp.

{ }

Member Function Documentation

template<class T >
virtual void GaudiRoot::IOHandler< T >::get ( TBuffer &  b,
void *  obj 
)
virtual

Callback for reading the object.

template<>
void GaudiRoot::IOHandler< SmartRefBase >::get ( TBuffer &  b,
void *  obj 
)

Definition at line 87 of file RootIOHandler.cpp.

{
RefAccessor r(obj);
UInt_t start, count;
Version_t version = b.ReadVersion(&start, &count, m_root);
m_root->ReadBuffer(b, obj, version, start, count);
switch( r.Base->objectType() ) {
(*r.ObjectRef)(Gaudi::getCurrentDataObject());
break;
(*r.ContainedRef)(Gaudi::getCurrentDataObject());
break;
default:
cout << "Hit uninitialized smartRef!!!!" << endl;
break;
}
}
template<>
void GaudiRoot::IOHandler< ContainedObject >::get ( TBuffer &  b,
void *  obj 
)

Definition at line 164 of file RootIOHandler.cpp.

{
UInt_t start, count;
Version_t version = b.ReadVersion(&start, &count, m_root);
m_root->ReadBuffer(b, obj, version, start, count);
}
template<>
void GaudiRoot::IOHandler< pool::Token >::get ( TBuffer &  b,
void *  obj 
)

Definition at line 176 of file RootIOHandler.cpp.

{
UInt_t start, count;
b.ReadVersion(&start, &count, m_root);
b.ReadFastArray(&t->m_oid.first, 2);
b.CheckByteCount(start, count, m_root);
}
template<class T >
virtual void GaudiRoot::IOHandler< T >::operator() ( TBuffer &  b,
void *  obj 
)
inlinevirtual

ROOT I/O callback.

Definition at line 64 of file RootIOHandler.cpp.

{
try {
if ( b.IsReading() )
get(b,obj);
else
put(b,obj);
}
catch( const exception& e ) {
string err = "Class:" + string(m_root->GetName()) + "> Exception in object I/O";
err += e.what();
throw runtime_error(err);
}
catch( ... ) {
string err = "Class:" + string(m_root->GetName()) + "> Exception in object I/O";
throw runtime_error(err);
}
}
template<class T >
virtual void GaudiRoot::IOHandler< T >::put ( TBuffer &  b,
void *  obj 
)
virtual

Callback for writing the object.

template<>
void GaudiRoot::IOHandler< SmartRefBase >::put ( TBuffer &  b,
void *  obj 
)

Definition at line 105 of file RootIOHandler.cpp.

{
RefAccessor r(obj);
DataObject* curr, *pDO;
int hint, link;
pDO = r.ObjectRef->data();
hint = r.ObjectRef->hintID();
link = r.ObjectRef->linkID();
if ( pDO ) {
switch( r.Base->objectType() ) {
p = r.ContainedRef->data();
if ( p ) {
const ObjectContainerBase* parent = p->parent();
if ( parent ) {
link = p->index();
pDO = const_cast<ObjectContainerBase*>(parent);
break;
}
}
pDO = 0;
cout << "IOHandler<SmartRefBase>::onWrite> "
<< "Found invalid smart reference with object "
<< "having no parent."
<< endl;
throw runtime_error("IOHandler<SmartRefBase>::onWrite> "
"Found invalid smart reference with object "
"having no parent.");
break;
break;
default:
break;
}
if ( pDO == last_link_object ) {
r.Base->set(curr, last_link_hint, link);
m_root->WriteBuffer(b, obj);
return;
}
else if ( pDO ) {
LinkManager* mgr = curr->linkMgr();
IRegistry* reg = pDO->registry();
if ( reg && mgr ) {
hint = mgr->addLink(reg->identifier(), pDO);
}
}
else {
hint = link = StreamBuffer::INVALID;
}
}
r.Base->set(curr, hint, link);
m_root->WriteBuffer(b, obj);
}
template<>
void GaudiRoot::IOHandler< ContainedObject >::put ( TBuffer &  b,
void *  obj 
)

Definition at line 172 of file RootIOHandler.cpp.

{
m_root->WriteBuffer(b, obj);
}
template<>
void GaudiRoot::IOHandler< pool::Token >::put ( TBuffer &  ,
void *   
)

Definition at line 184 of file RootIOHandler.cpp.

{
throw runtime_error("Writing POOL files is not implemented!");
}

Member Data Documentation

template<class T >
TClass* GaudiRoot::IOHandler< T >::m_root
protected

ROOT persistent class description.

Definition at line 57 of file RootIOHandler.cpp.


The documentation for this class was generated from the following file:

Generated at Fri May 31 2013 15:09:28 for Gaudi Framework, version v23r8 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004