9 #include "NodeInfo.pb.h"
10 #include "Publisher.hh"
22 class Node :
public std::enable_shared_from_this<Node>
28 virtual void print()
const;
29 virtual void json(Json::Value & root);
53 void add(std::shared_ptr<Node> node)
56 node->parent(shared_from_this());
59 std::shared_ptr<Node>
find(std::string
name)
const;
65 void add(std::shared_ptr<Publisher> pPublisher) {
mPublishers.push_back(pPublisher); }
Node(std::string name="", std::string uuid="")
std::vector< std::shared_ptr< Publisher > > publishers() const
Returns publishers.
virtual void print() const
void name(std::string n)
Sets node name.
void removeByUUID(std::string uuid)
Remove node by uuid.
std::weak_ptr< Node > parent() const
Returns parent node.
std::vector< std::shared_ptr< Node > > nodes() const
Returns nodes.
void add(std::shared_ptr< Publisher > pPublisher)
Adds publisher to the node.
void uuid(std::string uuid)
Sets node uuid.
std::weak_ptr< Node > mpParent
Parent node.
void hostname(std::string h)
Sets node hostname.
std::vector< std::shared_ptr< Node > > mChildNodes
List of nodes.
void add(std::shared_ptr< Node > node)
Adds node to the list of nodes.
virtual void json(Json::Value &root)
std::string uuid() const
Returns node UUID.
std::shared_ptr< Node > find(std::string name) const
Find node by name.
NodeInfo * nodeInfo() const
Returns Node Info.
std::string hostname() const
Returns node hostname.
NodeInfo * mpNodeInfo
Node Info.
std::vector< std::shared_ptr< Publisher > > mPublishers
List of publishers.
void parent(std::weak_ptr< Node > node)
Sets parent.
std::string name() const
Returns node name.