The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
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
14#include <GaudiKernel/Kernel.h>
15
16class ContainedObject;
17
27
28protected:
33 ~ObjectContainerBase() override = default;
34
35public:
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};
#define GAUDI_API
Definition Kernel.h:49
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
DataObject()
Standard Constructor.
virtual size_type numberOfObjects() const =0
Number of objects in the container.
~ObjectContainerBase() override=default
virtual ContainedObject * containedObject(long dist)=0
ObjectContainerBase()=default
Constructor.
virtual long index(const ContainedObject *obj) const =0
Distance of a given object from the beginning of its container.
virtual long remove(ContainedObject *value)=0
Release object from the container (the pointer will be removed from the container,...
size_t size_type
size_type, to conform the STL container interface
virtual long add(ContainedObject *pObject)=0
Virtual functions (forwards to the concrete container definitions) Add an object to the container.
ObjectContainerBase(ObjectContainerBase &&)=default
virtual const ContainedObject * containedObject(long dist) const =0
Pointer to an object of a given distance.
ObjectContainerBase & operator=(ObjectContainerBase &&)=default