|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
9 #ifndef YARP_MANAGER_MODULE_H
10 #define YARP_MANAGER_MODULE_H
27 Author(
const char* name,
const char* email) {
28 if(name) { strName = name;}
29 if(email) { strEmail = email; }
33 void setName(
const char* name) {
if(name) { strName = name; } }
34 void setEmail(
const char* email) {
if(email) { strEmail = email; } }
35 const char*
getName() {
return strName.c_str(); }
36 const char*
getEmail() {
return strEmail.c_str(); }
39 return (strName == alt.strName);
53 Argument(
const char* szParam,
bool required=
false,
54 const char* szDesc=
nullptr,
bool _switch=
false) {
55 if(szParam) { strParam = szParam; }
56 if(szDesc) { strDesc = szDesc; }
59 if(bSwitch) { strDefault =
"off"; }
60 strValue = strDefault;
64 void setParam(
const char* szParam) {
if(szParam) { strParam = szParam; } }
65 void setDefault(
const char* szDefault) {
if(szDefault) { strDefault = szDefault; } }
66 void setValue(
const char* szValue) {
if(szValue) { strValue = szValue; } }
68 const char*
getParam() {
return strParam.c_str(); }
69 const char*
getValue() {
return strValue.c_str(); }
74 return (strParam == alt.strParam);
82 std::string strDefault;
107 Module(
const char* szName);
113 void setName(
const char* szName) {
if(szName) { strName = szName; } }
115 void setVersion(
const char* szVersion) {
if(szVersion) { strVersion = szVersion; } }
116 void setDescription(
const char* szDesc) {
if(szDesc) { strDescription = szDesc; } }
117 void setHost(
const char* szHost) {
if(szHost) { strHost = szHost; } }
121 void setXmlFile(
const char* szFilename) {
if(szFilename) { strXmlFile = szFilename;} }
122 void setWorkDir(
const char* szWDir) {
if(szWDir) { strWorkDir = szWDir; } }
123 void setStdio(
const char* szStdio) {
if(szStdio) { strStdio = szStdio; } }
124 void setBroker(
const char* szBroker) {
if(szBroker) { strBroker = szBroker; } }
125 void setPrefix(
const char* szPrefix) {
if(szPrefix) { strPrefix = szPrefix; } }
127 void setBasePrefix(
const char* szPrefix) {
if(szPrefix) { strBasePrefix = szPrefix; } }
129 void setDisplay(
const char* szDisplay) {
if(szDisplay) { strDisplay = szDisplay; } }
132 const char*
getName() {
return strName.c_str(); }
135 const char*
getHost() {
return strHost.c_str(); }
139 const char*
getParam() {
return strParam.c_str(); }
142 const char*
getStdio() {
return strStdio.c_str(); }
201 std::string strVersion;
202 std::string strDescription;
212 std::string strParam;
213 std::string strXmlFile;
214 std::string strWorkDir;
215 std::string strStdio;
216 std::string strBroker;
218 std::string strPrefix;
219 std::string strEnvironment;
220 std::string strBasePrefix;
223 std::string strDisplay;
230 void swap(
const Module &mod);
231 bool getParamValue(
const char* key,
bool bSwitch, std::string ¶m);
238 #define PRINT_MODULE(m)\
240 cout<<"Name : "<<m->getName()<<endl;\
241 cout<<"Desc : "<<m->getDescription()<<endl;\
242 cout<<"Version : "<<m->getVersion()<<endl;\
243 cout<<"Rank : "<<m->getRank()<<endl;\
244 cout<<"Param : "<<endl;\
245 for(int i=0; i<m->argumentCount(); i++)\
247 cout<<" "<<m->getArgumentAt(i).getParam()<<" (";\
248 cout<<m->getArgumentAt(i).getDescription()<<")"<<endl;\
250 cout<<"Authors : "<<endl;\
251 for(int i=0; i<m->authorCount(); i++)\
252 cout<<" "<<m->getAuthorAt(i).getName()<<" ("<<m->getAuthorAt(i).getEmail()<<")"<<endl;\
257 cout<<"Inputs : "<<endl;\
258 for(int i=0; i<m->inputCount(); i++)\
260 cout<<" "<<m->getInputAt(i).getName()\
261 <<", "<<m->getInputAt(i).getPort();\
262 if(m->getInputAt(i).isRequired())\
263 cout<<", [REQUIRED]";\
264 if(m->getInputAt(i).withPriority())\
265 cout<<", [PRIORITY]";\
268 cout<<"Outputs : "<<endl;\
269 for(int i=0; i<m->outputCount(); i++)\
270 cout<<" "<<m->getOutputAt(i).getName()\
271 <<", "<<m->getOutputAt(i).getPort()<<endl;\
279 #endif // YARP_MANAGER_MODULE
void setXmlFile(const char *szFilename)
void setName(const char *name)
std::vector< InputData >::iterator InputIterator
const char * getVersion()
void setBroker(const char *szBroker)
Module & operator=(const Module &rhs)
void setWorkDir(const char *szWDir)
InputData & getInputAt(int index)
void setDescription(const char *szDesc)
void setEmail(const char *email)
Argument & getArgumentAt(int index)
void setOwner(Node *owner)
void setParam(const char *szParam)
const char * getDisplay()
std::vector< GenericResource * > ResourcePContainer
void setName(const char *szName)
void setPostStopWait(double t)
std::vector< Argument >::iterator ArgumentIterator
void setForced(bool flag)
bool addResource(GenericResource &res)
std::vector< Module * >::iterator ModulePIterator
GenericResource & getResourceAt(int index) const
bool removeAuthor(Author &author)
void setModelBase(GraphicModel &mdl)
bool removeArgument(Argument &argument)
GraphicModel & getModelBase()
std::vector< Author > AuthorContainer
void setBasePrefix(const char *szPrefix)
bool addInput(InputData &input)
std::vector< InputData > InputContainer
std::vector< OutputData > OutputContainer
void setVersion(const char *szVersion)
void setDisplay(const char *szDisplay)
Argument(const char *szParam, bool required=false, const char *szDesc=nullptr, bool _switch=false)
const char * getWorkDir()
int resourceCount() const
void addAuthor(Author &author)
bool removeOutput(OutputData &output)
bool operator==(const Argument &alt) const
void setStdio(const char *szStdio)
void setValue(const char *szValue)
bool operator==(const Author &alt) const
const char * getXmlFile()
void setDefault(const char *szDefault)
const char * getDefault()
bool removeInput(InputData &input)
bool setParam(const char *szParam)
std::vector< Argument > ArgumentContainer
void setPostExecWait(double t)
void setEnvironment(const char *szEnv)
bool removeResource(GenericResource &res)
OutputData & getOutputAt(int index)
std::vector< GenericResource * >::iterator ResourcePIterator
The main, catch-all namespace for YARP.
void setNeedDeployer(bool need)
void setHost(const char *szHost)
bool addOutput(OutputData &output)
std::vector< Module * > ModulePContainer
const char * getBasePrefix()
const char * getDescription()
std::vector< Author >::iterator AuthorIterator
Author & getAuthorAt(int index)
bool addArgument(Argument &arg)
std::vector< OutputData >::iterator OutputIterator
Author(const char *name, const char *email)
const char * getDescription()
void setPrefix(const char *szPrefix)
const char * getEnvironment()