- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Command/CommandDispatcher.h

    00001
    00002 //
    00003 // Copyright (c) 2005           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00010
    00011 #ifndef MERS_EXECUTIVES_DEDUCTIVECONTROLLER_COMMAND_COMMANDDISPATCHER_HEADERFILE
    00012 #define MERS_EXECUTIVES_DEDUCTIVECONTROLLER_COMMAND_COMMANDDISPATCHER_HEADERFILE
    00013
    00014 #ifdef _MSC_VER
    00015 #pragma warning(disable:4786)
    00016 #endif
    00017
    00018 #include <Mers/Interfaces/ExecutionInterfaceBase.h>
    00019 #include <Mers/Utils/Containers/ObjectArray.h>
    00020
    00021 namespace Mers {
    00022         namespace Models {
    00023                 namespace Base {
    00024                         class BaseModel;
    00025                         class BaseModelVariableArray;
    00026                 }
    00027         }
    00028         namespace Interfaces {
    00029                 class ExecutionInterfaceBase;
    00030         }
    00031         namespace Executives {
    00032                 namespace DeductiveController {
    00033                         namespace Command {
    00034
    00039                                 class CommandDispatcher :
    00040                                         public Mers::Interfaces::ExecutionInterfaceBase
    00041                                 {
    00042                                 public:
    00046                                         CommandDispatcher();
    00047
    00051                                         ~CommandDispatcher();
    00052
    00061                                         void setModel(Mers::Models::Base::BaseModel const * model);
    00062
    00081                                         int addConnection(Mers::Interfaces::ExecutionInterfaceBase * connection,
    00082                                                 char const * fileName);
    00083
    00095                                         virtual void issueCommand(unsigned int commandVariable,
    00096                                                 unsigned int commandValue);
    00097
    00114                                         virtual bool start( TaskIdentifier task ) = 0;
    00115
    00120                                         virtual bool stop() = 0;
    00121
    00132                                         virtual bool stop( TaskIdentifier task ) = 0;
    00133
    00153                                         virtual int step( bool block = true ) = 0;
    00154
    00160                                         virtual bool isDone() = 0;
    00161
    00169                                         virtual bool isDone( TaskIdentifier task ) = 0;
    00170
    00179                                         virtual Mers::Utils::Lang::String getActiveTasksString() const;
    00180
    00190                                         virtual TaskIdentifier createTask( const std::string &taskName );
    00191
    00203                                         virtual TaskIdentifier createTask( const std::string &taskName,
    00204                                                                                                                                                                                  std::vector<std::string *> const &parameters );
    00205
    00213                                         virtual bool isValid( TaskIdentifier task );
    00214
    00223                                         virtual void deleteTask( TaskIdentifier task );
    00224
    00230                                         virtual TaskFactory * getTaskFactory();
    00231
    00241                                         virtual Task * getTask( TaskIdentifier task ) const;
    00242
    00243 #ifndef EMBEDDED
    00244
    00250                                         virtual void print(std::ostream &out) const;
    00251 #endif
    00252
    00253                                 protected:
    00254
    00255                                 protected:
    00257
    00261                                         Mers::Utils::Containers::DynamicArrayTemplate< const CommandDispatcherEntry > m_DispatchLists;
    00262
    00264                                         Mers::Models::Base::BaseModelVariableArray const * mModelVariables;
    00265                                 };
    00266                         }
    00267                 }
    00268         }
    00269 }
    00270
    00271 #endif
    00272