ClassWriter.cpp
Go to the documentation of this file.
1#include "ClassWriter.h"
2
4{
5 ClassWriter::ClassWriter(const std::string& p) : providerName(p)
6 {
7 }
8
9 void
10 ClassWriter::setProviderName(const std::string& pName)
11 {
12 this->providerName = pName;
13 }
14
15 bool
17 const armarx::core::time::DateTime& referenceTime)
18 {
19 armarx::armem::arondto::ObjectClass objClassAron;
20 armarx::armem::clazz::toAron(objClassAron, c);
21
26 mid.entityName = c.id.str();
27
28 auto commit = armarx::armem::Commit();
29 auto& update = commit.add();
30
31 update.confidence = 1.0f;
32 update.referencedTime = referenceTime;
33 update.sentTime = armarx::core::time::DateTime::Now();
34 update.entityID = mid;
35 update.instancesData = {objClassAron.toAron()};
36
37 auto res = this->memoryWriter().commit(commit);
38
39 return res.allSuccess();
40 }
41
42 std::string
44 {
45 return "classWriter.";
46 }
47
50 {
52 p.memoryName = "Object";
53 p.coreSegmentName = "Class";
54 p.providerName = providerName;
55 return p;
56 }
57
58} // namespace armarx::armem::obj::clazz
constexpr T c
std::string coreSegmentName
Definition MemoryID.h:51
std::string entityName
Definition MemoryID.h:53
std::string memoryName
Definition MemoryID.h:50
std::string providerSegmentName
Definition MemoryID.h:52
CommitResult commit(const Commit &commit) const
Writes a Commit to the memory.
Definition Writer.cpp:68
bool commitObjectClass(const armarx::armem::clazz::ObjectClass &c, const armarx::core::time::DateTime &referenceTime)
Properties defaultProperties() const final
void setProviderName(const std::string &pName)
std::string propertyPrefix() const final
Represents a point in time.
Definition DateTime.h:25
static DateTime Now()
Definition DateTime.cpp:51
void toAron(armarx::armem::arondto::Feature &dto, const Feature &bo)
A bundle of updates to be sent to the memory.
Definition Commit.h:90