SkillEventSegment.h
Go to the documentation of this file.
1#pragma once
2
3#include <thread>
4
5// Base Class
8
9// ArmarX
10#include <RobotAPI/interface/skills/SkillManagerInterface.h>
11#include <RobotAPI/interface/skills/SkillProviderInterface.h>
12#include <RobotAPI/libraries/armem_skills/aron/Skill.aron.generated.h>
14
16{
18 {
20
21 public:
22 static constexpr const char* CoreSegmentName = "SkillEvent";
23
25
26 void defineProperties(PropertyDefinitionsPtr defs, const std::string& prefix);
27 void init();
28
30
31 std::map<skills::SkillExecutionID, skills::SkillStatusUpdate> getSkillStatusUpdates();
32
33 std::optional<skills::SkillStatusUpdate>
35
36 /**
37 * @brief Clear all snapshots from the working memory of this
38 * core segment, consolidating them into @p ltm first if
39 * @c ltm.isRecording() returns true.
40 *
41 * Mirrors the state after a fresh memory restart.
42 *
43 * @param ltm Target LTM; written only if recording.
44 * @param memoryName Memory name used for the temporary WM slice.
45 * @param[out] consolidated Set to true iff snapshots were written to LTM.
46 * @return Number of snapshots that were removed from working memory.
47 */
49 const std::string& memoryName,
50 bool& consolidated);
51
52 private:
53 struct Properties
54 {
55 armarx::skills::SkillEventListenerInterfacePrx skillEventTopic;
56 };
57
58 Properties p;
59
60 };
61} // namespace armarx::skills::segment
Helps connecting a Memory server to the Ice interface.
A memory storing data on the hard drive and in mongodb (needs 'armarx memory start' to start the mong...
Definition Memory.h:24
void addSkillUpdateEvent(const skills::SkillStatusUpdate &update)
std::size_t clearAndConsolidate(armem::server::ltm::Memory &ltm, const std::string &memoryName, bool &consolidated)
Clear all snapshots from the working memory of this core segment, consolidating them into ltm first i...
SkillEventCoreSegment(armem::server::MemoryToIceAdapter &iceMemory)
std::map< skills::SkillExecutionID, skills::SkillStatusUpdate > getSkillStatusUpdates()
std::optional< skills::SkillStatusUpdate > getSkillStatusUpdate(const skills::SkillExecutionID &id)
void defineProperties(PropertyDefinitionsPtr defs, const std::string &prefix)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.