Go to the documentation of this file.
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 {
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; }
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
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
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)