| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

SmartRefBase Class Reference

User example objects: SmartRefBase. More...

#include <SmartRefBase.h>

Collaboration diagram for SmartRefBase:

[legend]
List of all members.

Public Types

 DATAOBJECT
 CONTAINEDOBJECT
enum  { DATAOBJECT, CONTAINEDOBJECT }

Public Member Functions

const ContainedObjectaccessData (const ContainedObject *typ) const
 Load on demand of ContainedObject like references.
const DataObjectaccessData (const DataObject *typ) const
 Load on demand of DataObject like references.
bool isEqualEx (const DataObject *pObj, const SmartRefBase &c) const
 Extended equality check.
bool isEqualEx (const ContainedObject *pObj, const SmartRefBase &c) const
 Extended equality check.
bool isEqual (const ContainedObject *, const SmartRefBase &c) const
 Equality operator for ContainedObject like references.
bool isEqual (const DataObject *, const SmartRefBase &c) const
 Equality operator for DataObject like references.
void writeObject (const DataObject *pObject, StreamBuffer &s) const
 Output streamer for DataObject like references.
void writeObject (const ContainedObject *pObject, StreamBuffer &s) const
 Output streamer for ContainedObject like references.
DataObjectreadObject (const DataObject *, StreamBuffer &s) const
 Input streamer for DataObject like references.
ContainedObjectreadObject (const ContainedObject *, StreamBuffer &s) const
 Output streamer for ContainedObject like references.
void setObjectType (const ContainedObject *) const
void setObjectType (const DataObject *) const
const std::string & path () const
 Shortcut to access the path to the linked object.
int objectType () const
void set (DataObject *pObj, long hint_id, long link_id)
 Setup smart reference when reading. Must be allowed from external sources.

Public Attributes

long m_hintID
 Object data: ID of the link hint to the identifiable object.
long m_linkID
 Object data: ID of the object within the identifiable container (if any).
const DataObjectm_data
 Object data: Pointer to the identifiable object the link originates.
const ContainedObjectm_contd
 Object data: Pointer to the Contained object (if applicable).
long m_type

Detailed Description

User example objects: SmartRefBase.

Description: Base class of SmartReference objects. The base class handles the object requests to the data store. The separation of the SmartReference and the base class is mainly to avoid code blow up, because if the object is not yet present serious work must be performed in order to request the object from the store and invoke object updates to keep pointers in sync.

Base Class: None

Dependencies: None

History :

    +---------+----------------------------------------------+--------+
    |    Date |                 Comment                      | Who    |
    +---------+----------------------------------------------+--------+
    | 21/06/99| Initial version.                             | MF     |
    +---------+----------------------------------------------+--------+
    
Author: M.Frank Version: 1.0

Definition at line 47 of file SmartRefBase.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
DATAOBJECT 
CONTAINEDOBJECT 

Definition at line 60 of file SmartRefBase.h.


Member Function Documentation

const ContainedObject* SmartRefBase::accessData ( const ContainedObject typ  )  const

Load on demand of ContainedObject like references.

const DataObject* SmartRefBase::accessData ( const DataObject typ  )  const

Load on demand of DataObject like references.

bool SmartRefBase::isEqualEx ( const DataObject pObj,
const SmartRefBase c 
) const

Extended equality check.

bool SmartRefBase::isEqualEx ( const ContainedObject pObj,
const SmartRefBase c 
) const

Extended equality check.

bool SmartRefBase::isEqual ( const ContainedObject ,
const SmartRefBase c 
) const [inline]

Equality operator for ContainedObject like references.

Definition at line 72 of file SmartRefBase.h.

00072                                                                                            {
00073     return (m_hintID == c.m_hintID && m_linkID == c.m_linkID && 
00074             m_data   == c.m_data   && m_contd  == c.m_contd);
00075   }

bool SmartRefBase::isEqual ( const DataObject ,
const SmartRefBase c 
) const [inline]

Equality operator for DataObject like references.

Definition at line 77 of file SmartRefBase.h.

00077                                                                                         {
00078     return m_linkID == c.m_linkID && m_data   == c.m_data;
00079   }

void SmartRefBase::writeObject ( const DataObject pObject,
StreamBuffer s 
) const [inline]

Output streamer for DataObject like references.

Definition at line 81 of file SmartRefBase.h.

00081                                                                           {
00082     s.addIdentifiedLink(pObject, m_hintID);
00083   }

void SmartRefBase::writeObject ( const ContainedObject pObject,
StreamBuffer s 
) const [inline]

Output streamer for ContainedObject like references.

Definition at line 85 of file SmartRefBase.h.

00085                                                                                 {
00086     s.addContainedLink(pObject, m_hintID, m_linkID);
00087   }

DataObject* SmartRefBase::readObject ( const DataObject ,
StreamBuffer s 
) const [inline]

Input streamer for DataObject like references.

Definition at line 89 of file SmartRefBase.h.

00089                                                                                        {
00090     DataObject* pObj = 0;
00091     s.getIdentifiedLink(pObj, m_hintID);
00092     return pObj;
00093   }

ContainedObject* SmartRefBase::readObject ( const ContainedObject ,
StreamBuffer s 
) const [inline]

Output streamer for ContainedObject like references.

Definition at line 95 of file SmartRefBase.h.

00095                                                                                                {
00096     ContainedObject* pObj = 0;
00097     s.getContainedLink(pObj, m_hintID, m_linkID);
00098     return pObj;
00099   }

void SmartRefBase::setObjectType ( const ContainedObject  )  const [inline]

Definition at line 100 of file SmartRefBase.h.

00100                                                               {
00101     m_type = CONTAINEDOBJECT;
00102   }

void SmartRefBase::setObjectType ( const DataObject  )  const [inline]

Definition at line 103 of file SmartRefBase.h.

00103                                                           {
00104     m_type = DATAOBJECT;
00105   }

const std::string& SmartRefBase::path (  )  const

Shortcut to access the path to the linked object.

int SmartRefBase::objectType (  )  const [inline]

Definition at line 111 of file SmartRefBase.h.

00111                           {
00112     return m_type;
00113   }

void SmartRefBase::set ( DataObject pObj,
long  hint_id,
long  link_id 
)

Setup smart reference when reading. Must be allowed from external sources.


Member Data Documentation

long SmartRefBase::m_hintID [mutable]

Object data: ID of the link hint to the identifiable object.

Definition at line 50 of file SmartRefBase.h.

long SmartRefBase::m_linkID [mutable]

Object data: ID of the object within the identifiable container (if any).

Definition at line 52 of file SmartRefBase.h.

const DataObject* SmartRefBase::m_data [mutable]

Object data: Pointer to the identifiable object the link originates.

Definition at line 54 of file SmartRefBase.h.

const ContainedObject* SmartRefBase::m_contd [mutable]

Object data: Pointer to the Contained object (if applicable).

Definition at line 56 of file SmartRefBase.h.

long SmartRefBase::m_type [mutable]

Definition at line 58 of file SmartRefBase.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:14 2011 for GaudiKernel by doxygen 1.4.7