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
26
#include <
RobotAPI/libraries/armem/client/query/Builder.h
>
27
#include <
RobotAPI/libraries/armem/client/util/SimpleReaderBase.h
>
28
#include <
RobotAPI/libraries/armem/core/Time.h
>
29
30
#include <
armarx/navigation/rooms/types.h
>
31
32
namespace
armarx::navigation::memory::client::rooms
33
{
34
35
class
Reader
:
virtual
public
armarx::armem::client::util::SimpleReaderBase
36
{
37
public
:
38
using
armarx::armem::client::util::SimpleReaderBase::SimpleReaderBase
;
39
~Reader
()
override
;
40
41
struct
Query
42
{
43
std::string
providerName
;
44
std::string
name
;
// this is the room name
45
armem::Time
timestamp
;
46
};
47
48
struct
Result
49
{
50
std::optional<armarx::navigation::rooms::Room>
room
= std::nullopt;
51
52
enum
Status
53
{
54
Success
,
55
NoData
,
56
Error
57
}
status
;
58
59
std::string
errorMessage
=
""
;
60
61
operator
bool() const noexcept
62
{
63
return
status
== Status::Success;
64
}
65
};
66
67
Result
query
(
const
Query&
query
)
const
;
68
69
::armarx::armem::client::query::Builder
buildQuery
(
const
Query&
query
)
const
;
70
71
protected
:
72
std::string
propertyPrefix
()
const override
;
73
Properties
defaultProperties
()
const override
;
74
};
75
76
}
// namespace armarx::navigation::memory::client::rooms
armarx::navigation::memory::client::rooms::Reader::~Reader
~Reader() override
armarx::navigation::memory::client::rooms::Reader::Result::Success
@ Success
Definition:
Reader.h:54
armarx::navigation::memory::client::rooms
Definition:
Reader.cpp:23
armarx::navigation::memory::client::rooms::Reader::Result::status
enum armarx::navigation::memory::client::rooms::Reader::Result::Status status
armarx::navigation::memory::client::rooms::Reader::Result
Definition:
Reader.h:48
armarx::navigation::memory::client::rooms::Reader::Query::providerName
std::string providerName
Definition:
Reader.h:43
armarx::navigation::memory::client::rooms::Reader::Query
Definition:
Reader.h:41
armarx::navigation::memory::client::rooms::Reader::Result::Error
@ Error
Definition:
Reader.h:56
armarx::navigation::memory::client::rooms::Reader::Result::Status
Status
Definition:
Reader.h:52
armarx::navigation::memory::client::rooms::Reader::buildQuery
::armarx::armem::client::query::Builder buildQuery(const Query &query) const
Definition:
Reader.cpp:28
armarx::navigation::memory::client::rooms::Reader::defaultProperties
Properties defaultProperties() const override
Definition:
Reader.cpp:50
armarx::navigation::memory::client::rooms::Reader
Definition:
Reader.h:35
armarx::status
status
Definition:
FiniteStateMachine.h:259
armarx::navigation::memory::client::rooms::Reader::Result::room
std::optional< armarx::navigation::rooms::Room > room
Definition:
Reader.h:50
armarx::navigation::memory::client::rooms::Reader::Result::errorMessage
std::string errorMessage
Definition:
Reader.h:59
armarx::navigation::memory::client::rooms::Reader::Query::timestamp
armem::Time timestamp
Definition:
Reader.h:45
armarx::navigation::memory::client::rooms::Reader::Result::NoData
@ NoData
Definition:
Reader.h:55
armarx::core::time::DateTime
Represents a point in time.
Definition:
DateTime.h:24
types.h
Time.h
Builder.h
armarx::armem::client::util::SimpleReaderBase::SimpleReaderBase
SimpleReaderBase()
Definition:
SimpleReaderBase.cpp:9
armarx::armem::client::query::Builder
The query::Builder class provides a fluent-style specification of hierarchical queries.
Definition:
Builder.h:22
SimpleReaderBase.h
armarx::navigation::memory::client::rooms::Reader::query
Result query(const Query &query) const
Definition:
Reader.cpp:85
armarx::armem::client::util::SimpleReaderBase
Definition:
SimpleReaderBase.h:38
armarx::navigation::memory::client::rooms::Reader::Query::name
std::string name
Definition:
Reader.h:44
armarx::navigation::memory::client::rooms::Reader::propertyPrefix
std::string propertyPrefix() const override
Definition:
Reader.cpp:44
armarx
navigation
memory
client
rooms
Reader.h
Generated on Sat Oct 12 2024 09:14:08 for armarx_documentation by
1.8.17