All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:
Collaboration diagram for DataObject:

Public Member Functions

 DataObject ()
 Standard Constructor. More...
 
 DataObject (const DataObject &)
 Copy Constructor. More...
 
virtual ~DataObject ()
 Standard Destructor. More...
 
virtual unsigned long addRef ()
 Add reference to object. More...
 
virtual unsigned long release ()
 release reference to object More...
 
virtual const CLIDclID () const
 Retrieve reference to class definition structure. More...
 
const std::string & name () const
 Retreive DataObject name. It is the name when registered in the store. More...
 
virtual StatusCode update ()
 Provide empty placeholder for internal object reconfiguration callback. More...
 

Static Public Member Functions

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

Private Attributes

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

inline code of class DataObject

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

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.

16  : m_refCount(0),
17  m_version(0),
18  m_pRegistry(0)
19 {
21 }
LinkManager * m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:40
unsigned char m_version
Version number.
Definition: DataObject.h:36
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition: DataObject.h:38
unsigned long m_refCount
Reference count.
Definition: DataObject.h:34
DataObject::DataObject ( const DataObject )

Copy Constructor.

Standard Constructor.

Definition at line 24 of file DataObject.cpp.

25  : m_refCount(0),
26  m_version(0),
27  m_pRegistry(0)
28 {
30 }
LinkManager * m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:40
unsigned char m_version
Version number.
Definition: DataObject.h:36
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition: DataObject.h:38
unsigned long m_refCount
Reference count.
Definition: DataObject.h:34
DataObject::~DataObject ( )
virtual

Standard Destructor.

Definition at line 33 of file DataObject.cpp.

33  {
34  // Issue a warning if the object is being deleted and the reference
35  // count is non-zero.
36  if ( m_refCount > 0 ) {
37  // Insert warning here
38  }
39  if ( m_pLinkMgr ) delete m_pLinkMgr;
40  m_pLinkMgr = 0;
41 }
LinkManager * m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:40
unsigned long m_refCount
Reference count.
Definition: DataObject.h:34

Member Function Documentation

unsigned long DataObject::addRef ( )
virtual

Add reference to object.

Definition at line 53 of file DataObject.cpp.

53  {
54  return ++m_refCount;
55 }
unsigned long m_refCount
Reference count.
Definition: DataObject.h:34
const CLID & DataObject::classID ( )
static

Retrieve reference to class definition structure (static access)

Retrieve Pointer to class definition structure.

Definition at line 63 of file DataObject.cpp.

63  {
64  return CLID_DataObject;
65 }
virtual std::ostream& DataObject::fillStream ( std::ostream &  s) const
inlinevirtual

Fill the output stream (ASCII)

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

Definition at line 89 of file DataObject.h.

89  {
90  s << "DataObject at " << std::hex << this;
91  return s;
92  }
string s
Definition: gaudirun.py:210
LinkManager* DataObject::linkMgr ( ) const
inline

Retrieve Link manager.

Definition at line 73 of file DataObject.h.

73  {
74  return m_pLinkMgr;
75  }
LinkManager * m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:40
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.

Definition at line 68 of file DataObject.cpp.

68  {
69  if( m_pRegistry != 0) {
70  return m_pRegistry->name();
71  }
72  else {
73  return _sDataObjectCppNotRegistered;
74  }
75 }
virtual const name_type & name() const =0
Name of the directory (or key)
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition: DataObject.h:38
unsigned long DataObject::refCount ( ) const
inline

Return the refcount.

Definition at line 85 of file DataObject.h.

85  {
86  return m_refCount;
87  }
unsigned long m_refCount
Reference count.
Definition: DataObject.h:34
IRegistry* DataObject::registry ( ) const
inline

Get pointer to Registry.

Definition at line 69 of file DataObject.h.

69  {
70  return m_pRegistry;
71  }
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition: DataObject.h:38
unsigned long DataObject::release ( )
virtual

release reference to object

Decrease reference count.

Definition at line 44 of file DataObject.cpp.

44  {
45  unsigned long cnt = --m_refCount;
46  if ( 0 == m_refCount ) {
47  delete this;
48  }
49  return cnt;
50 }
unsigned long m_refCount
Reference count.
Definition: DataObject.h:34
void DataObject::setRegistry ( IRegistry pRegistry)
inline

Set pointer to Registry.

Definition at line 65 of file DataObject.h.

65  {
66  m_pRegistry = pRegistry;
67  }
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition: DataObject.h:38
void DataObject::setVersion ( unsigned char  vsn)
inline

Set version number of this object representation.

Definition at line 81 of file DataObject.h.

81  {
82  m_version = vsn;
83  }
unsigned char m_version
Version number.
Definition: DataObject.h:36
StatusCode DataObject::update ( )
virtual

Provide empty placeholder for internal object reconfiguration callback.

Reimplemented in KeyedContainer< DATATYPE, MAPPING >, KeyedContainer< MyVertex >, and KeyedContainer< MyTrack >.

Definition at line 78 of file DataObject.cpp.

78  {
79  return StatusCode::SUCCESS;
80 }
unsigned char DataObject::version ( ) const
inline

Retrieve version number of this object representation.

Definition at line 77 of file DataObject.h.

77  {
78  return m_version;
79  }
unsigned char m_version
Version number.
Definition: DataObject.h:36

Friends And Related Function Documentation

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

Output operator (ASCII)

Definition at line 94 of file DataObject.h.

94  {
95  return obj.fillStream(s);
96  }
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:89
string s
Definition: gaudirun.py:210

Member Data Documentation

LinkManager* DataObject::m_pLinkMgr
private

Store of symbolic links.

Definition at line 40 of file DataObject.h.

IRegistry* DataObject::m_pRegistry
private

Pointer to the Registry Object.

Definition at line 38 of file DataObject.h.

unsigned long DataObject::m_refCount
private

Reference count.

Definition at line 34 of file DataObject.h.

unsigned char DataObject::m_version
private

Version number.

Definition at line 36 of file DataObject.h.


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