Gaudi Framework, version v20r2

Generated: 18 Jul 2008

DataObject Class Reference

#include <GaudiKernel/DataObject.h>

Inheritance diagram for DataObject:

Inheritance graph
[legend]
Collaboration diagram for DataObject:

Collaboration graph
[legend]
List of all members.

Detailed Description

A DataObject is the base class of any identifyable object on any data store.

The base class supplies the implementation of data streaming.

Author:
M.Frank

Definition at line 31 of file DataObject.h.

inline code of class DataObject

void setRegistry (IRegistry *pRegistry)
 Set pointer to Registry.
IRegistryregistry () const
 Get pointer to Registry.
LinkManagerlinkMgr () const
 Retrieve Link manager.
const unsigned char version () const
 Retrieve version number of this object representation.
void setVersion (unsigned char vsn)
 Set version number of this object representation.
unsigned long refCount () const
 Return the refcount.
virtual std::ostreamfillStream (std::ostream &s) const
 Fill the output stream (ASCII).
std::ostreamoperator<< (std::ostream &s, const DataObject &obj)
 Output operator (ASCII).

Public Member Functions

 DataObject ()
 Standard Constructor.
 DataObject (const DataObject &)
 Copy Constructor.
virtual ~DataObject ()
 Standard Destructor.
virtual unsigned long addRef ()
 Add reference to object.
virtual unsigned long release ()
 release reference to object
virtual const CLIDclID () const
 Retrieve reference to class definition structure.
const std::stringname () const
 Retreive DataObject name. It is the name when registered in the store.
virtual StreamBufferserialize (StreamBuffer &s)
 Serialization mechanism: Serialize the object for reading.
virtual StreamBufferserialize (StreamBuffer &s) const
 Serialization mechanism: Serialize the object for writing.

Static Public Member Functions

static const CLIDclassID ()
 Retrieve reference to class definition structure (static access).

Private Attributes

unsigned long m_refCount
 Reference count.
unsigned char m_version
 Version number.
IRegistrym_pRegistry
 Pointer to the Registry Object.
LinkManagerm_pLinkMgr
 Store of symbolic links.


Constructor & Destructor Documentation

DataObject::DataObject (  ) 

Standard Constructor.

Definition at line 13 of file DataObject.cpp.

References m_pLinkMgr, and LinkManager::newInstance().

00014  : m_refCount(0),
00015    m_version(0),
00016    m_pRegistry(0)
00017 {
00018   m_pLinkMgr = LinkManager::newInstance();
00019 }

DataObject::DataObject ( const DataObject  ) 

Copy Constructor.

Definition at line 22 of file DataObject.cpp.

References m_pLinkMgr, and LinkManager::newInstance().

00023  : m_refCount(0),
00024    m_version(0),
00025    m_pRegistry(0)
00026 {
00027   m_pLinkMgr = LinkManager::newInstance();
00028 }

DataObject::~DataObject (  )  [virtual]

Standard Destructor.

Definition at line 31 of file DataObject.cpp.

References m_pLinkMgr, and m_refCount.

00031                           {
00032   // Issue a warning if the object is being deleted and the reference
00033   // count is non-zero.
00034   if ( m_refCount > 0 ) {
00035     // Insert warning here
00036   }
00037   if ( m_pLinkMgr ) delete m_pLinkMgr;
00038   m_pLinkMgr = 0;
00039 }


Member Function Documentation

unsigned long DataObject::addRef (  )  [virtual]

Add reference to object.

Definition at line 51 of file DataObject.cpp.

References m_refCount.

Referenced by HistorySvc::registerSvc(), DataSvcHelpers::RegistryEntry::setObject(), and DataSvc::unregisterObject().

00051                                   {
00052   return ++m_refCount;
00053 }

unsigned long DataObject::release (  )  [virtual]

release reference to object

Definition at line 42 of file DataObject.cpp.

References m_refCount.

Referenced by MultiStoreSvc::clearStore(), PoolDbNTupleCnv::createObj(), PoolDbBaseCnv::createObj(), DataSvc::registerObject(), DataSvcHelpers::RegistryEntry::setObject(), MultiStoreSvc::setRoot(), and DataSvcHelpers::RegistryEntry::~RegistryEntry().

00042                                    {
00043   unsigned long cnt = --m_refCount;
00044   if ( 0 == m_refCount )   {
00045     delete this;
00046   }
00047   return cnt;
00048 }

const CLID & DataObject::clID (  )  const [virtual]

Retrieve reference to class definition structure.

Reimplemented in AlgorithmHistory, AlgToolHistory, DataHistory, HistoryObj, JobHistory, KeyedContainer< DATATYPE, MAPPING >, NTuple::Directory, NTuple::File, NTuple::ColumnWiseTuple, NTuple::RowWiseTuple, ObjectList< TYPE >, ObjectVector< TYPE >, RefTable1to1< FROM, TO >, RefTable1toN< FROM, TO >, ServiceHistory, AIDATuple, Gaudi::Histogram1D, Gaudi::Histogram2D, Gaudi::Histogram3D, Gaudi::Profile1D, and Gaudi::Profile2D.

Definition at line 56 of file DataObject.cpp.

References CLID_DataObject.

Referenced by HistogramAgent::analyse(), CollectionCloneAlg::book(), PoolDbNTupleCnv::createRep(), NTuple::Tuple::i_addItem(), NTuple::Tuple::i_addObject(), NTuple::Tuple::i_item(), ConversionSvc::makeCall(), MultiStoreSvc::preparePartitions(), and StoreExplorerAlg::printObj().

00056                                      {
00057   return CLID_DataObject;
00058 }

const CLID & DataObject::classID (  )  [static]

Retrieve reference to class definition structure (static access).

Reimplemented in AlgorithmHistory, AlgToolHistory, DataHistory, HistoryObj, JobHistory, KeyedContainer< DATATYPE, MAPPING >, NTuple::Directory, NTuple::File, NTuple::ColumnWiseTuple, NTuple::RowWiseTuple, ObjectList< TYPE >, ObjectVector< TYPE >, ServiceHistory, AIDATuple, Gaudi::Histogram1D, Gaudi::Histogram2D, Gaudi::Histogram3D, Gaudi::Profile1D, and Gaudi::Profile2D.

Definition at line 61 of file DataObject.cpp.

References CLID_DataObject.

00061                                    {
00062   return CLID_DataObject;
00063 }

const std::string & DataObject::name (  )  const

Retreive DataObject name. It is the name when registered in the store.

Reimplemented in NTuple::File, and ServiceHistory.

Definition at line 66 of file DataObject.cpp.

References _sDataObjectCppNotRegistered, m_pRegistry, and IRegistry::name().

Referenced by NTuple::Tuple::addIndexedItem(), NTuple::Tuple::addItem(), RootHistCnv::DirectoryCnv::createRep(), NTuple::TupleImp::find(), NTuple::Tuple::i_addItem(), NTuple::Tuple::i_addObject(), NTuple::TupleImp::i_find(), NTuple::Tuple::i_item(), NTuple::Tuple::item(), DataSvc::preLoad(), and NTuple::TupleImp::remove().

00066                                         {
00067   if( m_pRegistry != 0) {
00068     return m_pRegistry->name();
00069   }
00070   else {
00071     return _sDataObjectCppNotRegistered;
00072   }
00073 }

StreamBuffer & DataObject::serialize ( StreamBuffer s  )  [virtual]

Serialization mechanism: Serialize the object for reading.

Reimplemented in RefTableBase< FROM, MAPENTRY >, Gaudi::Histogram1D, RefTableBase< FROM, SmartRefVector< TO > >, and RefTableBase< FROM, SmartRef< TO > >.

Definition at line 76 of file DataObject.cpp.

References m_version, and Gaudi::Units::s.

Referenced by Gaudi::Histogram1D::serialize(), and RefTableBase< FROM, SmartRef< TO > >::serialize().

00076                                                      {
00077   return s >> m_version;
00078 }

StreamBuffer & DataObject::serialize ( StreamBuffer s  )  const [virtual]

Serialization mechanism: Serialize the object for writing.

Reimplemented in RefTableBase< FROM, MAPENTRY >, Gaudi::Histogram1D, RefTableBase< FROM, SmartRefVector< TO > >, and RefTableBase< FROM, SmartRef< TO > >.

Definition at line 81 of file DataObject.cpp.

References m_version, and Gaudi::Units::s.

00081                                                              {
00082   return s << m_version;
00083 }

void DataObject::setRegistry ( IRegistry pRegistry  )  [inline]

Set pointer to Registry.

Definition at line 67 of file DataObject.h.

References m_pRegistry.

Referenced by DataSvcHelpers::RegistryEntry::makeHard(), DataSvc::registerObject(), DataSvcHelpers::RegistryEntry::setObject(), and DataSvcHelpers::RegistryEntry::~RegistryEntry().

00067                                             {
00068     m_pRegistry = pRegistry;
00069   }

IRegistry* DataObject::registry (  )  const [inline]

Get pointer to Registry.

Definition at line 71 of file DataObject.h.

References m_pRegistry.

Referenced by Objects::access(), SmartRefBase::accessData(), LinkManager::Link::address(), AIDATupleSvc::book(), RootHistCnv::RConverter::changeDirectory(), CollectionCloneAlg::checkInput(), DataSvc::clearSubTree(), TagCollectionSvc::connect(), RootHistCnv::RConverter::createAddress(), NTupleSvc::createDirectory(), HbookCnv::H2DCnv::createObj(), HbookCnv::H1DCnv::createObj(), RootHistCnv::RHistogramCnv< T, S, Q >::createPersistent(), RootHistCnv::RNTupleCnv::createRep(), RootHistCnv::RFileCnv::createRep(), RootHistCnv::RDirectoryCnv::createRep(), HbookCnv::HNTupleCnv::createRep(), HbookCnv::HFileCnv::createRep(), HbookCnv::HDirectoryCnv::createRep(), HbookCnv::HConverter::createRep(), PoolDbNTupleCnv::createRep(), PoolDbDirectoryCnv::createRep(), PoolDbBaseCnv::createRep(), PoolDbBaseCnv::dumpReferences(), RootHistCnv::RDirectoryCnv::fillObjRefs(), HbookCnv::HDirectoryCnv::fillObjRefs(), PoolDbNTupleCnv::fillRepRefs(), SmartDataObjectPtr::findObject(), DataSvc::findObject(), EventCollectionSelector::getPreviousRecord(), histoAddr(), DataSvcHelpers::RegistryEntry::i_find(), SmartRefBase::isEqualEx(), DataSvc::linkObject(), GaudiAlg::Print::location(), DataSvc::objectLeaves(), DataSvc::objectParent(), oname(), Gaudi::Utils::Histos::path(), DataSvc::preLoad(), PoolDbIOHandler< T >::put(), NTupleSvc::readRecord(), DataSvc::registerAddress(), DataSvc::registerObject(), DataSvc::retrieveEntry(), AIDATupleSvc::retrieveObject(), SmartDataObjectPtr::retrieveObject(), DataSvc::retrieveObject(), NTupleSvc::save(), SmartDataLocator< TYPE >::SmartDataLocator(), SmartDataPtr< TYPE >::SmartDataPtr(), DataSvc::traverseSubTree(), DataSvc::unlinkObject(), DataSvc::unregisterAddress(), DataSvc::unregisterObject(), DataSvc::updateObject(), PoolDbBaseCnv::updateObjRefs(), RootHistCnv::RNTupleCnv::updateRep(), RootHistCnv::RDirectoryCnv::updateRep(), HbookCnv::HNTupleCnv::updateRep(), HbookCnv::HFileCnv::updateRep(), HbookCnv::HDirectoryCnv::updateRep(), and NTupleSvc::writeRecord().

00071                                 {
00072     return m_pRegistry;
00073   }

LinkManager* DataObject::linkMgr (  )  const [inline]

Retrieve Link manager.

Definition at line 75 of file DataObject.h.

References m_pLinkMgr.

Referenced by Objects::access(), SmartRefBase::accessData(), PoolDbDataObjectHandler::bind(), PoolDbBaseCnv::dumpReferences(), SmartRefBase::isEqualEx(), SmartRefBase::path(), PoolDbIOHandler< T >::put(), PoolDbBaseCnv::setReferences(), and PoolDbBaseCnv::updateObjRefs().

00075                                     {
00076     return m_pLinkMgr;
00077   }

const unsigned char DataObject::version (  )  const [inline]

Retrieve version number of this object representation.

Definition at line 79 of file DataObject.h.

References m_version.

00079                                           {
00080     return m_version;
00081   }

void DataObject::setVersion ( unsigned char  vsn  )  [inline]

Set version number of this object representation.

Definition at line 83 of file DataObject.h.

References m_version.

00083                                         {
00084     m_version = vsn;
00085   }

unsigned long DataObject::refCount (  )  const [inline]

Return the refcount.

Definition at line 87 of file DataObject.h.

References m_refCount.

00087                                  { 
00088     return m_refCount; 
00089   }

virtual std::ostream& DataObject::fillStream ( std::ostream s  )  const [inline, virtual]

Fill the output stream (ASCII).

Reimplemented in ObjectList< TYPE >, and ObjectVector< TYPE >.

Definition at line 91 of file DataObject.h.

References std::hex(), and Gaudi::Units::s.

Referenced by GaudiPython::Printer< DataObject >::print().

00091                                                         {
00092     s << "DataObject at " << std::hex << this;
00093     return s;
00094   }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream s,
const DataObject obj 
) [friend]

Output operator (ASCII).

Definition at line 96 of file DataObject.h.

00096                                                                          {
00097     return obj.fillStream(s);
00098   }


Member Data Documentation

unsigned long DataObject::m_refCount [private]

Reference count.

Definition at line 34 of file DataObject.h.

Referenced by addRef(), refCount(), release(), and ~DataObject().

unsigned char DataObject::m_version [private]

Version number.

Reimplemented in AlgToolHistory.

Definition at line 36 of file DataObject.h.

Referenced by serialize(), setVersion(), and version().

IRegistry* DataObject::m_pRegistry [private]

Pointer to the Registry Object.

Definition at line 38 of file DataObject.h.

Referenced by name(), registry(), and setRegistry().

LinkManager* DataObject::m_pLinkMgr [private]

Store of symbolic links.

Definition at line 40 of file DataObject.h.

Referenced by DataObject(), linkMgr(), and ~DataObject().


The documentation for this class was generated from the following files:
Generated at Fri Jul 18 12:07:00 2008 for Gaudi Framework, version v20r2 by Doxygen version 1.5.1 written by Dimitri van Heesch, © 1997-2004