37 #ifndef CONTROL_COMMAND_IMPL_CLONE_BUILDER_H 38 #define CONTROL_COMMAND_IMPL_CLONE_BUILDER_H 59 virtual UndoMutation const& getUndoFunc() { NOTREACHED(); }
60 virtual PClo const& getClosure() { NOTREACHED(); }
61 virtual bool isValid() {
return false; }
70 virtual UndoMutation const& getUndoFunc() {
return newUndoFunctor_; }
71 virtual PClo const& getClosure() {
return newClosure_; }
72 virtual bool isValid() {
return true; }
80 template<
typename ARG>
86 return static_cast<ARG&
> (*newClosure_);
92 template<
typename ARG>
96 : newClosure_(allocator.create<ARG> (origArgHolder))
97 , newUndoFunctor_(downcast<ARG>().getMementoWiring())
120 ContextHolder newContext_;
137 template<
typename ARG>
141 REQUIRE (!newContext_->isValid(),
"Lifecycle-Error");
152 REQUIRE (newContext_->isValid());
153 return newContext_->getUndoFunc();
162 REQUIRE (newContext_->isValid());
163 return newContext_->getClosure();
UndoMutation const & clonedUndoMutation()
after visitation: use pre-built bits to provide a cloned UndoFunctor
ARG & downcast()
helper for accessing the new cloned closure through the specific concrete type.
Abstract foundation for building custom allocation managers.
void buildCloneContext(ARG const &origArgHolder)
to be executed from within the specifically typed context of a concrete command StorageHolder; alloca...
Core of a Steam-Layer command: functor containing the operation to be executed.
#define INSTANCEOF(CLASS, EXPR)
shortcut for subclass test, intended for assertions only.
Any copy and copy construction prohibited.
PClo const & clonedClosuere()
after visitation: provide cloned StorageHolder, but already stripped down to the generic usage type ...
Steam-Layer implementation namespace root.
< Interface and empty state
Specialised version of the command Mutation functor, used to implement the UNDO functionality.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Helper allowing type erasure while holding the actual object inline.
Visitor to support creating a CommandImpl clone.
Foundation for a custom allocation manager, tracking the created objects by smart-ptrs.
Buffer to place and maintain an object instance privately within another object.