46 #ifndef CONTROL_COMMAND_IMPL_CLONE_BUILDER_H 47 #define CONTROL_COMMAND_IMPL_CLONE_BUILDER_H 68 virtual UndoMutation const& getUndoFunc() { NOTREACHED(); }
69 virtual PClo const& getClosure() { NOTREACHED(); }
70 virtual bool isValid() {
return false; }
79 virtual UndoMutation const& getUndoFunc() {
return newUndoFunctor_; }
80 virtual PClo const& getClosure() {
return newClosure_; }
81 virtual bool isValid() {
return true; }
89 template<
typename ARG>
95 return static_cast<ARG&
> (*newClosure_);
101 template<
typename ARG>
105 : newClosure_(allocator.create<ARG> (origArgHolder))
106 , newUndoFunctor_(downcast<ARG>().getMementoWiring())
129 ContextHolder newContext_;
146 template<
typename ARG>
150 REQUIRE (!newContext_->isValid(),
"Lifecycle-Error");
161 REQUIRE (newContext_->isValid());
162 return newContext_->getUndoFunc();
171 REQUIRE (newContext_->isValid());
172 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.