| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

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

- Search for |

- File List
- File Members

# DataObject.cpp

Go to the documentation of this file.

    00001 // $Id: DataObject.cpp,v 1.8 2005/01/19 18:31:15 mato Exp $
    00002
    00003 // Experiment specific include files
    00004 #include "GaudiKernel/StreamBuffer.h"
    00005 #include "GaudiKernel/LinkManager.h"
    00006 #include "GaudiKernel/DataObject.h"
    00007 #include "GaudiKernel/IInspector.h"
    00008 #include "GaudiKernel/IRegistry.h"
    00009
    00010 static std::string _sDataObjectCppNotRegistered("NotRegistered");
    00011
    00013 DataObject::DataObject()
    00014  : m_refCount(0),
    00015    m_version(0),
    00016    m_pRegistry(0)
    00017 {
    00018   m_pLinkMgr = LinkManager::newInstance();
    00019 }
    00020
    00022 DataObject::DataObject(const DataObject&)
    00023  : m_refCount(0),
    00024    m_version(0),
    00025    m_pRegistry(0)
    00026 {
    00027   m_pLinkMgr = LinkManager::newInstance();
    00028 }
    00029
    00031 DataObject::~DataObject()   {
    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 }
    00040
    00042 unsigned long DataObject::release()  {
    00043   unsigned long cnt = --m_refCount;
    00044   if ( 0 == m_refCount )   {
    00045     delete this;
    00046   }
    00047   return cnt;
    00048 }
    00049
    00051 unsigned long DataObject::addRef()  {
    00052   return ++m_refCount;
    00053 }
    00054
    00056 const CLID& DataObject::clID() const   {
    00057   return CLID_DataObject;
    00058 }
    00059
    00061 const CLID& DataObject::classID()    {
    00062   return CLID_DataObject;
    00063 }
    00064
    00066 const std::string& DataObject::name() const {
    00067   if( m_pRegistry != 0) {
    00068     return m_pRegistry->name();
    00069   }
    00070   else {
    00071     return _sDataObjectCppNotRegistered;
    00072   }
    00073 }
    00074
    00076 StreamBuffer& DataObject::serialize(StreamBuffer& s)   {
    00077   return s >> m_version;
    00078 }
    00079
    00081 StreamBuffer& DataObject::serialize(StreamBuffer& s)  const    {
    00082   return s << m_version;
    00083 }