46 #ifndef LIB_SCOPED_PTRVECT_H 47 #define LIB_SCOPED_PTRVECT_H 75 typedef std::vector<T*> _Vec;
76 typedef typename _Vec::iterator VIter;
82 typedef typename IterType::WrappedConstIterType RcIter;
86 typedef size_t size_type;
88 typedef T & reference;
89 typedef T
const& const_reference;
101 _Vec::reserve (capacity);
121 this->push_back (obj);
145 T* extracted =
static_cast<T*
> (objAddress);
146 VIter pos = std::find (_Vec::begin(),_Vec::end(), extracted);
147 if (pos != _Vec::end() &&
bool(*pos))
160 VIter e = _Vec::end();
161 for (VIter i = _Vec::begin(); i!=e; ++i)
175 operator[] (size_type i)
183 iterator begin() {
return iterator (
allPtrs()); }
184 iterator end() {
return iterator ( RIter() ); }
186 const_iterator end()
const {
return const_iterator::nil(); }
193 size_type size ()
const {
return _Vec::size(); }
194 size_type max_size ()
const {
return _Vec::max_size(); }
195 size_type capacity ()
const {
return _Vec::capacity(); }
196 bool empty ()
const {
return _Vec::empty(); }
215 return RIter (_Vec::begin(), _Vec::end());
220 _Vec&
elements = util::unConst(*
this);
221 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