The Gaudi Framework  master (37c0b60a)
ObjectContainerBase.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 #ifndef GAUDI_OBJECTCONTAINERBASE_H
12 #define GAUDI_OBJECTCONTAINERBASE_H 1
13 
14 // Include files
15 #include <GaudiKernel/DataObject.h>
16 #include <GaudiKernel/Kernel.h>
17 
18 // Forward declarations
19 class ContainedObject;
20 
30 
31 protected:
33  ObjectContainerBase() = default;
36  ~ObjectContainerBase() override = default;
37 
38 public:
40  typedef size_t size_type;
41 
43  virtual long index( const ContainedObject* obj ) const = 0;
44 
46  virtual const ContainedObject* containedObject( long dist ) const = 0;
47  virtual ContainedObject* containedObject( long dist ) = 0;
48 
50  virtual size_type numberOfObjects() const = 0;
51 
55  virtual long add( ContainedObject* pObject ) = 0;
56 
60  virtual long remove( ContainedObject* value ) = 0;
61 };
62 
63 #endif // GAUDI_OBJECTCONTAINERBASE_H
ObjectContainerBase::index
virtual long index(const ContainedObject *obj) const =0
Distance of a given object from the beginning of its container.
ObjectContainerBase::remove
virtual long remove(ContainedObject *value)=0
Release object from the container (the pointer will be removed from the container,...
ObjectContainerBase::operator=
ObjectContainerBase & operator=(ObjectContainerBase &&)=default
ObjectContainerBase::ObjectContainerBase
ObjectContainerBase()=default
Constructor.
ObjectContainerBase::size_type
size_t size_type
size_type, to conform the STL container interface
Definition: ObjectContainerBase.h:40
ObjectContainerBase::ObjectContainerBase
ObjectContainerBase(ObjectContainerBase &&)=default
ObjectContainerBase::~ObjectContainerBase
~ObjectContainerBase() override=default
ObjectContainerBase::containedObject
virtual ContainedObject * containedObject(long dist)=0
DataObject.h
ObjectContainerBase
Definition: ObjectContainerBase.h:29
ObjectContainerBase::add
virtual long add(ContainedObject *pObject)=0
Virtual functions (forwards to the concrete container definitions) Add an object to the container.
Kernel.h
DataObject
Definition: DataObject.h:36
ObjectContainerBase::numberOfObjects
virtual size_type numberOfObjects() const =0
Number of objects in the container.
ObjectContainerBase::containedObject
virtual const ContainedObject * containedObject(long dist) const =0
Pointer to an object of a given distance.
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
ContainedObject
Definition: ContainedObject.h:41