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 
30 
32 {
33 
35  {
36  public:
38  ~Reader() override;
39 
40  struct Query
41  {
42  std::string providerName;
43  std::string name; // this is the entity name
45  };
46 
47  struct Result
48  {
49  std::optional<algorithms::Costmap> costmap = std::nullopt;
50 
51  enum Status
52  {
56  } status;
57 
58  std::string errorMessage = "";
59 
60  operator bool() const noexcept
61  {
62  return status == Status::Success;
63  }
64  };
65 
66  Result query(const Query& query) const;
67 
69 
70  protected:
71  std::string propertyPrefix() const override;
72  Properties defaultProperties() const override;
73  };
74 
75 } // namespace armarx::navigation::memory::client::costmap
armarx::navigation::memory::client::costmap::Reader::buildQuery
::armarx::armem::client::query::Builder buildQuery(const Query &query) const
Definition: Reader.cpp:28
armarx::navigation::memory::client::costmap::Reader::Query::timestamp
armem::Time timestamp
Definition: Reader.h:44
armarx::navigation::memory::client::costmap::Reader::~Reader
~Reader() override
armarx::navigation::memory::client::costmap
Definition: Reader.cpp:23
armarx::navigation::memory::client::costmap::Reader::propertyPrefix
std::string propertyPrefix() const override
Definition: Reader.cpp:44
armarx::navigation::memory::client::costmap::Reader::Query::name
std::string name
Definition: Reader.h:43
armarx::navigation::memory::client::costmap::Reader::Result::NoData
@ NoData
Definition: Reader.h:54
armarx::navigation::memory::client::costmap::Reader::Result::errorMessage
std::string errorMessage
Definition: Reader.h:58
armarx::navigation::memory::client::costmap::Reader::query
Result query(const Query &query) const
Definition: Reader.cpp:77
armarx::navigation::memory::client::costmap::Reader::Query::providerName
std::string providerName
Definition: Reader.h:42
Costmap.h
armarx::status
status
Definition: FiniteStateMachine.h:259
armarx::navigation::memory::client::costmap::Reader
Definition: Reader.h:34
armarx::navigation::memory::client::costmap::Reader::Result::costmap
std::optional< algorithms::Costmap > costmap
Definition: Reader.h:49
armarx::navigation::memory::client::costmap::Reader::Result::Error
@ Error
Definition: Reader.h:55
armarx::navigation::memory::client::costmap::Reader::Result::status
enum armarx::navigation::memory::client::costmap::Reader::Result::Status status
armarx::navigation::memory::client::costmap::Reader::Query
Definition: Reader.h:40
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::navigation::memory::client::costmap::Reader::Result
Definition: Reader.h:47
armarx::navigation::memory::client::costmap::Reader::defaultProperties
Properties defaultProperties() const override
Definition: Reader.cpp:50
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
armarx::navigation::memory::client::costmap::Reader::Result::Status
Status
Definition: Reader.h:51
SimpleReaderBase.h
armarx::armem::client::util::SimpleReaderBase
Definition: SimpleReaderBase.h:38
armarx::navigation::memory::client::costmap::Reader::Result::Success
@ Success
Definition: Reader.h:53