DDS  ver. 3.4
TopoProperty.h
Go to the documentation of this file.
1 // Copyright 2014 GSI, Inc. All rights reserved.
2 //
3 //
4 //
5 
6 #ifndef __DDS__TopoProperty__
7 #define __DDS__TopoProperty__
8 
9 // DDS
10 #include "TopoBase.h"
11 // STD
12 #include <map>
13 #include <sstream>
14 #include <string>
15 
16 namespace dds
17 {
18  namespace topology_api
19  {
22  class CTopoProperty : public CTopoBase
23  {
24  public:
25  enum class EAccessType
26  {
27  READ,
28  WRITE,
29  READWRITE
30  };
31 
32  enum class EScopeType
33  {
34  GLOBAL,
36  };
37 
38  using Ptr_t = std::shared_ptr<CTopoProperty>;
39  // Property ID --> Ptr
40  using PtrMap_t = std::map<std::string, CTopoProperty::Ptr_t>;
41 
43  CTopoProperty(const std::string& _name);
44 
46  virtual ~CTopoProperty();
47 
49  void initFromPropertyTree(const boost::property_tree::ptree& _pt);
50 
52  void saveToPropertyTree(boost::property_tree::ptree& _pt);
53 
54  const std::string& getValue() const;
55  void setValue(const std::string& _value);
57  void setAccessType(CTopoProperty::EAccessType _accessType);
59  void setScopeType(CTopoProperty::EScopeType _scopeType);
60 
63  virtual std::string toString() const;
64 
68  friend std::ostream& operator<<(std::ostream& _strm, const CTopoProperty& _property);
69 
71  virtual std::string hashString() const;
72 
73  private:
74  std::string m_value;
77  };
78  } // namespace topology_api
79 } // namespace dds
80 #endif /* defined(__DDS__TopoProperty__) */
virtual std::string toString() const
Returns string representation of an object.
Definition: TopoProperty.cpp:90
Definition: TopoBase.h:20
CTopoProperty::EScopeType getScopeType() const
Definition: TopoProperty.cpp:47
friend std::ostream & operator<<(std::ostream &_strm, const CTopoProperty &_property)
Operator << for convenient output to ostream.
virtual ~CTopoProperty()
Destructor.
Definition: TopoProperty.cpp:23
EAccessType
Definition: TopoProperty.h:25
std::shared_ptr< CTopoBase > Ptr_t
Definition: TopoBase.h:36
virtual std::string hashString() const
Inherited from TopoBase.
Definition: TopoProperty.cpp:103
std::map< std::string, CTopoProperty::Ptr_t > PtrMap_t
Definition: TopoProperty.h:40
EScopeType
Definition: TopoProperty.h:32
const std::string & getValue() const
Definition: TopoProperty.cpp:27
Definition: AgentConnectionManager.h:13
Definition: TopoProperty.h:22
void setAccessType(CTopoProperty::EAccessType _accessType)
Definition: TopoProperty.cpp:42
void initFromPropertyTree(const boost::property_tree::ptree &_pt)
Inherited from TopoBase.
Definition: TopoProperty.cpp:57
CTopoProperty::EAccessType getAccessType() const
Definition: TopoProperty.cpp:32
void setScopeType(CTopoProperty::EScopeType _scopeType)
Definition: TopoProperty.cpp:52
void saveToPropertyTree(boost::property_tree::ptree &_pt)
Inherited from TopoBase.
Definition: TopoProperty.cpp:76
CTopoProperty(const std::string &_name)
Constructor.
Definition: TopoProperty.cpp:17
void setValue(const std::string &_value)
Definition: TopoProperty.cpp:37