SkillsMemory.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package RobotAPI::ArmarXObjects::SkillsMemory
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2020
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 // Base Class
27 
28 // ArmarX
29 #include <ArmarXCore/interface/core/Profiler.h>
31 
32 #include <RobotAPI/interface/skills/SkillMemoryInterface.h>
34 #include <RobotAPI/libraries/armem_skills/aron/Statechart.aron.generated.h>
41 
42 namespace armarx
43 {
44  /**
45  * @defgroup Component-SkillsMemory SkillsMemory
46  * @ingroup RobotAPI-Components
47  * A description of the component SkillsMemory.
48  *
49  * @class SkillsMemory
50  * @ingroup Component-SkillsMemory
51  * @brief Brief description of class SkillsMemory.
52  *
53  * Detailed description of class SkillsMemory.
54  */
55  class SkillsMemory :
56  virtual public armarx::Component,
57  virtual public skills::dti::SkillMemoryInterface,
58 
61  virtual public SkillManagerComponentPluginUser
62  {
63  public:
64  SkillsMemory();
65 
66  /// @see armarx::ManagedIceObject::getDefaultName()
67  std::string getDefaultName() const override;
68 
69  // Override StatechartListener
70  void
71  reportStatechartTransitionWithParameters(const ProfilerStatechartTransitionWithParameters&,
72  const Ice::Current&) override;
74  const ProfilerStatechartTransitionWithParametersList&,
75  const Ice::Current&) override;
76 
77  // Override SkillManager to add memory functions
78  void addProvider(const skills::manager::dto::ProviderInfo& info,
79  const Ice::Current& current) override;
80 
81  void removeProvider(const skills::manager::dto::ProviderID& provider,
82  const Ice::Current& current) override;
83 
84  skills::manager::dto::SkillStatusUpdate
85  executeSkill(const skills::manager::dto::SkillExecutionRequest& info,
86  const Ice::Current& current) override;
87 
88 
89  skills::manager::dto::SkillExecutionID
90  executeSkillAsync(const skills::manager::dto::SkillExecutionRequest& info,
91  const Ice::Current& current) override;
92 
93  void updateStatusForSkill(const skills::provider::dto::SkillStatusUpdate& update,
94  const skills::callback::dto::ProviderID& id,
95  const Ice::Current& current) override;
96 
97  IceUtil::Optional<skills::manager::dto::SkillStatusUpdate>
98  getSkillExecutionStatus(const skills::manager::dto::SkillExecutionID& executionId,
99  const Ice::Current& current) override;
100 
101  skills::manager::dto::SkillStatusUpdateMap
102  getSkillExecutionStatuses(const Ice::Current& current) override;
103 
104  // WritingInterface interface
105  armem::data::CommitResult commit(const armem::data::Commit& commit,
106  const Ice::Current&) override;
107 
108  protected:
109  /// @see armarx::ManagedIceObject::onInitComponent()
110  void onInitComponent() override;
111 
112  /// @see armarx::ManagedIceObject::onConnectComponent()
113  void onConnectComponent() override;
114 
115  /// @see armarx::ManagedIceObject::onDisconnectComponent()
116  void onDisconnectComponent() override;
117 
118  /// @see armarx::ManagedIceObject::onExitComponent()
119  void onExitComponent() override;
120 
121  /// @see PropertyUser::createPropertyDefinitions()
123 
124 
125  private:
126  static constexpr const char* MemoryName = "Skill";
127 
128  struct Properties
129  {
130  };
131 
132  Properties p;
133 
134  skills::segment::StatechartListenerProviderSegment statechartListenerProviderSegment;
135  skills::segment::ExecutableSkillLibraryCoreSegment executableSkillCoreSegment;
136  skills::segment::SkillEventCoreSegment skillEventCoreSegment;
137  skills::segment::SkillExecutionRequestCoreSegment skillExecutionRequestCoreSegment;
138  };
139 } // namespace armarx
armarx::skills::segment::StatechartListenerProviderSegment
Definition: StatechartListenerSegment.h:14
armarx::SkillsMemory::removeProvider
void removeProvider(const skills::manager::dto::ProviderID &provider, const Ice::Current &current) override
Definition: SkillsMemory.cpp:141
armarx::skills::segment::SkillExecutionRequestCoreSegment
Definition: SkillExecutionRequestSegment.h:17
armarx::SkillsMemory::onExitComponent
void onExitComponent() override
Definition: SkillsMemory.cpp:95
armarx::skills::segment::SkillEventCoreSegment
Definition: SkillEventSegment.h:16
armarx::SkillsMemory::addProvider
void addProvider(const skills::manager::dto::ProviderInfo &info, const Ice::Current &current) override
Definition: SkillsMemory.cpp:129
armarx::SkillsMemory::getSkillExecutionStatus
IceUtil::Optional< skills::manager::dto::SkillStatusUpdate > getSkillExecutionStatus(const skills::manager::dto::SkillExecutionID &executionId, const Ice::Current &current) override
Definition: SkillsMemory.cpp:181
armarx::SkillsMemory::onDisconnectComponent
void onDisconnectComponent() override
Definition: SkillsMemory.cpp:90
armarx::SkillsMemory::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: SkillsMemory.cpp:54
ReadWritePluginUser.h
armarx::SkillsMemory::getDefaultName
std::string getDefaultName() const override
Definition: SkillsMemory.cpp:70
armarx::SkillsMemory::onConnectComponent
void onConnectComponent() override
Definition: SkillsMemory.cpp:85
ExecutableSkillLibrarySegment.h
armarx::SkillsMemory::reportStatechartTransitionWithParametersList
void reportStatechartTransitionWithParametersList(const ProfilerStatechartTransitionWithParametersList &, const Ice::Current &) override
Definition: SkillsMemory.cpp:217
StatechartListenerComponentPlugin.h
armarx::SkillsMemory::commit
armem::data::CommitResult commit(const armem::data::Commit &commit, const Ice::Current &) override
Definition: SkillsMemory.cpp:100
armarx::skills::segment::ExecutableSkillLibraryCoreSegment
Definition: ExecutableSkillLibrarySegment.h:18
SkillManagerComponentPlugin.h
ObserverObjectFactories.h
armarx::SkillsMemory::reportStatechartTransitionWithParameters
void reportStatechartTransitionWithParameters(const ProfilerStatechartTransitionWithParameters &, const Ice::Current &) override
Definition: SkillsMemory.cpp:209
armarx::SkillsMemory::updateStatusForSkill
void updateStatusForSkill(const skills::provider::dto::SkillStatusUpdate &update, const skills::callback::dto::ProviderID &id, const Ice::Current &current) override
Definition: SkillsMemory.cpp:171
armarx::armem::server::plugins::ReadWritePluginUser
Base class of memory server components.
Definition: ReadWritePluginUser.h:20
armarx::SkillsMemory::executeSkillAsync
skills::manager::dto::SkillExecutionID executeSkillAsync(const skills::manager::dto::SkillExecutionRequest &info, const Ice::Current &current) override
Definition: SkillsMemory.cpp:161
armarx::SkillsMemory::SkillsMemory
SkillsMemory()
Definition: SkillsMemory.cpp:42
armarx::SkillManagerComponentPluginUser
Definition: SkillManagerComponentPlugin.h:82
armarx::SkillsMemory::onInitComponent
void onInitComponent() override
Definition: SkillsMemory.cpp:76
armarx::SkillsMemory
Brief description of class SkillsMemory.
Definition: SkillsMemory.h:55
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
SkillExecutionRequestSegment.h
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::StatechartListenerComponentPluginUser
Definition: StatechartListenerComponentPlugin.h:26
StatechartListenerSegment.h
armarx::SkillsMemory::getSkillExecutionStatuses
skills::manager::dto::SkillStatusUpdateMap getSkillExecutionStatuses(const Ice::Current &current) override
Definition: SkillsMemory.cpp:194
SkillEventSegment.h
armarx::SkillsMemory::executeSkill
skills::manager::dto::SkillStatusUpdate executeSkill(const skills::manager::dto::SkillExecutionRequest &info, const Ice::Current &current) override
Definition: SkillsMemory.cpp:151
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28