| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# DataObject Class Reference

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

`#include <GaudiKernel/DataObject.h>`

Inheritance diagram for DataObject:

[legend]
Collaboration diagram for DataObject:

[legend]

List of all members.

## inline code of class DataObject
void | setRegistry (IRegistry *pRegistry)
| Set pointer to Registry.
IRegistry * | registry () const
| Get pointer to Registry.
LinkManager * | linkMgr () const
| Retrieve Link manager.
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::ostream & | fillStream (std::ostream &s) const
| Fill the output stream (ASCII).
std::ostream & | operator<< (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 CLID & | clID () const
| Retrieve reference to class definition structure.
const std::string & | name () const
| Retreive DataObject name. It is the name when registered in the store.
virtual StreamBuffer & | serialize (StreamBuffer &s)
| Serialization mechanism: Serialize the object for reading.
virtual StreamBuffer & | serialize (StreamBuffer &s) const
| Serialization mechanism: Serialize the object for writing.
## Static Public Member Functions
static const CLID & | classID ()
| Retrieve reference to class definition structure (static access).
## Private Attributes
unsigned long | m_refCount
| Reference count.
unsigned char | m_version
| Version number.
IRegistry * | m_pRegistry
| Pointer to the Registry Object.
LinkManager * | m_pLinkMgr
| Store of symbolic links.

## Detailed Description

A DataObject is the base class of any identifiable 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.

## Constructor & Destructor Documentation

DataObject::DataObject | ( |  | ) |

Standard Constructor.

Definition at line 15 of file DataObject.cpp.

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

DataObject::DataObject | ( | const DataObject & |  | ) |

Copy Constructor.

Standard Constructor.

Definition at line 24 of file DataObject.cpp.

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

DataObject::~DataObject | ( |  | ) | `[virtual]`

Standard Destructor.

Definition at line 33 of file DataObject.cpp.

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

## Member Function Documentation

unsigned long DataObject::addRef | ( |  | ) | `[virtual]`

Add reference to object.

Definition at line 53 of file DataObject.cpp.

    00053                                   {
    00054   return ++m_refCount;
    00055 }

unsigned long DataObject::release | ( |  | ) | `[virtual]`

release reference to object

Decrease reference count.

Definition at line 44 of file DataObject.cpp.

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

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

Retrieve reference to class definition structure.

Retrieve Pointer 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, SharedObjectsContainer< TYPE >, AIDATuple, Gaudi::Histogram1D, Gaudi::Histogram2D, Gaudi::Histogram3D, Gaudi::Profile1D, and Gaudi::Profile2D.

Definition at line 58 of file DataObject.cpp.

    00058                                      {
    00059   return CLID_DataObject;
    00060 }

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

Retrieve reference to class definition structure (static access).

Retrieve Pointer 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 >, ServiceHistory, SharedObjectsContainer< TYPE >, AIDATuple, Gaudi::Histogram1D, Gaudi::Histogram2D, Gaudi::Histogram3D, Gaudi::Profile1D, and Gaudi::Profile2D.

Definition at line 63 of file DataObject.cpp.

    00063                                    {
    00064   return CLID_DataObject;
    00065 }

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

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

Retrieve DataObject name. It is the name when included in the store.

Reimplemented in NTuple::File, and ServiceHistory.

Definition at line 68 of file DataObject.cpp.

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

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

Serialization mechanism: Serialize the object for reading.

ISerialize implementation: Serialize the object for reading.

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

Definition at line 78 of file DataObject.cpp.

    00078                                                      {
    00079   return s >> m_version;
    00080 }

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

Serialization mechanism: Serialize the object for writing.

ISerialize implementation: Serialize the object for writing.

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

Definition at line 83 of file DataObject.cpp.

    00083                                                              {
    00084   return s << m_version;
    00085 }

void DataObject::setRegistry | ( | IRegistry * | pRegistry | ) | `[inline]`

Set pointer to Registry.

Definition at line 67 of file DataObject.h.

    00067                                             {
    00068     m_pRegistry = pRegistry;
    00069   }

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

Get pointer to Registry.

Definition at line 71 of file DataObject.h.

    00071                                 {
    00072     return m_pRegistry;
    00073   }

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

Retrieve Link manager.

Definition at line 75 of file DataObject.h.

    00075                                     {
    00076     return m_pLinkMgr;
    00077   }

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

Retrieve version number of this object representation.

Definition at line 79 of file DataObject.h.

    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.

    00083                                         {
    00084     m_version = vsn;
    00085   }

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

Return the refcount.

Definition at line 87 of file DataObject.h.

    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.

    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.

unsigned char DataObject::m_version`[private]`

Version number.

Reimplemented in AlgToolHistory.

Definition at line 36 of file DataObject.h.

IRegistry* DataObject::m_pRegistry`[private]`

Pointer to the Registry Object.

Definition at line 38 of file DataObject.h.

LinkManager* DataObject::m_pLinkMgr`[private]`

Store of symbolic links.

Definition at line 40 of file DataObject.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r8/GaudiKernel/GaudiKernel/DataObject.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r8/GaudiKernel/src/Lib/DataObject.cpp