diff --git a/src/proc/control/command-def.hpp b/src/proc/control/command-def.hpp index fa3be7f3d..9850c7abf 100644 --- a/src/proc/control/command-def.hpp +++ b/src/proc/control/command-def.hpp @@ -68,8 +68,12 @@ namespace control { */ class CommandDef { + Symbol id_; public: + CommandDef (Symbol cmdID) + : id_(cmdID) + { } }; ////////////////TODO currently just fleshing out the API.... diff --git a/tests/components/proc/control/command-basic-test.cpp b/tests/components/proc/control/command-basic-test.cpp index b088a52b4..999124c18 100644 --- a/tests/components/proc/control/command-basic-test.cpp +++ b/tests/components/proc/control/command-basic-test.cpp @@ -26,16 +26,21 @@ //#include "proc/mobject/session.hpp" //#include "proc/mobject/session/edl.hpp" //#include "proc/mobject/session/testclip.hpp" +//#include "proc/mobject/test-dummy-mobject.hpp" +#include "lib/p.hpp" //#include "proc/mobject/placement.hpp" //#include "proc/mobject/placement-index.hpp" //#include "proc/mobject/explicitplacement.hpp" #include "proc/control/command-def.hpp" //#include "lib/util.hpp" +#include //#include //#include #include +//using std::tr1::bind; +using std::tr1::function; //using boost::format; //using lumiera::Time; //using util::contains; @@ -47,10 +52,71 @@ namespace control { namespace test { // using session::test::TestClip; + using lib::P; - namespace command1 { + ////////////////////////////////////////////TODO braindump - ////////////////////////////////////////////TODO braindump + template + struct BuildUndoCapturing_Signature; + + template + struct BuildUndoCapturing_Signature + { + typedef function type; + }; + + template + struct BuildUndoOperation_Signature + { + typedef function type; + }; + + class CommDef + { + Symbol id_; + + template + struct UndoDefinition + { + UndoDefinition + undoOperation (typename BuildUndoOperation_Signature::type how_to_Undo) + { + + } + + }; + + template + struct BasicDefinition + { + template + UndoDefinition + captureUndo (typename BuildUndoCapturing_Signature,MEM>::type how_to_capture_UndoState) + { + + } + + }; + + public: + CommDef (Symbol cmdID) + : id_(cmdID) + { } + + template + BasicDefinition + operation (function operation_to_define) + { + + } + }; + + + + + ///////////////////////////// + ///////////////////////////// + /* bind: opFunc(a,b,c) -> op(void) @@ -61,10 +127,28 @@ namespace test { return bind( recursion(), param) */ - ////////////////////////////////////////////TODO braindump + namespace command1 { + void + command1_do (P dummyObj, int randVal) + { + *dummyObj += randVal; + } + + long + command1_cap (P dummyObj, int) + { + return *dummyObj; + } + + void + command1_undo (P dummyObj, int, long oldVal) + { + *dummyObj = oldVal; + } } + ////////////////////////////////////////////TODO braindump /*************************************************************************** @@ -89,6 +173,17 @@ namespace test { /////////////////////////////////TODO } + void + defineCommands () + { + CommDef ("test.command1") + .operation (command1_do) + .captureUndo (command1_cap) + .undoOperation (command1_undo) + .bind (obj, randVal) + ; + } + void checkExecution () {