6 #ifndef __DDS__TopoContainer__ 7 #define __DDS__TopoContainer__ 18 namespace topology_api
23 typedef std::shared_ptr<CTopoContainer>
Ptr_t;
47 template <
class Object_t>
48 typename Object_t::Ptr_t
addElement(
const std::string& _name);
52 virtual std::string
toString()
const;
80 template <
class Object_t>
81 typename Object_t::Ptr_t
makeElement(
const std::string& _name)
83 auto element{ std::make_shared<Object_t>(_name) };
84 element->setParent(
this);
85 m_elements.push_back(element);
size_t getNofTasksDefault() const
Default implementation for TopoElement::getNofTasks, TopoElement::getTotalNofTasks....
Definition: TopoContainer.cpp:106
size_t getNofElements() const
Return number of elements.
Definition: TopoContainer.cpp:32
friend std::ostream & operator<<(std::ostream &_strm, const CTopoContainer &_taskContainer)
Operator << for convenient output to ostream.
CTopoElement::Ptr_t addElement(CTopoBase::EType _type, const std::string &_name)
Adds TopoElement to a container using enum type.
Definition: TopoContainer.cpp:73
CTopoContainer(const std::string &_name)
Constructor.
Definition: TopoContainer.cpp:23
bool canAddElement(CTopoBase::EType _type)
Checks if element can be added to the container. TopoTask can be added to any container (TopoCollecti...
Definition: TopoContainer.cpp:88
Definition: TopoElement.h:18
EType
Definition: TopoBase.h:23
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
std::shared_ptr< CTopoElement > Ptr_t
Definition: TopoElement.h:21
const CTopoElement::PtrVector_t & getElements() const
Return vector of elements.
Definition: TopoContainer.cpp:44
std::shared_ptr< CTopoContainer > Ptr_t
Definition: TopoContainer.h:23
Definition: TopoContainer.h:20
Object_t::Ptr_t makeElement(const std::string &_name)
Makes new topology element.
Definition: TopoContainer.h:81
CTopoElement::Ptr_t getElement(size_t _i) const
Return topology element by index.
Definition: TopoContainer.cpp:37
virtual ~CTopoContainer()
Destructor.
Definition: TopoContainer.cpp:28
std::vector< CTopoElement::Ptr_t > PtrVector_t
Definition: TopoElement.h:22
std::vector< CTopoContainer::Ptr_t > PtrVector_t
Definition: TopoContainer.h:24
virtual std::string toString() const
Returns string representation of an object.
Definition: TopoContainer.cpp:117