50 using std::make_tuple;
58 Symbol COMMAND1 (
"test.equalityCommand1");
59 Symbol COMMAND2 (
"test.equalityCommand2");
61 const string MARK_1 (
"|_1_");
62 const string MARK_2 (
"|_2_");
64 void oper_1 (
char par) { check_ += MARK_1 + par; }
65 void oper_2 (
char par) { check_ += MARK_2 + par; }
67 string capt_1 (
char par) {
return check_ + MARK_1 +
"|"+par+
"|"; }
68 string capt_2 (
char par) {
return check_ + MARK_2 +
"|"+par+
"|"; }
70 void undo_1 (
char par,
string mem) { check_ = mem + MARK_1 + par +
"|";}
71 void undo_2 (
char par,
string mem) { check_ = mem + MARK_2 + par +
"|";}
74 typedef void Sig_oper(
char);
75 typedef string Sig_capt(
char);
76 typedef void Sig_undo(
char,
string);
78 typedef function<Sig_oper> Fun_o;
79 typedef function<Sig_capt> Fun_c;
80 typedef function<Sig_undo> Fun_u;
108 CHECK (&oper_1 != &oper_2);
109 CHECK (&capt_1 != &capt_2);
110 CHECK (&undo_1 != &undo_2);
114 .captureUndo (capt_1)
115 .undoOperation (undo_1)
119 .captureUndo (capt_2)
120 .undoOperation (undo_2)
132 CHECK (!isSameObject (c1, c2));
135 string protocol1 = execCommand(c1);
136 string protocolX = execCommand(cx);
137 string protocol2 = execCommand(c2);
139 CHECK (protocol1 == protocolX);
140 CHECK (protocol1 != protocol2);
153 cout << com <<
":" << check_ << endl;
155 cout << com <<
":" << check_ << endl;
Helper class used solely for defining a Command-Object.
typename BuildTupleType< TYPES >::Type Tuple
Build a std::tuple from types given as type sequence.
Core of a Steam-Layer command: functor containing the operation to be executed.
Implementation helper to bind Steam-Layer commands with arbitrary argument tuples.
Proof-of-concept implementation of CmdClosure.
static Command get(Symbol cmdID)
Access existing command for use.
Steam-Layer implementation namespace root.
closure to deal with the actual command operation.
Metaprogramming with tuples-of-types and the std::tuple record.
A special binding used by Steam-Layer commands for capturing UNDO state information.
Token or Atom with distinct identity.
Marker types to indicate a literal string and a Symbol.
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
string execCommand(Command com)
Helper: invoke and undo a command,.
Dummy / proof-of-concept implementation of CmdClosure.
A collection of frequently used helper functions to support unit testing.
Handle object representing a single Command instance to be used by client code.
RET bind()
Accept dummy binding (0 Arg)
Actually defining a command and binding it to execution parameters.
Binding together state capturing and execution of the undo operation.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities. ...
A passive container record holding the actual command arguments & UNDO state.