The Gaudi Framework  v40r0 (475e45c1)
ObjectContainerBase.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/DataObject.h>
14 #include <GaudiKernel/Kernel.h>
15 
16 class ContainedObject;
17 
27 
28 protected:
30  ObjectContainerBase() = default;
33  ~ObjectContainerBase() override = default;
34 
35 public:
37  typedef size_t size_type;
38 
40  virtual long index( const ContainedObject* obj ) const = 0;
41 
43  virtual const ContainedObject* containedObject( long dist ) const = 0;
44  virtual ContainedObject* containedObject( long dist ) = 0;
45 
47  virtual size_type numberOfObjects() const = 0;
48 
52  virtual long add( ContainedObject* pObject ) = 0;
53 
57  virtual long remove( ContainedObject* value ) = 0;
58 };
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:37
ObjectContainerBase::ObjectContainerBase
ObjectContainerBase(ObjectContainerBase &&)=default
ObjectContainerBase::~ObjectContainerBase
~ObjectContainerBase() override=default
ObjectContainerBase::containedObject
virtual ContainedObject * containedObject(long dist)=0
DataObject.h
ObjectContainerBase
Definition: ObjectContainerBase.h:26
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:37
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:83
ContainedObject
Definition: ContainedObject.h:37