Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SmartRefBase.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #pragma once
12 
14 
16 class SmartRefBase;
17 class ContainedObject;
18 class DataObject;
19 
46 public:
48  mutable long m_hintID;
50  mutable long m_linkID;
52  mutable const DataObject* m_data;
54  mutable const ContainedObject* m_contd;
55 
56  mutable long m_type;
57 
58  enum { DATAOBJECT, CONTAINEDOBJECT };
59 
61  const ContainedObject* accessData( const ContainedObject* typ ) const;
63  const DataObject* accessData( const DataObject* typ ) const;
64 
66  bool isEqualEx( const DataObject* pObj, const SmartRefBase& c ) const;
68  bool isEqualEx( const ContainedObject* pObj, const SmartRefBase& c ) const;
70  bool isEqual( const ContainedObject* /* pObj */, const SmartRefBase& c ) const {
71  return ( m_hintID == c.m_hintID && m_linkID == c.m_linkID && m_data == c.m_data && m_contd == c.m_contd );
72  }
74  bool isEqual( const DataObject* /* pObj */, const SmartRefBase& c ) const {
75  return m_linkID == c.m_linkID && m_data == c.m_data;
76  }
78  void writeObject( const DataObject* pObject, StreamBuffer& s ) const { s.addIdentifiedLink( pObject, m_hintID ); }
80  void writeObject( const ContainedObject* pObject, StreamBuffer& s ) const {
81  s.addContainedLink( pObject, m_hintID, m_linkID );
82  }
84  DataObject* readObject( const DataObject* /* pObject */, StreamBuffer& s ) const {
85  DataObject* pObj = 0;
86  s.getIdentifiedLink( pObj, m_hintID );
87  return pObj;
88  }
90  ContainedObject* readObject( const ContainedObject* /* pObject */, StreamBuffer& s ) const {
91  ContainedObject* pObj = 0;
92  s.getContainedLink( pObj, m_hintID, m_linkID );
93  return pObj;
94  }
95  void setObjectType( const ContainedObject* /* pobj */ ) const { m_type = CONTAINEDOBJECT; }
96  void setObjectType( const DataObject* /* pobj */ ) const { m_type = DATAOBJECT; }
97 
99  const std::string& path() const;
100 
101 public:
102  long objectType() const { return m_type; }
104  void set( DataObject* pObj, long hint_id, long link_id );
105 };
SmartRefBase::setObjectType
void setObjectType(const DataObject *) const
Definition: SmartRefBase.h:96
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
gaudirun.s
string s
Definition: gaudirun.py:346
SmartRefBase::writeObject
void writeObject(const ContainedObject *pObject, StreamBuffer &s) const
Output streamer for ContainedObject like references.
Definition: SmartRefBase.h:80
gaudirun.c
c
Definition: gaudirun.py:525
StreamBuffer.h
SmartRefBase::isEqual
bool isEqual(const DataObject *, const SmartRefBase &c) const
Equality operator for DataObject like references.
Definition: SmartRefBase.h:74
SmartRefBase::readObject
ContainedObject * readObject(const ContainedObject *, StreamBuffer &s) const
Output streamer for ContainedObject like references.
Definition: SmartRefBase.h:90
SmartRefBase
User example objects: SmartRefBase.
Definition: SmartRefBase.h:45
StreamBuffer
Definition: StreamBuffer.h:48
SmartRefBase::m_linkID
long m_linkID
Object data: ID of the object within the identifiable container (if any)
Definition: SmartRefBase.h:50
SmartRefBase::readObject
DataObject * readObject(const DataObject *, StreamBuffer &s) const
Input streamer for DataObject like references.
Definition: SmartRefBase.h:84
SmartRefBase::writeObject
void writeObject(const DataObject *pObject, StreamBuffer &s) const
Output streamer for DataObject like references.
Definition: SmartRefBase.h:78
SmartRefBase::m_type
long m_type
Definition: SmartRefBase.h:56
SmartRefBase::DATAOBJECT
@ DATAOBJECT
Definition: SmartRefBase.h:58
SmartRefBase::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition: SmartRefBase.h:52
SmartRefBase::m_hintID
long m_hintID
Object data: ID of the link hint to the identifiable object.
Definition: SmartRefBase.h:48
SmartRefBase::objectType
long objectType() const
Definition: SmartRefBase.h:102
SmartRefBase::setObjectType
void setObjectType(const ContainedObject *) const
Definition: SmartRefBase.h:95
ObjectContainerBase
Definition: ObjectContainerBase.h:26
SmartRefBase::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
Definition: SmartRefBase.h:54
DataObject
Definition: DataObject.h:37
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49
SmartRefBase::isEqual
bool isEqual(const ContainedObject *, const SmartRefBase &c) const
Equality operator for ContainedObject like references.
Definition: SmartRefBase.h:70
ContainedObject
Definition: ContainedObject.h:37