Writer.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 * @author Fabian Reister ( fabian dot reister at kit dot edu )
17 * @date 2021
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
24#include <mutex>
25
27
31
32// #include <RobotAPI/libraries/armem_robot_state/client/common/RobotReader.h>
33
35
37{
38
39 class Writer
40 {
41 public:
42 Writer(armem::client::MemoryNameSystem& memoryNameSystem);
43 virtual ~Writer() = default;
44
45
47 void connect();
48
49 std::optional<armem::MemoryID> commit(const ObjectAttachment& attachment);
50 std::optional<armem::MemoryID> commit(const ArticulatedObjectAttachment&);
51
52 private:
53 struct Properties
54 {
55 std::string memoryName = "Object";
56 std::string coreAttachmentsSegmentName = "Attachments";
57 std::string providerName = "AttachmentProvider";
58
59 bool allowClassCreation = false;
60 } properties;
61
62 const std::string propertyPrefix = "mem.obj.articulated.";
63
64 armem::client::MemoryNameSystem& memoryNameSystem;
65
66 armem::client::Writer memoryWriter;
67 std::mutex memoryWriterMutex;
68
69 armem::client::Reader memoryReader;
70 std::mutex memoryReaderMutex;
71 };
72
73
74} // namespace armarx::armem::attachment
std::optional< armem::MemoryID > commit(const ObjectAttachment &attachment)
Definition Writer.cpp:63
Writer(armem::client::MemoryNameSystem &memoryNameSystem)
Definition Writer.cpp:24
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
Definition Writer.cpp:30
The memory name system (MNS) client.
Reads data from a memory server.
Definition Reader.h:25
Helps a memory client sending data to a memory.
Definition Writer.h:23
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
ArticulatedObjectAttachment describes a fixed transformation between an agent and an articulated obje...
Definition types.h:122
ObjectAttachment describes a fixed transformation between an agent and an object.
Definition types.h:101