37 #ifndef LIB_SCOPED_PTRVECT_H 38 #define LIB_SCOPED_PTRVECT_H 66 typedef std::vector<T*> _Vec;
67 typedef typename _Vec::iterator VIter;
73 typedef typename IterType::WrappedConstIterType RcIter;
77 typedef size_t size_type;
79 typedef T & reference;
80 typedef T
const& const_reference;
92 _Vec::reserve (capacity);
112 this->push_back (obj);
136 T* extracted =
static_cast<T*
> (objAddress);
137 VIter pos = std::find (_Vec::begin(),_Vec::end(), extracted);
138 if (pos != _Vec::end() &&
bool(*pos))
151 VIter e = _Vec::end();
152 for (VIter i = _Vec::begin(); i!=e; ++i)
166 operator[] (size_type i)
174 iterator begin() {
return iterator (
allPtrs()); }
175 iterator end() {
return iterator ( RIter() ); }
177 const_iterator end()
const {
return const_iterator::nil(); }
184 size_type size ()
const {
return _Vec::size(); }
185 size_type max_size ()
const {
return _Vec::max_size(); }
186 size_type capacity ()
const {
return _Vec::capacity(); }
187 bool empty ()
const {
return _Vec::empty(); }
206 return RIter (_Vec::begin(), _Vec::end());
211 _Vec&
elements = util::unConst(*
this);
212 return RIter (elements.begin(), elements.end());
wrapper for an existing Iterator type, automatically dereferencing the output of the former...
IterQueue< T > elements(T const &elm)
convenience free function to build an iterable sequence
Extension adapter for Lumiera Forward Iterators to dereference any pointer values automatically...
#define ERROR_LOG_AND_IGNORE(_FLAG_, _OP_DESCR_)
convenience shortcut for a sequence of catch blocks just logging and consuming an error...
Any copy and copy construction prohibited.
This header is for including and configuring NoBug.
Implementation namespace for support and library code.
Simple vector based collection of pointers, managing lifecycle of the pointed-to objects.
Derived specific exceptions within Lumiera's exception hierarchy.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
static PtrDerefIter build_by_cast(WrappedIterType const &srcIter)
explicit builder to allow creating a const variant from the basic srcIter type.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
T * detach(void *objAddress)
withdraw responsibility for a specific object.
Lumiera error handling (C++ interface).
Accessing a STL element range through a Lumiera forward iterator, An instance of this iterator adapte...
T & manage(T *obj)
take ownership of the given object, adding it at the end of the collection