Reader.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#include <optional>
26
28
32
34{
35 class Reader
36 {
37 public:
38 Reader(armem::client::MemoryNameSystem& memoryNameSystem);
39 virtual ~Reader() = default;
40
42 void connect();
43
44 std::vector<ObjectAttachment> queryObjectAttachments(const armem::Time& timestamp) const;
45 std::vector<ObjectAttachment> queryObjectAttachments(const armem::Time& timestamp,
46 const std::string& providerName) const;
47
48 std::vector<ArticulatedObjectAttachment>
50 std::vector<ArticulatedObjectAttachment>
52 const std::string& providerName) const;
53
54 private:
55 struct Properties
56 {
57 std::string memoryName = "Object";
58 std::string coreAttachmentsSegmentName = "Attachments";
59 } properties;
60
61 const std::string propertyPrefix = "mem.obj.attachment.";
62
63 armem::client::MemoryNameSystem& memoryNameSystem;
64 armem::client::Reader memoryReader;
65 std::mutex memoryWriterMutex;
66 };
67
68
69} // namespace armarx::armem::attachment
std::string timestamp()
Reader(armem::client::MemoryNameSystem &memoryNameSystem)
Definition Reader.cpp:70
std::vector< ObjectAttachment > queryObjectAttachments(const armem::Time &timestamp) const
Definition Reader.cpp:107
std::vector< ArticulatedObjectAttachment > queryArticulatedObjectAttachments(const armem::Time &timestamp) const
Definition Reader.cpp:162
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
Definition Reader.cpp:76
The memory name system (MNS) client.
Reads data from a memory server.
Definition Reader.h:25
armarx::core::time::DateTime Time
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.