![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/opaque-holder.hpp"
Buffer to place and maintain an object instance privately within another object.
Variation of a similar concept as with OpaqueHolder, but implemented here with reduced security and lesser overhead. InPlaceBuffer is just a chunk of storage, which can be accessed through a common base class interface and allows to place new objects there. It has no way to keep track of the actual object living currently in the buffer. Thus, using InPlaceBuffer requires the placed class(es) themselves to maintain their lifecycle, and especially it is mandatory for the base class to provide a virtual dtor. On the other hand, just the (alignment rounded) storage for the object(s) placed into the buffer is required.
| BA | the nominal Base/Interface class for a family of types |
| siz | maximum storage required for the targets to be held inline |
| DEFAULT | the default instance to place initially |
Definition at line 606 of file opaque-holder.hpp.
Classes | |
| struct | TypeTag |
Public Types | |
| using | Handle = PlantingHandle< BA, DEFAULT > |
| a "planting handle" can be used to expose an opaque InPlaceBuffer through an API | |
Static Public Member Functions | |
| template<typename SUB > | |
| static auto | embedType () |
| helper to mark the subclass type to create. | |
Public Member Functions | |
| ~InPlaceBuffer () | |
| InPlaceBuffer () | |
| template<class SUB > | |
| InPlaceBuffer (SUB &&instance) | |
| immediately move-emplace an embedded subclass type | |
| template<class TY , typename... ARGS> | |
| InPlaceBuffer (TypeTag< TY >, ARGS &&...args) | |
| immediately emplace an embedded subclass type | |
| template<class TY , typename... ARGS> | |
| TY & | create (ARGS &&...args) |
| Abbreviation for placement new. | |
| template<class SUB > | |
| SUB & | emplace (SUB &&implementation) |
| move-construct an instance of subclass into the opaque buffer | |
| DEFAULT & | reset () |
| BA & | operator* () const |
| BA * | operator-> () const |
| template<class SUB > | |
| SUB * | access () |
Private Member Functions | |
| BA & | getObj () const |
| void | placeDefault () |
| void | destroy () |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
| std::byte | buf_ [siz] |
|
inline |
Definition at line 636 of file opaque-holder.hpp.
|
inline |
Definition at line 641 of file opaque-holder.hpp.
|
inline |
immediately move-emplace an embedded subclass type
Definition at line 648 of file opaque-holder.hpp.
|
inline |
immediately emplace an embedded subclass type
Definition at line 666 of file opaque-holder.hpp.
| struct lib::InPlaceBuffer::TypeTag |
Collaboration diagram for InPlaceBuffer< BA, siz, DEFAULT >::TypeTag< TY >:| using Handle = PlantingHandle<BA, DEFAULT> |
a "planting handle" can be used to expose an opaque InPlaceBuffer through an API
Definition at line 676 of file opaque-holder.hpp.
|
inlineprivate |
Definition at line 615 of file opaque-holder.hpp.
|
inlineprivate |
Definition at line 621 of file opaque-holder.hpp.
|
inlineprivate |
Definition at line 629 of file opaque-holder.hpp.
|
inlinestatic |
helper to mark the subclass type to create.
InPlaceBuffer(embedType<XYZ>, arg1, arg2, arg3) Definition at line 662 of file opaque-holder.hpp.
|
inline |
Abbreviation for placement new.
Definition at line 682 of file opaque-holder.hpp.
|
inline |
move-construct an instance of subclass into the opaque buffer
Definition at line 700 of file opaque-holder.hpp.
|
inline |
Definition at line 716 of file opaque-holder.hpp.
Referenced by DragRelocateController::resetState().
Here is the caller graph for this function:
|
inline |
Definition at line 729 of file opaque-holder.hpp.
|
inline |
Definition at line 735 of file opaque-holder.hpp.
|
inline |
Definition at line 743 of file opaque-holder.hpp.
References AccessCasted< TAR >::access().
Here is the call graph for this function:
|
mutableprivate |
Definition at line 611 of file opaque-holder.hpp.
Inheritance diagram for InPlaceBuffer< BA, siz, DEFAULT >:
Collaboration diagram for InPlaceBuffer< BA, siz, DEFAULT >: