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 <cstdint>
25#include <string>
26#include <vector>
27
29
35
36namespace armarx
37{
38 class ManagedIceObject;
39}
40
42{
43
44 struct TimeRange
45 {
48 };
49
50 /**
51 * @defgroup Component-ExampleClient ExampleClient
52 * @ingroup RobotAPI-Components
53 * A description of the component ExampleClient.
54 *
55 * @class ExampleClient
56 * @ingroup Component-ExampleClient
57 * @brief Brief description of class ExampleClient.
58 *
59 * Detailed description of class ExampleClient.
60 */
61 class Reader
62 {
63 public:
64 Reader();
65 virtual ~Reader();
66
67 void connect(armem::client::MemoryNameSystem& memoryNameSystem);
68
69 struct Query
70 {
71 std::string agent;
72
73 // if not provided, only latest is queried
74 std::optional<TimeRange> timeRange;
75
76 // if empty, all sensors will be queried
77 std::vector<std::string> sensorList;
78 };
79
80 struct Result
81 {
82
83 std::vector<LaserScanStamped> laserScans;
84
85 std::set<std::string> sensors;
86
92
93 std::string errorMessage;
94 };
95
96 Result queryData(const Query& query) const;
97
99
101
102 private:
103 armem::client::Reader memoryReader;
104
105 // Properties
106 struct Properties
107 {
108 } properties;
109
110 const std::string propertyPrefix = "mem.vision.laser_scans.";
111 };
112
113} // namespace armarx::armem::laser_scans::client
The ManagedIceObject is the base class for all ArmarX objects.
The memory name system (MNS) client.
Reads data from a memory server.
Definition Reader.h:25
The query::Builder class provides a fluent-style specification of hierarchical queries.
Definition Builder.h:22
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
Definition Reader.cpp:48
armarx::armem::client::query::Builder buildQuery(const Query &query) const
Definition Reader.cpp:68
Result queryData(const Query &query) const
Definition Reader.cpp:168
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
Definition Reader.cpp:40
armarx::core::time::DateTime Time
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::vector< std::string > sensorList
Definition Reader.h:77
std::vector< LaserScanStamped > laserScans
Definition Reader.h:83