Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/scoped-ptrvect.hpp"
Simple vector based collection of pointers, managing lifecycle of the pointed-to objects.
Implemented as a non-copyable object, based on a vector of bare pointers (private inheritance)
Definition at line 62 of file scoped-ptrvect.hpp.
Public Types | |
typedef ConstIterType | const_iterator |
typedef T const & | const_reference |
typedef IterType | iterator |
typedef T & | reference |
typedef size_t | size_type |
typedef T | value_type |
Public Member Functions | |
ScopedPtrVect (size_type capacity) | |
iterator | begin () |
const_iterator | begin () const |
size_type | capacity () const |
void | clear () |
T * | detach (void *objAddress) |
withdraw responsibility for a specific object. More... | |
bool | empty () const |
iterator | end () |
const_iterator | end () const |
T & | manage (T *obj) |
take ownership of the given object, adding it at the end of the collection More... | |
size_type | max_size () const |
T & | operator[] (size_type i) |
size_type | size () const |
Private Types | |
typedef std::vector< T * > | _Vec |
typedef IterType::ConstIterType | ConstIterType |
typedef PtrDerefIter< RIter > | IterType |
typedef IterType::WrappedConstIterType | RcIter |
typedef RangeIter< VIter > | RIter |
typedef _Vec::iterator | VIter |
Private Member Functions | |
RIter | allPtrs () |
RIter | allPtrs () const |
T * | get (size_type i) |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
|
inline |
take ownership of the given object, adding it at the end of the collection
Definition at line 107 of file scoped-ptrvect.hpp.
Referenced by DiagnosticOutputSlot::build(), CommandArgument_test::createTuples(), and DisplayService::setUp().
|
inline |
withdraw responsibility for a specific object.
This object will be removed form this collection and returned as-is; it won't be deleted when the ScopedPtrVect goes out of scope.
obj | address of the object in question. |
Definition at line 134 of file scoped-ptrvect.hpp.
|
inlineprivate |
element access, including range and null check
Definition at line 193 of file scoped-ptrvect.hpp.
Referenced by WrappedStandardExeBuilder::__call__().
|
inlineprivate |
access sequence of all managed pointers
Definition at line 204 of file scoped-ptrvect.hpp.
Referenced by ScopedPtrVect< Gtk::Widget >::allPtrs().