![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/opaque-holder.hpp"
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBuffer, without having to disclose the concrete buffer type or size.
siz (buffer size) template parameter from #InPlaceBuffer is deliberately not part of the PlantingHandle<BA,DEFAULT> type, since buffer size can be considered an opaque implementation detail. As a consequence, we must capture this size information at construction time and store it at runtime maxSiz_, to protect against buffer overrun. Definition at line 771 of file opaque-holder.hpp.
Public Member Functions | |
| template<size_t maxSiz> | |
| PlantingHandle (InPlaceBuffer< BA, maxSiz, DEFAULT > &targetBuffer) | |
| template<class SUB > | |
| bool | canCreate () const |
| template<class SUB > | |
| SUB & | emplace (SUB &&implementation) |
| move-construct an instance of a subclass into the opaque buffer | |
| template<class SUB , typename... ARGS> | |
| SUB & | create (ARGS &&...args) |
| Abbreviation for placement new of a subclass SUB into the opaque buffer. | |
| BA * | get () const |
Private Member Functions | |
| template<class SUB > | |
| void | __ensure_can_create () |
Private Attributes | |
| void * | buffer_ |
| size_t | maxSiz_ |
|
inline |
Definition at line 786 of file opaque-holder.hpp.
|
inlineprivate |
Helper to ensure the opaque buffer provides sufficient storage
| SUB | actual subclass type to be implanted into the opaque buffer |
Definition at line 847 of file opaque-holder.hpp.
|
inline |
Definition at line 796 of file opaque-holder.hpp.
References PlantingHandle< BA, DEFAULT >::maxSiz_.
|
inline |
move-construct an instance of a subclass into the opaque buffer
Definition at line 806 of file opaque-holder.hpp.
References PlantingHandle< BA, DEFAULT >::buffer_, and PlantingHandle< BA, DEFAULT >::emplace().
Referenced by Record< VAL >::Mutator::buildMutator(), NotificationHub::buildMutator(), TimelineGui::buildMutator(), MarkerWidget::buildMutator(), TimelineController::buildMutator(), TrackPresenter::buildMutator(), Opaque::buildMutator(), DiffTreeMutationListener_test::buildMutator(), ClipPresenter::buildMutator(), MockElm::buildMutator(), DiffTreeApplicationSimple_test::demo_two(), PlantingHandle< BA, DEFAULT >::emplace(), DiffIgnoreChanges_test::fail_or_ignore(), DiffIgnoreChanges_test::fish_for_content(), TreeMutatorBinding_test::mutateAttribute(), TestWireTap< PAR >::mutateChild(), TreeMutatorBinding_test::mutateCollection(), and StackScopeManager< buffSiz >::openScope().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Abbreviation for placement new of a subclass SUB into the opaque buffer.
Definition at line 819 of file opaque-holder.hpp.
References PlantingHandle< BA, DEFAULT >::buffer_.
Referenced by ClipPresenter::buildGestureObserver().
Here is the caller graph for this function:
|
inline |
Definition at line 831 of file opaque-holder.hpp.
References PlantingHandle< BA, DEFAULT >::buffer_.
Referenced by DiffApplicationStrategy< TAR, enable_if< TreeDiffTraits< TAR > > >::buildMutator(), WrappedStandardExeBuilder::invokeOriginalBuilder(), and TreeDiffMutatorBinding::mut().
Here is the caller graph for this function:
|
private |
Definition at line 773 of file opaque-holder.hpp.
Referenced by PlantingHandle< BA, DEFAULT >::create(), PlantingHandle< BA, DEFAULT >::emplace(), and PlantingHandle< BA, DEFAULT >::get().
|
private |
Definition at line 774 of file opaque-holder.hpp.
Referenced by PlantingHandle< BA, DEFAULT >::canCreate().
Collaboration diagram for PlantingHandle< BA, DEFAULT >: