knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
Perspective.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_PERSPECTIVE_H
7 #define KNOWROB_PERSPECTIVE_H
8 
9 #include <utility>
10 
11 #include "memory"
12 #include "map"
13 #include "string"
14 #include "knowrob/terms/IRIAtom.h"
15 
16 namespace knowrob {
21  class Perspective {
22  public:
27  explicit Perspective(std::string_view iri);
28 
33  explicit Perspective(IRIAtomPtr atom) : atom_(std::move(atom)) {}
34 
38  auto iri() const { return atom_->stringForm(); }
39 
43  auto atom() const { return atom_; }
44 
49  static std::shared_ptr<Perspective> getEgoPerspective();
50 
55  static bool isEgoPerspective(std::string_view iri);
56 
61  static std::shared_ptr<Perspective> get(std::string_view iri);
62 
63  protected:
64  static std::map<std::string_view, std::shared_ptr<Perspective>> perspectiveMap_;
66  };
67 
68  using PerspectivePtr = std::shared_ptr<Perspective>;
69 
70 } // knowrob
71 
72 #endif //KNOWROB_PERSPECTIVE_H
static std::shared_ptr< Perspective > get(std::string_view iri)
static bool isEgoPerspective(std::string_view iri)
static std::shared_ptr< Perspective > getEgoPerspective()
auto iri() const
Definition: Perspective.h:38
auto atom() const
Definition: Perspective.h:43
Perspective(IRIAtomPtr atom)
Definition: Perspective.h:33
static std::map< std::string_view, std::shared_ptr< Perspective > > perspectiveMap_
Definition: Perspective.h:64
Perspective(std::string_view iri)
std::shared_ptr< IRIAtom > IRIAtomPtr
Definition: IRIAtom.h:57
std::shared_ptr< Perspective > PerspectivePtr
Definition: Perspective.h:68