DDS  ver. 3.5.3.8.g5fe284b
TopoRequirement.h
Go to the documentation of this file.
1 // Copyright 2014 GSI, Inc. All rights reserved.
2 //
3 //
4 //
5 
6 #ifndef __DDS__TopoRequirement__
7 #define __DDS__TopoRequirement__
8 
9 // DDS
10 #include "TopoBase.h"
11 // STD
12 #include <string>
13 
14 namespace dds
15 {
16  namespace topology_api
17  {
20  class CTopoRequirement : public CTopoBase
21  {
22  public:
23  enum class EType
24  {
25  WnName,
26  HostName,
27  Gpu,
29  };
30 
31  using Ptr_t = std::shared_ptr<CTopoRequirement>;
32  using PtrVector_t = std::vector<CTopoRequirement::Ptr_t>;
33 
35  CTopoRequirement(const std::string& _name);
36 
38  virtual ~CTopoRequirement();
39 
41  void initFromPropertyTree(const boost::property_tree::ptree& _pt);
42 
44  void saveToPropertyTree(boost::property_tree::ptree& _pt);
45 
46  const std::string& getValue() const;
48 
49  void setValue(const std::string& _value);
50  void setRequirementType(CTopoRequirement::EType _requireemntType);
51 
54  virtual std::string toString() const;
55 
59  friend std::ostream& operator<<(std::ostream& _strm, const CTopoRequirement& _requirement);
60 
62  virtual std::string hashString() const;
63 
64  private:
65  std::string m_value;
67  };
68  } // namespace topology_api
69 } // namespace dds
70 
71 #endif /* defined(__DDS__TopoRequirement__) */
virtual std::string hashString() const
Inherited from TopoBase.
Definition: TopoRequirement.cpp:92
EType
Definition: TopoRequirement.h:23
Definition: TopoBase.h:20
const std::string & getValue() const
Definition: TopoRequirement.cpp:28
CTopoRequirement::EType getRequirementType() const
Definition: TopoRequirement.cpp:33
std::shared_ptr< CTopoBase > Ptr_t
Definition: TopoBase.h:36
CTopoRequirement(const std::string &_name)
Constructor.
Definition: TopoRequirement.cpp:18
void setValue(const std::string &_value)
Definition: TopoRequirement.cpp:38
void saveToPropertyTree(boost::property_tree::ptree &_pt)
Inherited from TopoBase.
Definition: TopoRequirement.cpp:63
EType
Definition: TopoBase.h:23
virtual ~CTopoRequirement()
Destructor.
Definition: TopoRequirement.cpp:24
Definition: AgentConnectionManager.h:13
std::vector< CTopoBase::Ptr_t > PtrVector_t
Definition: TopoBase.h:37
void setRequirementType(CTopoRequirement::EType _requireemntType)
Definition: TopoRequirement.cpp:43
void initFromPropertyTree(const boost::property_tree::ptree &_pt)
Inherited from TopoBase.
Definition: TopoRequirement.cpp:48
friend std::ostream & operator<<(std::ostream &_strm, const CTopoRequirement &_requirement)
Operator << for convenient output to ostream.
virtual std::string toString() const
Returns string representation of an object.
Definition: TopoRequirement.cpp:78
Definition: TopoRequirement.h:20