The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
ContainedObject.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/Kernel.h
>
14
#include <
GaudiKernel/ObjectContainerBase.h
>
15
#include <
GaudiKernel/StreamBuffer.h
>
16
#include <iostream>
17
18
template
<
class
TYPE>
19
class
ObjectVector
;
20
template
<
class
TYPE>
21
class
ObjectList
;
22
23
typedef
ObjectVector<ContainedObject>
ContainedObjectVector
;
24
typedef
ObjectList<ContainedObject>
ContainedObjectList
;
25
26
// Definition of the CLID for this class
27
static
const
CLID
CLID_ContainedObject = 190;
28
37
class
GAUDI_API
ContainedObject
{
38
40
friend
class
ObjectVector
<
ContainedObject
>;
41
friend
class
ObjectList
<
ContainedObject
>;
42
43
protected
:
45
ContainedObject
() =
default
;
47
ContainedObject
(
const
ContainedObject
& ) :
ContainedObject
() {}
48
// cppcheck-suppress operatorEqVarError; see comment above
49
ContainedObject
&
operator=
(
const
ContainedObject
& ) {
return
*
this
; }
51
virtual
~ContainedObject
();
52
53
public
:
55
virtual
const
CLID
&
clID
()
const
{
return
classID
(); }
56
static
const
CLID
&
classID
() {
return
CLID_ContainedObject; }
57
59
const
ObjectContainerBase
*
parent
()
const
{
return
m_parent
; }
61
void
setParent
(
ObjectContainerBase
* value ) {
m_parent
= value; }
62
64
virtual
long
index
()
const
{
return
m_parent
?
m_parent
->index(
this
) : -1; }
66
virtual
StreamBuffer
&
serialize
(
StreamBuffer
& s )
const
{
return
s; }
68
virtual
StreamBuffer
&
serialize
(
StreamBuffer
& s ) {
return
s; }
70
virtual
std::ostream&
fillStream
( std::ostream& s )
const
{
return
s; }
72
friend
std::ostream&
operator<<
( std::ostream& s,
const
ContainedObject
& obj ) {
return
obj.
fillStream
( s ); }
73
74
private
:
76
ObjectContainerBase
*
m_parent
=
nullptr
;
77
};
CLID
unsigned int CLID
Class ID definition.
Definition
ClassID.h:16
ContainedObjectList
ObjectList< ContainedObject > ContainedObjectList
Definition
ContainedObject.h:24
ContainedObjectVector
ObjectVector< ContainedObject > ContainedObjectVector
Definition
ContainedObject.h:23
Kernel.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
ObjectContainerBase.h
StreamBuffer.h
ContainedObject
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Definition
ContainedObject.h:37
ContainedObject::classID
static const CLID & classID()
Definition
ContainedObject.h:56
ContainedObject::setParent
void setParent(ObjectContainerBase *value)
Update parent member.
Definition
ContainedObject.h:61
ContainedObject::operator=
ContainedObject & operator=(const ContainedObject &)
Definition
ContainedObject.h:49
ContainedObject::m_parent
ObjectContainerBase * m_parent
Pointer to the parent.
Definition
ContainedObject.h:76
ContainedObject::ContainedObject
ContainedObject()=default
Constructors.
ContainedObject::fillStream
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII).
Definition
ContainedObject.h:70
ContainedObject::ContainedObject
ContainedObject(const ContainedObject &)
Copy constructor and assignement: do NOT copy the parent reference...
Definition
ContainedObject.h:47
ContainedObject::serialize
virtual StreamBuffer & serialize(StreamBuffer &s)
Serialize the object for reading.
Definition
ContainedObject.h:68
ContainedObject::serialize
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
Definition
ContainedObject.h:66
ContainedObject::operator<<
friend std::ostream & operator<<(std::ostream &s, const ContainedObject &obj)
Output operator (ASCII).
Definition
ContainedObject.h:72
ContainedObject::parent
const ObjectContainerBase * parent() const
Access to parent object.
Definition
ContainedObject.h:59
ContainedObject::index
virtual long index() const
Distance in the parent container.
Definition
ContainedObject.h:64
ContainedObject::clID
virtual const CLID & clID() const
Retrieve pointer to class identifier.
Definition
ContainedObject.h:55
ObjectContainerBase
ObjectContainerBase is the base class for Gaudi container classes.
Definition
ObjectContainerBase.h:26
ObjectList
ObjectList is one of the basic Gaudi container classes capable of being registered in Data Stores.
Definition
ObjectList.h:42
ObjectVector
ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores.
Definition
ObjectVector.h:43
StreamBuffer
The stream buffer is a small object collecting object data.
Definition
StreamBuffer.h:48
GaudiKernel
include
GaudiKernel
ContainedObject.h
Generated on
for The Gaudi Framework by
1.17.0