TaskOutcomeDebugger.h
Go to the documentation of this file.
1#pragma once
2
4
8
12
14{
15
16 /**
17 * Interactive debugger component for the TaskOutcome memory.
18 *
19 * Allows committing and querying task outcomes via terminal commands.
20 * The TaskOutcomeMemory server must be running.
21 *
22 * Commands:
23 * commit <taskName> <taskType> <outcome> [errorMessage]
24 * read - read all task outcomes
25 * read_type <taskType> - read outcomes filtered by task type
26 * read_failures - read only failures
27 * exit - exit the debugger
28 */
30 virtual public armarx::Component,
32 {
33 public:
34 std::string getDefaultName() const override;
35 static std::string GetDefaultName();
36
37 public:
38 static const std::string providerName;
39
40 protected:
42
43 void onInitComponent() override;
44 void onConnectComponent() override;
45 void onDisconnectComponent() override;
46 void onExitComponent() override;
47
48 private:
49 void run();
50
51 // Commands
52 void commitCommand();
53 void readAllCommand();
54 void readByTypeCommand();
55 void readFailuresCommand();
56
57 // Helpers
58 void commitOutcome(const std::string& taskName,
61 const std::optional<std::string>& errorMessage);
62
63 void printOutcomes(const std::vector<armem::task_outcome::TaskOutcome>& outcomes);
64
66 parseOutcomeType(const std::string& str);
67
69 parseTaskType(const std::string& str);
70
71 static std::string outcomeTypeToString(armem::task_outcome::TaskOutcomeType type);
72 static std::string taskTypeToString(armem::task_outcome::TaskType type);
73 static std::string failureTypeToString(const armem::task_outcome::FailureType& type);
74
75 private:
76 bool running = false;
77
80 };
81
82} // namespace armarx::components::task_outcome_debugger
std::string str(const T &t)
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
Interactive debugger component for the TaskOutcome memory.
void onInitComponent() override
Pure virtual hook for the subclass.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onConnectComponent() override
Pure virtual hook for the subclass.
std::string getDefaultName() const override
Retrieve default name of component.
plugins::ListeningPluginUser ComponentPluginUser
Definition plugins.h:10
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.