| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
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]

## Public Member Functions
| DataObject ()
| Standard Constructor. More...
| DataObject (const DataObject &rhs)
| Copy Constructor. More...
DataObject & | operator= (const DataObject &rhs)
| Assignment Operator. More...
| DataObject (DataObject &&rhs)
| Move Constructor. More...
DataObject & | operator= (DataObject &&rhs)
| Move Assignment Operator. 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 CLID & | clID () 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 CLID & | classID ()
| Retrieve reference to class definition structure (static access) More...

## Private Attributes
unsigned long | m_refCount = 0
| Reference count. More...
unsigned char | m_version = 0
| Version number. More...
IRegistry * | m_pRegistry = nullptr
| Pointer to the Registry Object. More...
std::unique_ptr< LinkManager > | m_pLinkMgr
| Store of symbolic links. More...

## inline code of class DataObject
void | setRegistry (IRegistry *pRegistry)
| Set pointer to Registry. More...
IRegistry * | registry () const
| Get pointer to Registry. More...
LinkManager * | linkMgr () 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 30 of file DataObject.h.

## Constructor & Destructor Documentation

DataObject::DataObject | ( |  | ) |

Standard Constructor.

Definition at line 13 of file DataObject.cpp.

14 : m_pLinkMgr{LinkManager::newInstance()}
15 {
16 }
LinkManager::newInstance
static LinkManager * newInstance()
Static instantiation.
Definition: LinkManager.cpp:28
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:39

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

Copy Constructor.

Definition at line 19 of file DataObject.cpp.

20 : m_version{rhs.m_version},
21 m_pLinkMgr{LinkManager::newInstance()}
22 {
23 }
DataObject::m_version
unsigned char m_version
Version number.
Definition: DataObject.h:35
LinkManager::newInstance
static LinkManager * newInstance()
Static instantiation.
Definition: LinkManager.cpp:28
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:39

DataObject::DataObject | ( | DataObject && | rhs | ) |

Move Constructor.

Definition at line 33 of file DataObject.cpp.

34 : m_version{std::move(rhs.m_version)},
35 m_pLinkMgr{std::move(rhs.m_pLinkMgr)}
36 {
37 }
DataObject::m_version
unsigned char m_version
Version number.
Definition: DataObject.h:35
std::move
T move(T...args)
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:39

DataObject::~DataObject | ( |  | ) |
| virtual

Standard Destructor.

Definition at line 47 of file DataObject.cpp.

47 {
48 // Issue a warning if the object is being deleted and the reference
49 // count is non-zero.
50 if ( m_refCount > 0 ) {
51 // Insert warning here
52 }
53 }
DataObject::m_refCount
unsigned long m_refCount
Reference count.
Definition: DataObject.h:33

## Member Function Documentation

unsigned long DataObject::addRef | ( |  | ) |
| virtual

Add reference to object.

Definition at line 63 of file DataObject.cpp.

63 {
64 return ++m_refCount;
65 }
DataObject::m_refCount
unsigned long m_refCount
Reference count.
Definition: DataObject.h:33

const CLID & DataObject::classID | ( |  | ) |
| static

Retrieve reference to class definition structure (static access)

Retrieve Pointer to class definition structure.

Definition at line 73 of file DataObject.cpp.

73 {
74 return CLID_DataObject;
75 }

const CLID & DataObject::clID | ( |  | ) | const
| virtual

Retrieve reference to class definition structure.

Retrieve Pointer to class definition structure.

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

Definition at line 68 of file DataObject.cpp.

68 {
69 return CLID_DataObject;
70 }

virtual std::ostream& DataObject::fillStream | ( | std::ostream & | s | ) | const
| inline virtual

Fill the output stream (ASCII)

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

Definition at line 94 of file DataObject.h.

94 {
95 s << "DataObject at " << std::hex << this;
96 return s;
97 }
gaudirun.s
string s
Definition: gaudirun.py:245
std::hex
T hex(T...args)

LinkManager* DataObject::linkMgr | ( |  | ) | const
| inline

Retrieve Link manager.

Definition at line 78 of file DataObject.h.

78 {
79 return m_pLinkMgr.get();
80 }
std::unique_ptr::get
T get(T...args)
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:39

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 78 of file DataObject.cpp.

78 {
79 return m_pRegistry ? m_pRegistry->name() : _sDataObjectCppNotRegistered;
80 }
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
DataObject::m_pRegistry
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition: DataObject.h:37

DataObject & DataObject::operator= | ( | const DataObject & | rhs | ) |

Assignment Operator.

Definition at line 26 of file DataObject.cpp.

26 {
27 m_version = rhs.m_version;
28 m_pLinkMgr.reset(LinkManager::newInstance());
29 return *this;
30 }
DataObject::m_version
unsigned char m_version
Version number.
Definition: DataObject.h:35
LinkManager::newInstance
static LinkManager * newInstance()
Static instantiation.
Definition: LinkManager.cpp:28
std::unique_ptr::reset
T reset(T...args)
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:39

DataObject & DataObject::operator= | ( | DataObject && | rhs | ) |

Move Assignment Operator.

Assignment Operator.

Definition at line 40 of file DataObject.cpp.

40 {
41 m_version = std::move(rhs.m_version);
42 m_pLinkMgr = std::move(rhs.m_pLinkMgr);
43 return *this;
44 }
DataObject::m_version
unsigned char m_version
Version number.
Definition: DataObject.h:35
std::move
T move(T...args)
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:39

unsigned long DataObject::refCount | ( |  | ) | const
| inline

Return the refcount.

Definition at line 90 of file DataObject.h.

90 {
91 return m_refCount;
92 }
DataObject::m_refCount
unsigned long m_refCount
Reference count.
Definition: DataObject.h:33

IRegistry* DataObject::registry | ( |  | ) | const
| inline

Get pointer to Registry.

Definition at line 74 of file DataObject.h.

74 {
75 return m_pRegistry;
76 }
DataObject::m_pRegistry
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition: DataObject.h:37

unsigned long DataObject::release | ( |  | ) |
| virtual

release reference to object

Decrease reference count.

Definition at line 56 of file DataObject.cpp.

56 {
57 unsigned long cnt = --m_refCount;
58 if ( 0 == cnt ) delete this;
59 return cnt;
60 }
DataObject::m_refCount
unsigned long m_refCount
Reference count.
Definition: DataObject.h:33

void DataObject::setRegistry | ( | IRegistry * | pRegistry | ) |
| inline

Set pointer to Registry.

Definition at line 70 of file DataObject.h.

70 {
71 m_pRegistry = pRegistry;
72 }
DataObject::m_pRegistry
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition: DataObject.h:37

void DataObject::setVersion | ( | unsigned char | vsn | ) |
| inline

Set version number of this object representation.

Definition at line 86 of file DataObject.h.

86 {
87 m_version = vsn;
88 }
DataObject::m_version
unsigned char m_version
Version number.
Definition: DataObject.h:35

StatusCode DataObject::update | ( |  | ) |
| virtual

Provide empty placeholder for internal object reconfiguration callback.

Reimplemented in KeyedContainer< DATATYPE, MAPPING >.

Definition at line 83 of file DataObject.cpp.

83 {
84 return StatusCode::SUCCESS;
85 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

unsigned char DataObject::version | ( |  | ) | const
| inline

Retrieve version number of this object representation.

Definition at line 82 of file DataObject.h.

82 {
83 return m_version;
84 }
DataObject::m_version
unsigned char m_version
Version number.
Definition: DataObject.h:35

## Friends And Related Function Documentation

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

Output operator (ASCII)

Definition at line 99 of file DataObject.h.

99 {
100 return obj.fillStream(s);
101 }
DataObject::fillStream
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:94

## Member Data Documentation

std::unique_ptr<LinkManager> DataObject::m_pLinkMgr
| private

Store of symbolic links.

Definition at line 39 of file DataObject.h.

IRegistry* DataObject::m_pRegistry = nullptr
| private

Pointer to the Registry Object.

Definition at line 37 of file DataObject.h.

unsigned long DataObject::m_refCount = 0
| private

Reference count.

Definition at line 33 of file DataObject.h.

unsigned char DataObject::m_version = 0
| private

Version number.

Definition at line 35 of file DataObject.h.

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

- GaudiKernel/GaudiKernel/DataObject.h
- GaudiKernel/src/Lib/DataObject.cpp