![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
Managing lifecycle for a collection of objects. More...
Go to the source code of this file.
Managing lifecycle for a collection of objects.
Sometimes we need to build and own a number of objects, including lifecycle management. For example, a service provider may need to maintain a number of individual process handles. The solution here is deliberately kept simple, it is similar to using a STL container with shared_ptr(s), but behaves rather like std::unique_ptr.
Some details to note:
unique_ptrboost::ptr_vector, but doesn't require us to depend on boost-serialisation. Furthermore, Boost provides several variants of containers and a much more feature-rich API, also with the ability to clone / move containers; yet we prefer to leave out most functionality, in favour of adding a dedicated API with #manage() and #detach() to indicated semantics. And we value the ability to integrate with Lumiera Forward Iterators.Definition in file scoped-ptrvect.hpp.
#include "include/logging.h"#include "lib/iter-adapter-ptr-deref.hpp"#include "lib/nocopy.hpp"#include "lib/error.hpp"#include "lib/util.hpp"#include <vector>#include <algorithm>Namespaces | |
| namespace | lib |
| Implementation namespace for support and library code. | |
Classes | |
| class | ScopedPtrVect< T > |
| Simple vector based collection of pointers, managing lifecycle of the pointed-to objects. More... | |