40 typedef typename ConstVector::iterator
iterator;
80 template <
class DATA,
class PREDICATE>
82 insert( first, last, cut );
89 static const CLID s_clid = ( (
static_cast<CLID>( -1 ) << 16 )
92 & !
static_cast<CLID>( 0x00030000 )
93 & !
static_cast<CLID>( 0x00040000 ) )
118 template <
class DATA>
148 template <
class DATA,
class PREDICATE>
149 void insert( DATA first, DATA last,
const PREDICATE& cut ) {
150 m_data.reserve(
m_data.size() + std::distance( first, last ) );
151 std::copy_if( first, last, std::back_inserter(
m_data ), std::cref( cut ) );
177 template <
class OUTPUT,
class PREDICATE>
178 OUTPUT
get(
const PREDICATE& cut, OUTPUT output )
const {
179 return std::copy_if(
begin(),
end(), output, std::cref( cut ) );
200 template <
class PREDICATE>
201 void erase(
const PREDICATE& cut ) {
223 auto i = std::find(
begin(),
end(),
object );
224 if (
end() == i ) {
return false; }
271 auto _i = std::find(
begin(),
end(),
object );
272 return end() != _i ? ( _i -
begin() ) : -1;
293 if ( !
object ) {
return -1; }
294 TYPE* _obj =
dynamic_cast<TYPE*
>( object );
295 if ( !_obj ) {
return -1; }
305 auto _i = std::find(
begin(),
end(), value );
306 if (
end() == _i ) {
return -1; }
unsigned int CLID
Class ID definition.
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
ObjectContainerBase()=default
Constructor.
const_iterator end() const
const ConstVector & data() const
long remove(ContainedObject *value) override
Release object from the container (the pointer will be removed from the container,...
const_reference front() const
the first element (only for non-empty vectors) (const-version)
ConstVector::reverse_iterator reverse_iterator
const_reverse_iterator rend() const
bool empty() const
empty container?
size_type size() const
get the actual size of the container
SharedObjectsContainer & operator=(SharedObjectsContainer &&)=default
reference operator()(size_type index)
'functional'-access
const_reference at(size_type index) const
checked access (const-version)
std::vector< const TYPE * > ConstVector
the actual container type
OUTPUT get(const PREDICATE &cut, OUTPUT output) const
get from the container all objects which satisfy the certain criteria
const_reverse_iterator rbegin() const
reverse_iterator rbegin()
ConstVector::size_type size_type
bool operator==(const ConstVector &right) const
equal content with corresponding vector ?
ConstVector::const_iterator const_iterator
reference back()
the last element (only for non-empty vectors)
const ContainedObject * containedObject(long index) const override
Pointer to an object of a given distance.
ConstVector::value_type value_type
void insert(const TYPE *object)
insert one object into the container
void insert(DATA first, DATA last, const PREDICATE &cut)
add the sequence of 'good'objects into the container
SharedObjectsContainer(ConstVector &&data)
void insert(DATA first, DATA last)
add the sequence of objects into the container
SharedObjectsContainer(DATA first, DATA last, const PREDICATE &cut)
the templated constructor from the pair of iterators and the predicate.
ConstVector::const_reference const_reference
SharedObjectsContainer(DATA first, DATA last)
the templated constructor from the pair of iterators
void erase(iterator i)
erase the object by iterator
void erase(const PREDICATE &cut)
erase the objects which satisfy the criteria
SharedObjectsContainer(const ConstVector &data)
const_reference operator[](size_type index) const
index access (const-version)
long index(const ContainedObject *object) const override
const_reference back() const
the last element (only for non-empty vectors) (const-version)
bool operator==(const SharedObjectsContainer &right) const
equal content with other container ?
SharedObjectsContainer(SharedObjectsContainer &&)=default
ContainedObject * containedObject(long index) override
SharedObjectsContainer()=default
const_iterator begin() const
const CLID & clID() const override
Retrieve the unique class ID (virtual)
ConstVector::const_reverse_iterator const_reverse_iterator
long add(ContainedObject *object) override
Virtual functions (forwards to the concrete container definitions) Add an object to the container.
reference front()
the first element (only for non-empty vectors)
reference at(size_type index)
checked access
void push_back(const TYPE *object)
insert one object into the container
bool operator<(const SharedObjectsContainer &right) const
comparisons with other container
reference operator[](size_type index)
index access
ConstVector::reference reference
size_type numberOfObjects() const override
Number of objects in the container.
const_reference operator()(size_type index) const
'functional'-access (const version)
ConstVector::iterator iterator
bool operator<(const ConstVector &right) const
comparisons with corresponding vector
static const CLID & classID()
Retrieve the unuqie class ID (static)
bool erase(const TYPE *object)
erase the first occurance of the certain element