42 HandlingPattern::ID TEST_HANDLING_PATTERN = HandlingPattern::DUMMY;
74 uint cnt_inst = registry.instance_count();
77 PCmdImpl source = buildTestImplFrame (registry);
80 verifySeparation (source, clone);
83 CHECK (cnt_inst == registry.instance_count());
92 typedef void Sig_oper(
int);
93 typedef long Sig_capt(
int);
94 typedef void Sig_undo(
int,
long);
96 function<Sig_oper> o_Fun (command1::operate);
97 function<Sig_capt> c_Fun (command1::capture);
98 function<Sig_undo> u_Fun (command1::undoIt);
100 CHECK (o_Fun && c_Fun && u_Fun);
104 bindRandArgument (*cmd);
105 CHECK (cmd->canExec());
116 cmd.setArguments (arg);
129 CHECK (orig && copy);
130 CHECK (orig->canExec());
131 CHECK (copy->canExec());
136 command1::check_ = 0;
138 bindRandArgument (*orig);
139 CHECK ( orig->canExec());
140 CHECK (!orig->canUndo());
141 testExec.exec (*orig,
"Execute original");
142 long state_after_exec1 = command1::check_;
143 CHECK (command1::check_ > 0);
144 CHECK (orig->canUndo());
146 CHECK (!copy->canUndo());
147 testExec.exec (*copy,
"Execute clone");
148 CHECK (command1::check_ != state_after_exec1);
149 CHECK (copy->canUndo());
152 testExec.undo (*copy,
"Undo clone");
153 CHECK (command1::check_ == state_after_exec1);
156 testExec.undo (*orig,
"Undo original");
157 CHECK (command1::check_ ==0);
Implementation helper to bind Steam-Layer commands with arbitrary argument tuples.
shared_ptr< CommandImpl > newCommandImpl(function< SIG_OPER > &operFunctor, function< SIG_CAPT > &captFunctor, function< SIG_UNDO > &undoFunctor)
set up a new command implementation frame
bool canExec() const
< state check: sufficiently defined to be invoked
Top level of the command implementation.
Managing command definitions and the storage of individual command objects.
int rani(uint bound=_iBOUND())
Customised refcounting smart pointer.
Registry managing command implementation objects (Singleton).
Steam-Layer implementation namespace root.
Metaprogramming with tuples-of-types and the std::tuple record.
Marker types to indicate a literal string and a Symbol.
Simplistic test class runner.
void verifySeparation(PCmdImpl orig, PCmdImpl copy)
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
void bindRandArgument(CommandImpl &cmd)
Helper: create random command parameter binding.
Pre-defined command execution skeletons.
Some dummy command functions used for building unit test cases.
shared_ptr< CommandImpl > createCloneImpl(CommandImpl const &refObject)
create an allocation for holding a clone of the given CommandImpl data.
Steam-Layer Command implementation.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
static HandlingPattern const & get(ID id)
retrieve the pre-configured pattern
Interface: Operation Skeleton how to invoke or undo a command.
static lib::Depend< CommandRegistry > instance
storage for the singleton factory used to access CommandRegistry