Writer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <RobotAPI/interface/armem/server/WritingMemoryInterface.h>
4 
6 
7 
8 namespace armarx::armem::client
9 {
10 
24  class Writer
25  {
26  public:
27 
32  Writer(server::WritingMemoryInterfacePrx memory = nullptr);
33 
34 
35  data::AddSegmentResult addSegment(const std::string& coreSegmentName, const std::string& providerSegmentName, bool clearWhenExists = false);
36  data::AddSegmentResult addSegment(const MemoryID& providerSegmentID, bool clearWhenExists = false);
37  data::AddSegmentResult addSegment(const std::pair<std::string, std::string>& names, bool clearWhenExists = false);
38  data::AddSegmentResult addSegment(const data::AddSegmentInput& input);
39  data::AddSegmentsResult addSegments(const data::AddSegmentsInput& input);
40 
41 
47  EntityUpdateResult commit(const EntityUpdate& update);
50  const MemoryID& entityID,
51  const std::vector<aron::data::DictPtr>& instancesData,
52  Time timeCreated);
53 
54  // with bare-ice types
55  data::CommitResult commit(const data::Commit& commit);
56 
57 
58  void setWritingMemory(server::WritingMemoryInterfacePrx memory);
59 
60  operator bool() const
61  {
62  return bool(memory);
63  }
64 
65  private:
66 
68  data::CommitResult _commit(data::Commit& commit);
69 
70 
71  public:
72 
73  server::WritingMemoryInterfacePrx memory;
74 
75  };
76 
77 }
78 
80 {
81  std::ostream& operator<<(std::ostream& os, const AddSegmentInput& rhs);
82  std::ostream& operator<<(std::ostream& os, const AddSegmentsInput& rhs);
83  std::ostream& operator<<(std::ostream& os, const AddSegmentResult& rhs);
84  std::ostream& operator<<(std::ostream& os, const AddSegmentsResult& rhs);
85 }
armarx::armem::Commit
A bundle of updates to be sent to the memory.
Definition: Commit.h:89
armarx::armem::EntityUpdateResult
Result of an EntityUpdate.
Definition: Commit.h:72
armarx::armem::client::Writer::setWritingMemory
void setWritingMemory(server::WritingMemoryInterfacePrx memory)
Definition: Writer.cpp:97
armarx::armem::client::Writer::addSegment
data::AddSegmentResult addSegment(const std::string &coreSegmentName, const std::string &providerSegmentName, bool clearWhenExists=false)
Definition: Writer.cpp:16
armarx::armem::client
Definition: forward_declarations.h:7
armarx::armem::data::operator<<
std::ostream & operator<<(std::ostream &os, const AddSegmentInput &rhs)
Definition: Writer.cpp:155
armarx::armem::client::Writer::commit
CommitResult commit(const Commit &commit)
Writes a Commit to the memory.
Definition: Writer.cpp:51
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:48
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:16
armarx::armem::EntityUpdate
An update of an entity for a specific point in time.
Definition: Commit.h:27
armarx::armem::CommitResult
Result of a Commit.
Definition: Commit.h:110
armarx::armem::client::Writer
Helps a memory client sending data to a memory.
Definition: Writer.h:24
armarx::armem::client::Writer::Writer
Writer(server::WritingMemoryInterfacePrx memory=nullptr)
Construct a memory writer.
Definition: Writer.cpp:12
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::viz::data::ElementFlags::names
const simox::meta::IntEnumNames names
Definition: json_elements.cpp:14
armarx::armem::client::Writer::addSegments
data::AddSegmentsResult addSegments(const data::AddSegmentsInput &input)
Definition: Writer.cpp:42
armarx::armem::data
Definition: Writer.h:79
ice_conversions.h
armarx::armem::client::Writer::memory
server::WritingMemoryInterfacePrx memory
Definition: Writer.h:73