YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
data.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_MANAGER_DATA
7#define YARP_MANAGER_DATA
8
10#include <yarp/manager/node.h>
12#include <yarp/conf/api.h>
13
14
15namespace yarp::manager {
16
17
21class InputData : public Node{
22
23public:
24 InputData();
25 InputData(const char* szName);
26 InputData(const InputData &input);
27 ~InputData() override;
28 Node* clone() override;
29 void setName(const char* szName) {
30 if(szName){
31 strName = szName;
32 }
33 }
34 const char* getName() { return strName.c_str(); }
35 void setPort(const char* szPort) { if(szPort) { strPort = szPort; } }
36 const char* getPort() { return strPort.c_str(); }
37 void setCarrier(const char* szCr) { if(szCr) { carrier = szCr; } }
38 const char* getCarrier() { return carrier.c_str(); }
39 void setPriority(bool prio) { bWithPriority = prio; }
40 void setRequired(bool req) { bRequired = req; }
41 bool isRequired() { return bRequired; }
42 bool withPriority() { return bWithPriority; }
43 void setDescription(const char* szDesc) { if(szDesc) { strDescription = szDesc; } }
44 const char* getDescription() { return strDescription.c_str(); }
45 void setPortType(NodeType type) { portType = type; }
46 NodeType getPortType() { return portType; }
47 void setOwner(Node* owner) { modOwner = owner; }
48 Node* owner() { return modOwner; }
49
50 bool operator==(const InputData& input) const {
51 return (strName == input.strName);
52 }
53
54protected:
55
56private:
57 std::string strName;
58 std::string strPort;
59 std::string carrier;
60 std::string strDescription;
61 bool bWithPriority;
62 bool bRequired;
63 Node* modOwner;
64 NodeType portType;
65};
66
67
68class OutputData : public Node{
69
70public:
71 OutputData();
72 OutputData(const char* szName);
73 OutputData(const OutputData &input);
74 ~OutputData() override;
75 Node* clone() override;
76 void setName(const char* szName) {
77 if(szName){
78 strName = szName;
79 }
80 }
81 const char* getName() { return strName.c_str(); }
82 void setPort(const char* szPort) { if(szPort) { strPort = szPort; } }
83 const char* getPort() { return strPort.c_str(); }
84 void setCarrier(const char* szCr) { if(szCr) { carrier = szCr; } }
85 const char* getCarrier() { return carrier.c_str(); }
86 void setDescription(const char* szDesc) { if(szDesc) { strDescription = szDesc; } }
87 const char* getDescription() { return strDescription.c_str(); }
88 void setPortType(NodeType type) { portType = type; }
89 NodeType getPortType() { return portType; }
90
91 void setOwner(Node* owner) { modOwner = owner; }
92 Node* owner() { return modOwner; }
93
94
95 bool operator==(const OutputData& output) const {
96 return (strName == output.strName);
97 }
98
99protected:
100
101private:
102 std::string strName;
103 std::string strPort;
104 std::string carrier;
105 std::string strDescription;
106 Node* modOwner;
107 NodeType portType;
108};
109
110} // namespace yarp::manager
111
112
113#endif // __YARP_MANAGER_MODULE__
Class InputData.
Definition data.h:21
const char * getCarrier()
Definition data.h:38
const char * getName()
Definition data.h:34
void setPriority(bool prio)
Definition data.h:39
const char * getDescription()
Definition data.h:44
const char * getPort()
Definition data.h:36
void setDescription(const char *szDesc)
Definition data.h:43
void setRequired(bool req)
Definition data.h:40
void setName(const char *szName)
Definition data.h:29
void setPortType(NodeType type)
Definition data.h:45
Node * clone() override
Definition data.cpp:46
void setOwner(Node *owner)
Definition data.h:47
void setPort(const char *szPort)
Definition data.h:35
bool operator==(const InputData &input) const
Definition data.h:50
NodeType getPortType()
Definition data.h:46
void setCarrier(const char *szCr)
Definition data.h:37
InputData()
Class InputData.
Definition data.cpp:13
a Node of a Graph
Definition node.h:64
const char * getCarrier()
Definition data.h:85
NodeType getPortType()
Definition data.h:89
void setCarrier(const char *szCr)
Definition data.h:84
void setPortType(NodeType type)
Definition data.h:88
void setName(const char *szName)
Definition data.h:76
OutputData()
Class OutputData.
Definition data.cpp:58
void setOwner(Node *owner)
Definition data.h:91
Node * clone() override
Definition data.cpp:87
const char * getDescription()
Definition data.h:87
void setDescription(const char *szDesc)
Definition data.h:86
bool operator==(const OutputData &output) const
Definition data.h:95
void setPort(const char *szPort)
Definition data.h:82
const char * getPort()
Definition data.h:83
const char * getName()
Definition data.h:81
enum yarp::manager::__NodeType NodeType