Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_SHAREDOBJECTSCONTAINER_H
12 #define GAUDIKERNEL_SHAREDOBJECTSCONTAINER_H 1
49 typedef typename ConstVector::iterator
iterator;
94 template <
class DATA,
class PREDICATE>
96 insert( first, last, cut );
105 static const CLID s_clid = ( (
static_cast<CLID>( -1 ) << 16 )
108 & !
static_cast<CLID>( 0x00030000 )
109 & !
static_cast<CLID>( 0x00040000 ) )
140 template <
class DATA>
170 template <
class DATA,
class PREDICATE>
171 void insert( DATA first, DATA last,
const PREDICATE& cut ) {
199 template <
class OUTPUT,
class PREDICATE>
200 OUTPUT
get(
const PREDICATE& cut, OUTPUT
output )
const {
222 template <
class PREDICATE>
223 void erase(
const PREDICATE& cut ) {
246 if (
end() == i ) {
return false; }
307 return end() != _i ? ( _i -
begin() ) : -1;
328 if ( !
object ) {
return -1; }
329 TYPE* _obj =
dynamic_cast<TYPE*
>( object );
330 if ( !_obj ) {
return -1; }
341 if (
end() == _i ) {
return -1; }
356 #endif // GAUDIKERNEL_SHAREDOBJECTSCONTAINER_H
const_reference operator[](size_type index) const
index access (const-version)
OUTPUT get(const PREDICATE &cut, OUTPUT output) const
get from the container all objects which satisfy the certain criteria
SharedObjectsContainer(DATA first, DATA last, const PREDICATE &cut)
the templated constructor from the pair of iterators and the predicate.
bool operator==(const SharedObjectsContainer &right) const
equal content with other container ?
SharedObjectsContainer(DATA first, DATA last)
the templated constructor from the pair of iterators
void push_back(const TYPE *object)
insert one object into the container
const_reference operator()(size_type index) const
'functional'-access (const version)
const_reverse_iterator rbegin() const
reverse_iterator rbegin()
bool operator==(const ConstVector &right) const
equal content with corresponding vector ?
long add(ContainedObject *object) override
Virtual functions (forwards to the concrete container definitions) Add an object to the container.
ConstVector::reference reference
SharedObjectsContainer()=default
ConstVector::const_iterator const_iterator
bool operator<(const SharedObjectsContainer &right) const
comparisons with other container
ConstVector::reverse_iterator reverse_iterator
std::vector< const TYPE * > ConstVector
the actual container type
T back_inserter(T... args)
void insert(DATA first, DATA last)
add the sequence of objects into the container
SharedObjectsContainer(SharedObjectsContainer &&)=default
reference at(size_type index)
checked access
static const CLID & classID()
Retrieve the unuqie class ID (static)
long remove(ContainedObject *value) override
Release object from the container (the pointer will be removed from the container,...
ConstVector::const_reverse_iterator const_reverse_iterator
bool erase(const TYPE *object)
erase the first occurance of the certain element
const ContainedObject * containedObject(long index) const override
Pointer to an object of a given distance.
SharedObjectsContainer & operator=(SharedObjectsContainer &&)=default
void erase(const PREDICATE &cut)
erase the objects which satisfy the criteria
const ConstVector & data() const
get the access to the underlying container (const)
const_reference front() const
the first element (only for non-empty vectors) (const-version)
ConstVector::const_reference const_reference
reference back()
the last element (only for non-empty vectors)
reference operator[](size_type index)
index access
const_reference at(size_type index) const
checked access (const-version)
reference front()
the first element (only for non-empty vectors)
ConstVector::size_type size_type
size_t size_type
size_type, to conform the STL container interface
unsigned int CLID
Class ID definition.
reference operator()(size_type index)
'functional'-access
bool empty() const
empty container?
const_reverse_iterator rend() const
void erase(iterator i)
erase the object by iterator
ContainedObject * containedObject(long index) override
ConstVector::value_type value_type
various types (to make STL happy)
void insert(const TYPE *object)
insert one object into the container
bool operator<(const ConstVector &right) const
comparisons with corresponding vector
Generator[dict, None, None] reference(request, Optional[Path] reference_path)
const_iterator end() const
const CLID & clID() const override
Retrieve the unique class ID (virtual)
const_iterator begin() const
size_type size() const
get the actual size of the container
const_reference back() const
the last element (only for non-empty vectors) (const-version)
void insert(DATA first, DATA last, const PREDICATE &cut)
add the sequence of 'good'objects into the container
ConstVector::iterator iterator
long index(const ContainedObject *object) const override
Distance of a given object from the beginning of its container.
size_type numberOfObjects() const override
Number of objects in the container.
SharedObjectsContainer(const ConstVector &data)
SharedObjectsContainer(ConstVector &&data)