Go to the documentation of this file.
3 #include <SimoxUtility/algorithm/string.h>
6 #include <RobotAPI/libraries/armem_skills/aron/Skill.aron.generated.h>
37 armarx::skills::arondto::SkillStatusUpdate event;
44 auto aron =
event.toAron();
47 auto& entityUpdate = comm.
add();
50 entityUpdate.instancesData = {aron};
51 entityUpdate.entityID = commitId;
56 std::map<skills::SkillExecutionID, skills::SkillStatusUpdate>
59 std::map<skills::SkillExecutionID, skills::SkillStatusUpdate>
ret;
63 coreSegment->doLocked([&](){
64 coreSegment->forEachInstance(
67 auto event = i.
dataAs<armarx::skills::arondto::SkillStatusUpdate>();
71 if (
auto it =
ret.find(up.executionId); it !=
ret.end() && up < it->second)
77 ret[up.executionId] = up;
89 std::optional<skills::SkillStatusUpdate>
92 std::optional<skills::SkillStatusUpdate>
ret = std::nullopt;
96 coreSegment->doLocked([&](){
97 coreSegment->forEachInstance(
100 auto event = i.
dataAs<armarx::skills::arondto::SkillStatusUpdate>();
104 if (up.executionId ==
id)
106 if (!
ret || (
ret.has_value() && *
ret < up))
ReaderT::InputType T & ret
This file is part of ArmarX.
std::string providerSegmentName
A bundle of updates to be sent to the memory.
Client-side working entity instance.
Helps connecting a Memory server to the Ice interface.
float confidence
An optional confidence, may be used for things like decay.
void toAron(arondto::MemoryID &dto, const MemoryID &bo)
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
SkillEventCoreSegment(armem::server::MemoryToIceAdapter &iceMemory)
server::wm::CoreSegment * segmentPtr
AronDtoT dataAs() const
Get the data converted to a generated Aron DTO class.
virtual void init() override
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
void fromAron(const arondto::MemoryID &dto, MemoryID &bo)
MemoryToIceAdapter & iceMemory
void setDefaultMaxHistorySize(int64_t maxHistorySize)
std::map< skills::SkillExecutionID, skills::SkillStatusUpdate > getSkillStatusUpdates()
void addSkillUpdateEvent(const skills::SkillStatusUpdate &update)
void defineProperties(PropertyDefinitionsPtr defs, const std::string &prefix)
std::optional< skills::SkillStatusUpdate > getSkillStatusUpdate(const skills::SkillExecutionID &id)
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
data::CommitResult commitLocking(const data::Commit &commitIce, Time timeArrived)
This file offers overloads of toIce() and fromIce() functions for STL container types.