1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* 
 * File:   ModuleManagerWithDebug.h
 * Author: Heinrich Mellmann
 *
 */

#ifndef _ModuleManagerWithDebug_h_
#define _ModuleManagerWithDebug_h_

#include <ModuleFramework/ModuleManager.h>
#include <DebugCommunication/DebugCommandExecutor.h>
#include <DebugCommunication/DebugCommandManager.h>
#include <Tools/Debug/DebugRequest.h>

class ModuleManagerWithDebug: public ModuleManager, public DebugCommandExecutor
{
public:
  ModuleManagerWithDebug(const std::string& name);
  virtual ~ModuleManagerWithDebug();

  virtual void executeDebugCommand(const std::string& command, 
                           const std::map<std::string,std::string>& arguments, 
                           std::ostream& outstream);

protected:
  DebugCommandManager& getDebugCommandManager() {
    DebugCommandManager& debugCommandManager = *(getBlackBoard().getRepresentation<DataHolder<DebugCommandManager> >("DebugCommandManager"));
    return debugCommandManager;
  }

  DebugRequest& getDebugRequest() {
    DebugRequest& debugRequest = *(getBlackBoard().getRepresentation<DataHolder<DebugRequest> >("DebugRequest"));
    return debugRequest;
  }

private:
  std::string commandModulesList;
  std::string commandModulesSet;
  std::string commandModulesStore;
  std::string commandModulesStopwatch;

  std::string commandRepresentationList;
  std::string commandRepresentationPrint;
  std::string commandRepresentationGet;
  std::string commandRepresentationSet;


  std::string commandDebugRequestSet;
  
  
  void modulesList(std::ostream& outstream);
  void modulesStore(std::ostream& outstream);
  void modulesSet( std::ostream& outstream,
                   const std::map<std::string,std::string>& arguments);
  void modulesStopwatch(std::ostream& outstream);
  
  void setRepresentation(std::ostream &outstream, const std::string& name, const std::string& data);
  void printRepresentation(std::ostream& outstream, const std::string& name, bool binary);
  void representationList(std::ostream& outstream);
};

#endif  /* _ModuleManagerWithDebug_h_ */