The Gaudi Framework
master (1a7a3838)
Toggle main menu visibility
Loading...
Searching...
No Matches
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
13
#include <
GaudiKernel/StreamBuffer.h
>
14
15
class
ObjectContainerBase
;
16
class
SmartRefBase
;
17
class
ContainedObject
;
18
class
DataObject
;
19
45
class
GAUDI_API
SmartRefBase
{
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
}
73
74
bool
isEqual
(
const
DataObject
*
/* pObj */
,
const
SmartRefBase
& c )
const
{
75
return
m_linkID
== c.m_linkID &&
m_data
== c.m_data;
76
}
77
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
}
83
84
DataObject
*
readObject
(
const
DataObject
*
/* pObject */
,
StreamBuffer
& s )
const
{
85
DataObject
* pObj = 0;
86
s.getIdentifiedLink( pObj,
m_hintID
);
87
return
pObj;
88
}
89
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
};
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
StreamBuffer.h
ContainedObject
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Definition
ContainedObject.h:37
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition
DataObject.h:37
ObjectContainerBase
ObjectContainerBase is the base class for Gaudi container classes.
Definition
ObjectContainerBase.h:26
SmartRefBase
User example objects: SmartRefBase.
Definition
SmartRefBase.h:45
SmartRefBase::m_linkID
long m_linkID
Object data: ID of the object within the identifiable container (if any).
Definition
SmartRefBase.h:50
SmartRefBase::m_hintID
long m_hintID
Object data: ID of the link hint to the identifiable object.
Definition
SmartRefBase.h:48
SmartRefBase::setObjectType
void setObjectType(const DataObject *) const
Definition
SmartRefBase.h:96
SmartRefBase::readObject
ContainedObject * readObject(const ContainedObject *, StreamBuffer &s) const
Output streamer for ContainedObject like references.
Definition
SmartRefBase.h:90
SmartRefBase::writeObject
void writeObject(const DataObject *pObject, StreamBuffer &s) const
Output streamer for DataObject like references.
Definition
SmartRefBase.h:78
SmartRefBase::writeObject
void writeObject(const ContainedObject *pObject, StreamBuffer &s) const
Output streamer for ContainedObject like references.
Definition
SmartRefBase.h:80
SmartRefBase::objectType
long objectType() const
Definition
SmartRefBase.h:102
SmartRefBase::m_type
long m_type
Definition
SmartRefBase.h:56
SmartRefBase::isEqual
bool isEqual(const DataObject *, const SmartRefBase &c) const
Equality operator for DataObject like references.
Definition
SmartRefBase.h:74
SmartRefBase::setObjectType
void setObjectType(const ContainedObject *) const
Definition
SmartRefBase.h:95
SmartRefBase::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable).
Definition
SmartRefBase.h:54
SmartRefBase::readObject
DataObject * readObject(const DataObject *, StreamBuffer &s) const
Input streamer for DataObject like references.
Definition
SmartRefBase.h:84
SmartRefBase::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition
SmartRefBase.h:52
SmartRefBase::isEqual
bool isEqual(const ContainedObject *, const SmartRefBase &c) const
Equality operator for ContainedObject like references.
Definition
SmartRefBase.h:70
SmartRefBase::DATAOBJECT
@ DATAOBJECT
Definition
SmartRefBase.h:58
SmartRefBase::CONTAINEDOBJECT
@ CONTAINEDOBJECT
Definition
SmartRefBase.h:58
StreamBuffer
The stream buffer is a small object collecting object data.
Definition
StreamBuffer.h:48
GaudiKernel
include
GaudiKernel
SmartRefBase.h
Generated on
for The Gaudi Framework by
1.17.0