diff --git a/src/proc/control/command-instance-manager.hpp b/src/proc/control/command-instance-manager.hpp index 71e6e4d8f..f4cb60de5 100644 --- a/src/proc/control/command-instance-manager.hpp +++ b/src/proc/control/command-instance-manager.hpp @@ -43,7 +43,7 @@ ** @see command-def.hpp ** @see command-setup.hpp ** @see command-accessor.hpp - ** @see TODO_CommandInstanceManager_test + ** @see CommandInstanceManager_test ** */ @@ -53,11 +53,12 @@ #define CONTROL_COMMAND_INSTANCE_MANAGER_H #include "lib/error.hpp" -//#include "lib/symbol.hpp" +#include "proc/control/command-dispatch.hpp" +#include "lib/symbol.hpp" //#include "proc/common.hpp" #include -//#include +#include @@ -65,8 +66,8 @@ namespace proc { namespace control { -// using std::string; -// using lib::Symbol; + using std::string; + using lib::Symbol; //using std::shared_ptr; @@ -77,12 +78,16 @@ namespace control { class CommandInstanceManager : boost::noncopyable { + CommandDispatch& dispatcher_; public: - - CommandInstanceManager(); + CommandInstanceManager (CommandDispatch&); ~CommandInstanceManager(); + Symbol newInstance (Symbol prototypeID, string invocationID); + void dispatch (Symbol instanceID); + + bool contains (Symbol instanceID) const; private: }; diff --git a/src/proc/control/command-setup.cpp b/src/proc/control/command-setup.cpp index a0eb41397..58d45b91f 100644 --- a/src/proc/control/command-setup.cpp +++ b/src/proc/control/command-setup.cpp @@ -155,12 +155,29 @@ namespace control { // emit dtors of embedded objects here.... CommandInstanceManager::~CommandInstanceManager() { } - CommandInstanceManager::CommandInstanceManager() { } - - + CommandInstanceManager::CommandInstanceManager (CommandDispatch& dispatcher) + : dispatcher_{dispatcher} + { } /* more to come here...*/ + Symbol + CommandInstanceManager::newInstance (Symbol prototypeID, string invocationID) + { + UNIMPLEMENTED ("CommandInstanceManager::newInstance"); + } + + void + CommandInstanceManager::dispatch (Symbol instanceID) + { + UNIMPLEMENTED ("CommandInstanceManager::dispatch"); + } + + bool + CommandInstanceManager::contains (Symbol instanceID) const + { + UNIMPLEMENTED ("CommandInstanceManager::contains"); + } diff --git a/tests/core/proc/control/command-instance-manager-test.cpp b/tests/core/proc/control/command-instance-manager-test.cpp index 68f068709..c8eeb4a71 100644 --- a/tests/core/proc/control/command-instance-manager-test.cpp +++ b/tests/core/proc/control/command-instance-manager-test.cpp @@ -26,8 +26,8 @@ #include "lib/test/run.hpp" +#include "proc/control/test-dummy-commands.hpp" #include "proc/control/command-instance-manager.hpp" -#include "proc/control/command-dispatch.hpp" //#include "proc/control/command-def.hpp" #include "lib/format-string.hpp" #include "lib/format-cout.hpp" @@ -54,8 +54,11 @@ namespace test { namespace { // Test fixture.... - struct Fixture - : CommandDispatch + const Symbol COMMAND_PROTOTYPE = test_Dummy_command1; + const string INVOCATION_ID = "CommandInstanceManager_test"; + + class Fixture + : public CommandDispatch { bool has_commands_in_queue = false; @@ -73,6 +76,13 @@ namespace test { { UNIMPLEMENTED("DummyDispatch-Interface: enqueue"); } + + public: + bool + contains (Symbol instanceID) + { + UNIMPLEMENTED("contains"); + } }; } @@ -102,8 +112,6 @@ namespace test { void verify_standardUsage() { - UNIMPLEMENTED("standard usage cycle"); -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1089 Fixture fixture; CommandInstanceManager iManager{fixture}; Symbol instanceID = iManager.newInstance(COMMAND_PROTOTYPE, INVOCATION_ID); @@ -118,6 +126,7 @@ namespace test { CHECK (not iManager.contains (instanceID)); CHECK (fixture.contains (instanceID)); CHECK (Command::canExec(instanceID)); +#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1089 #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1089 } };