DDS  ver. 3.6
TopoCollection.h
Go to the documentation of this file.
1 // Copyright 2014 GSI, Inc. All rights reserved.
2 //
3 //
4 //
5 
6 #ifndef __DDS__TopoCollection__
7 #define __DDS__TopoCollection__
8 
9 // DDS
10 #include "TopoContainer.h"
11 #include "TopoDef.h"
12 #include "TopoRequirement.h"
13 #include "TopoTask.h"
14 
15 namespace dds
16 {
17  namespace topology_api
18  {
20  {
21  public:
22  using Ptr_t = std::shared_ptr<CTopoCollection>;
23  using PtrVector_t = std::vector<CTopoCollection::Ptr_t>;
24 
26  CTopoCollection(const std::string& _name);
27 
29  virtual ~CTopoCollection();
30 
32  virtual size_t getNofTasks() const;
33 
35  virtual size_t getTotalNofTasks() const;
36 
38  void initFromPropertyTree(const boost::property_tree::ptree& _pt);
39 
41  void saveToPropertyTree(boost::property_tree::ptree& _pt);
42 
44  size_t getTotalCounter() const;
45 
46  size_t getNofRequirements() const;
48  CTopoRequirement::Ptr_t addRequirement(const std::string& _name);
49 
51  virtual std::string hashString() const;
52 
53  private:
54  CTopoRequirement::PtrVector_t m_requirements;
55  };
56 
58  {
59  typedef std::map<Id_t, STopoRuntimeCollection> Map_t;
60  typedef std::function<bool(std::pair<Id_t, const STopoRuntimeCollection&>)> Condition_t;
61  typedef boost::filter_iterator<STopoRuntimeCollection::Condition_t,
62  STopoRuntimeCollection::Map_t::const_iterator>
64  typedef std::pair<STopoRuntimeCollection::FilterIterator_t, STopoRuntimeCollection::FilterIterator_t>
66 
69  size_t m_collectionIndex{ 0 };
70  std::string m_collectionPath;
72  };
73  } // namespace topology_api
74 } // namespace dds
75 #endif /* defined(__DDS__TopoCollection__) */
std::shared_ptr< CTopoRequirement > Ptr_t
Definition: TopoRequirement.h:31
std::string m_collectionPath
Definition: TopoCollection.h:70
const CTopoRequirement::PtrVector_t & getRequirements() const
Definition: TopoCollection.cpp:46
size_t getTotalCounter() const
If parent is a group than return N, else return 1.
Definition: TopoCollection.cpp:36
STopoRuntimeTask::Map_t m_idToRuntimeTaskMap
Map of task ID to STopoRuntimeTask.
Definition: TopoCollection.h:71
boost::filter_iterator< STopoRuntimeCollection::Condition_t, STopoRuntimeCollection::Map_t::const_iterator > FilterIterator_t
Definition: TopoCollection.h:63
virtual ~CTopoCollection()
Destructor.
Definition: TopoCollection.cpp:22
std::map< Id_t, STopoRuntimeCollection > Map_t
Definition: TopoCollection.h:59
std::shared_ptr< CTopoBase > Ptr_t
Definition: TopoBase.h:36
std::pair< STopoRuntimeCollection::FilterIterator_t, STopoRuntimeCollection::FilterIterator_t > FilterIteratorPair_t
Definition: TopoCollection.h:65
std::shared_ptr< CTopoCollection > Ptr_t
Definition: TopoCollection.h:22
CTopoRequirement::Ptr_t addRequirement(const std::string &_name)
Definition: TopoCollection.cpp:51
uint64_t Id_t
Definition: TopoDef.h:15
std::map< Id_t, STopoRuntimeTask > Map_t
Definition: TopoTask.h:103
void initFromPropertyTree(const boost::property_tree::ptree &_pt)
Inherited from TopoElement.
Definition: TopoCollection.cpp:59
virtual size_t getTotalNofTasks() const
Inherited from TopoElement.
Definition: TopoCollection.cpp:31
void saveToPropertyTree(boost::property_tree::ptree &_pt)
Inherited from TopoBase.
Definition: TopoCollection.cpp:95
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
std::vector< CTopoBase::Ptr_t > PtrVector_t
Definition: TopoBase.h:37
virtual size_t getNofTasks() const
Inherited from TopoElement.
Definition: TopoCollection.cpp:26
Definition: TopoCollection.h:19
Definition: TopoContainer.h:20
size_t getNofRequirements() const
Definition: TopoCollection.cpp:41
CTopoCollection::Ptr_t m_collection
Definition: TopoCollection.h:67
virtual std::string hashString() const
Inherited from TopoBase.
Definition: TopoCollection.cpp:118
CTopoCollection(const std::string &_name)
Constructor.
Definition: TopoCollection.cpp:16
std::function< bool(std::pair< Id_t, const STopoRuntimeCollection & >)> Condition_t
Definition: TopoCollection.h:60
Definition: TopoCollection.h:57
size_t m_collectionIndex
Definition: TopoCollection.h:69
Id_t m_collectionId
Definition: TopoCollection.h:68
std::vector< CTopoRequirement::Ptr_t > PtrVector_t
Definition: TopoRequirement.h:32