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 <string>
25 
27 
31 
33 
35 {
36 
38  {
39  public:
41  ~Reader() override;
42 
43  struct Query
44  {
45  std::string providerName;
48  };
49 
50  struct HumanResult
51  {
53 
54  enum Status
55  {
59  } status;
60 
61  std::string errorMessage = "";
62 
63  operator bool() const noexcept
64  {
65  return status == Status::Success;
66  }
67  };
68 
70  {
72 
73  enum Status
74  {
78  } status;
79 
80  std::string errorMessage = "";
81 
82  operator bool() const noexcept
83  {
84  return status == Status::Success;
85  }
86  };
87 
88  HumanResult queryHumans(const Query& query) const;
89  HumanGroupResult queryHumanGroups(const Query& query) const;
90 
91  protected:
94 
95  std::string propertyPrefix() const override;
96  Properties defaultProperties() const override;
97  };
98 
99 } // namespace armarx::navigation::memory::client::human
armarx::navigation::memory::client::human::Reader::propertyPrefix
std::string propertyPrefix() const override
Definition: Reader.cpp:60
armarx::navigation::memory::client::human::Reader::Query
Definition: Reader.h:43
armarx::navigation::memory::client::human::Reader::HumanGroupResult::NoData
@ NoData
Definition: Reader.h:76
armarx::navigation::memory::client::human::Reader
Definition: Reader.h:37
armarx::navigation::memory::client::human
Definition: Reader.cpp:23
forward_declarations.h
armarx::navigation::memory::client::human::Reader::HumanResult::NoData
@ NoData
Definition: Reader.h:57
armarx::navigation::memory::client::human::Reader::Query::providerName
std::string providerName
Definition: Reader.h:45
armarx::navigation::memory::client::human::Reader::HumanResult
Definition: Reader.h:50
Duration.h
armarx::navigation::memory::client::human::Reader::HumanGroupResult
Definition: Reader.h:69
types.h
armarx::navigation::memory::client::human::Reader::defaultProperties
Properties defaultProperties() const override
Definition: Reader.cpp:66
armarx::navigation::human::Humans
std::vector< Human > Humans
Definition: types.h:48
armarx::navigation::memory::client::human::Reader::HumanGroupResult::errorMessage
std::string errorMessage
Definition: Reader.h:80
armarx::navigation::memory::client::human::Reader::queryHumans
HumanResult queryHumans(const Query &query) const
Definition: Reader.cpp:204
armarx::status
status
Definition: FiniteStateMachine.h:244
armarx::navigation::memory::client::human::Reader::HumanResult::Status
Status
Definition: Reader.h:54
armarx::navigation::memory::client::human::Reader::HumanGroupResult::status
enum armarx::navigation::memory::client::human::Reader::HumanGroupResult::Status status
armarx::navigation::memory::client::human::Reader::HumanGroupResult::groups
armarx::navigation::human::HumanGroups groups
Definition: Reader.h:71
armarx::navigation::memory::client::human::Reader::HumanGroupResult::Error
@ Error
Definition: Reader.h:77
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::navigation::memory::client::human::Reader::HumanResult::humans
armarx::navigation::human::Humans humans
Definition: Reader.h:52
armarx::navigation::memory::client::human::Reader::buildHumanGroupsQuery
::armarx::armem::client::query::Builder buildHumanGroupsQuery(const Query &query) const
Definition: Reader.cpp:44
armarx::core::time::Duration
Represents a duration.
Definition: Duration.h:16
Builder.h
armarx::armem::client::util::SimpleReaderBase::SimpleReaderBase
SimpleReaderBase()
Definition: SimpleReaderBase.cpp:9
armarx::navigation::memory::client::human::Reader::HumanResult::errorMessage
std::string errorMessage
Definition: Reader.h:61
armarx::navigation::memory::client::human::Reader::~Reader
~Reader() override
armarx::armem::client::query::Builder
The query::Builder class provides a fluent-style specification of hierarchical queries.
Definition: Builder.h:21
armarx::navigation::memory::client::human::Reader::HumanResult::Error
@ Error
Definition: Reader.h:58
armarx::navigation::memory::client::human::Reader::HumanGroupResult::Status
Status
Definition: Reader.h:73
armarx::navigation::memory::client::human::Reader::HumanResult::Success
@ Success
Definition: Reader.h:56
armarx::navigation::memory::client::human::Reader::buildHumansQuery
::armarx::armem::client::query::Builder buildHumansQuery(const Query &query) const
Definition: Reader.cpp:28
SimpleReaderBase.h
armarx::navigation::memory::client::human::Reader::queryHumanGroups
HumanGroupResult queryHumanGroups(const Query &query) const
Definition: Reader.cpp:152
armarx::armem::client::util::SimpleReaderBase
Definition: SimpleReaderBase.h:38
armarx::navigation::human::HumanGroups
std::vector< HumanGroup > HumanGroups
Definition: types.h:60
armarx::navigation::memory::client::human::Reader::HumanGroupResult::Success
@ Success
Definition: Reader.h:75
armarx::navigation::memory::client::human::Reader::Query::timestamp
armem::Time timestamp
Definition: Reader.h:46
armarx::navigation::memory::client::human::Reader::HumanResult::status
enum armarx::navigation::memory::client::human::Reader::HumanResult::Status status
armarx::navigation::memory::client::human::Reader::Query::maxAge
Duration maxAge
Definition: Reader.h:47