YARP
Yet Another Robot Platform
xmlmodloader.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
10 #include <yarp/conf/filesystem.h>
11 #include <yarp/manager/utility.h>
12 #include <dirent.h>
17 
18 #include <algorithm>
19 #include <cctype>
20 #include <string>
21 #include <fstream>
22 
23 #include <tinyxml.h>
24 
25 
26 using namespace std;
27 using namespace yarp::manager;
28 
29 
30 XmlModLoader::XmlModLoader(const char* szPath, const char* szName)
31 {
32  parser = new(TextParser);
33  module.clear();
34 
35  if(strlen(szPath))
36  {
37  const std::string directorySeparator{yarp::conf::filesystem::preferred_separator};
38  strPath = szPath;
39  if((strPath.rfind(directorySeparator)==string::npos) ||
40  (strPath.rfind(directorySeparator)!=strPath.size()-1))
41  strPath = strPath + string(directorySeparator);
42  }
43 
44  if(szName)
45  strName = szName;
46 }
47 
51 XmlModLoader::XmlModLoader(const char* szFileName)
52 {
53  parser = new(TextParser);
54  module.clear();
55  if(szFileName)
56  strFileName = szFileName;
57 }
58 
59 
60 
61 XmlModLoader::~XmlModLoader()
62 {
63  if(parser)
64  {
65  delete parser;
66  }
67 }
68 
69 
70 bool XmlModLoader::init()
71 {
72  module.clear();
73  fileNames.clear();
74  ErrorLogger* logger = ErrorLogger::Instance();
75 
79  if(!strFileName.empty())
80  {
81  fileNames.push_back(strFileName);
82  return true;
83  }
84 
85  if(strPath.empty())
86  {
87  logger->addError("No module path is introduced.");
88  return false;
89  }
90 
91  DIR *dir;
92  struct dirent *entry;
93  if ((dir = opendir(strPath.c_str())) == nullptr)
94  {
95  OSTRINGSTREAM err;
96  err<<"Cannot access "<<strPath;
97  logger->addError(err);
98  return false;
99  }
100 
101  /* we need to load all xml modules */
102  while((entry = readdir(dir)))
103  {
104  string name = entry->d_name;
105  if(name.size() > 3)
106  {
107  string ext = name.substr(name.size()-3,3);
108  if(compareString(ext.c_str(), "xml"))
109  fileNames.push_back(strPath+name);
110  }
111  }
112  closedir(dir);
113 
114  /*
115  if(fileNames.empty())
116  {
117  OSTRINGSTREAM err;
118  err<<"No xml module file found in "<<strPath;
119  logger->addWarning(err);
120  //return true;
121  }
122  */
123  return true;
124 }
125 
126 
127 void XmlModLoader::reset()
128 {
129  fini();
130  init();
131 }
132 
133 
134 void XmlModLoader::fini()
135 {
136  fileNames.clear();
137  module.clear();
138 }
139 
140 
141 Module* XmlModLoader::getNextModule()
142 {
143  if(strName.empty())
144  {
145  Module* mod = nullptr;
146  while(!mod)
147  {
148  if(fileNames.empty())
149  return nullptr;
150 
151  string fname = fileNames.back();
152  fileNames.pop_back();
153  mod = parsXml(fname.c_str());
154  }
155  return mod;
156  }
157  else
158  {
162  vector<string>::iterator itr;
163  for(itr=fileNames.begin(); itr<fileNames.end(); itr++)
164  {
165  Module* mod = parsXml((*itr).c_str());
166  if(mod && (string(mod->getName())==strName))
167  return mod;
168  }
169  }
170  return nullptr;
171 }
172 
173 
174 
175 Module* XmlModLoader::parsXml(const char* szFile)
176 {
177  module.clear();
178  ErrorLogger* logger = ErrorLogger::Instance();
179 
180  TiXmlDocument doc(szFile);
181  if(!doc.LoadFile())
182  {
183  OSTRINGSTREAM err;
184  err<<"Syntax error while loading "<<szFile<<" at line "\
185  <<doc.ErrorRow()<<": ";
186  err<<doc.ErrorDesc();
187  logger->addError(err);
188  return nullptr;
189  }
190 
191  /* retrieving root module */
192  TiXmlElement *root = doc.RootElement();
193  if(!root)
194  {
195  OSTRINGSTREAM err;
196  err<<"Syntax error while loading "<<szFile<<" . ";
197  err<<"No root element.";
198  logger->addError(err);
199  return nullptr;
200  }
201 
202  if(!compareString(root->Value(), "module"))
203  {
204  /*
205  OSTRINGSTREAM msg;
206  msg<<szFile<<" is not a module descriptor file.";
207  logger->addWarning(msg);
208  */
209  return nullptr;
210  }
211 
212  /* retrieving name */
213  auto* name = (TiXmlElement*) root->FirstChild("name");
214  if(!name || !name->GetText())
215  {
216  OSTRINGSTREAM err;
217  err<<"Module from "<<szFile<<" has no name.";
218  logger->addError(err);
219  //return NULL;
220  }
221 
222  for(TiXmlElement* var = root->FirstChildElement("var"); var; var = var->NextSiblingElement())
223  {
224  if(var->Attribute("name") && var->GetText())
225  {
226  parser->addVariable(var->Attribute("name"), var->GetText());
227  }
228  }
229 
230  module.setXmlFile(szFile);
231 
232  if(name)
233  module.setName(parser->parseText(name->GetText()).c_str());
234 
235  /* retrieving description */
236  TiXmlElement* desc;
237  if((desc = (TiXmlElement*) root->FirstChild("description")))
238  module.setDescription(parser->parseText(desc->GetText()).c_str());
239 
240  /* retrieving version */
241  TiXmlElement* ver;
242  if((ver = (TiXmlElement*) root->FirstChild("version")))
243  module.setVersion(parser->parseText(ver->GetText()).c_str());
244 
245 
246  /* retrieving parameter */
247  TiXmlElement* arguments;
248  if((arguments = (TiXmlElement*) root->FirstChild("arguments")))
249  for(TiXmlElement* param = arguments->FirstChildElement(); param;
250  param = param->NextSiblingElement())
251  {
252  if(compareString(param->Value(), "param"))
253  {
254  if(param->GetText())
255  {
256  bool brequired = false;
257  if(compareString(param->Attribute("required"), "yes"))
258  brequired = true;
259  Argument arg(parser->parseText(param->GetText()).c_str(),
260  brequired,
261  param->Attribute("desc"));
262  arg.setDefault(param->Attribute("default"));
263  module.addArgument(arg);
264  }
265  }
266  else
267  if(compareString(param->Value(), "switch"))
268  {
269  if(param->GetText())
270  {
271  bool brequired = false;
272  if(compareString(param->Attribute("required"), "yes"))
273  brequired = true;
274  Argument arg(parser->parseText(param->GetText()).c_str(),
275  brequired,
276  param->Attribute("desc"), true);
277  arg.setDefault(param->Attribute("default"));
278  module.addArgument(arg);
279  }
280  }
281  else
282  {
283  OSTRINGSTREAM war;
284  war<<"Unrecognized tag from "<<szFile<<" at line "\
285  <<param->Row()<<".";
286  logger->addWarning(war);
287  }
288 
289  }
290 
291 
292  /* retrieving rank */
293  TiXmlElement* rank;
294  if((rank = (TiXmlElement*) root->FirstChild("rank")) &&
295  rank->GetText())
296  module.setRank(atoi(parser->parseText(rank->GetText()).c_str()));
297 
298 
299  /* retrieving authors information*/
300  TiXmlElement* authors;
301  if((authors = (TiXmlElement*) root->FirstChild("authors")))
302  for(TiXmlElement* ath = authors->FirstChildElement(); ath;
303  ath = ath->NextSiblingElement())
304  {
305  if(compareString(ath->Value(), "author"))
306  {
307  Author author;
308  if(ath->GetText())
309  author.setName(parser->parseText(ath->GetText()).c_str());
310  if(ath->Attribute("email"))
311  author.setEmail(ath->Attribute("email"));
312  module.addAuthor(author);
313  }
314  else
315  {
316  OSTRINGSTREAM war;
317  war<<"Unrecognized tag from "<<szFile<<" at line "\
318  <<ath->Row()<<".";
319  logger->addWarning(war);
320  }
321 
322  }
323 
324 
325  /* retrieving data */
326  if(root->FirstChild("data"))
327  for(TiXmlElement* data = root->FirstChild("data")->FirstChildElement();
328  data; data = data->NextSiblingElement())
329  {
330  /* output data */
331  if(compareString(data->Value(), "output"))
332  {
333  OutputData output;
334 
335  if(compareString(data->Attribute("port_type"), "stream") || !data->Attribute("port_type"))
336  output.setPortType(STREAM_PORT);
337  else if(compareString(data->Attribute("port_type"), "event"))
338  output.setPortType(EVENT_PORT);
339  else if(compareString(data->Attribute("port_type"), "service"))
340  output.setPortType(SERVICE_PORT);
341  else
342  {
343  OSTRINGSTREAM war;
344  war<<"Unknown port type \'"<<data->Attribute("port_type")<<"\' from "<<szFile<<" at line "\
345  <<data->Row()<<". Available types : stream, event, service";
346  logger->addWarning(war);
347  }
348 
349 
350  TiXmlElement* element;
351  if(output.getPortType() != SERVICE_PORT )
352  {
353  if((element = (TiXmlElement*) data->FirstChild("type")))
354  output.setName(parser->parseText(element->GetText()).c_str());
355  else
356  {
357  OSTRINGSTREAM war;
358  war<<"Output data from "<<szFile<<" at line "\
359  <<data->Row()<<" has no type.";
360  logger->addWarning(war);
361  }
362  }
363  else
364  output.setName("*");
365 
366  if((element = (TiXmlElement*) data->FirstChild("port")))
367  {
368  output.setPort(parser->parseText(element->GetText()).c_str());
369  output.setCarrier(element->Attribute("carrier"));
370  }
371  else
372  {
373  OSTRINGSTREAM war;
374  war<<"Output data from "<<szFile<<" at line "\
375  <<data->Row()<<" has no port.";
376  logger->addWarning(war);
377  }
378 
379  if((element = (TiXmlElement*) data->FirstChild("description")))
380  output.setDescription(parser->parseText(element->GetText()).c_str());
381 
382  module.addOutput(output);
383  } // end of output data
384 
385  /* input data */
386  if(compareString(data->Value(), "input"))
387  {
388  InputData input;
389 
390  if(compareString(data->Attribute("port_type"), "stream") || !data->Attribute("port_type"))
391  input.setPortType(STREAM_PORT);
392  else if(compareString(data->Attribute("port_type"), "event"))
393  input.setPortType(EVENT_PORT);
394  else if(compareString(data->Attribute("port_type"), "service"))
395  input.setPortType(SERVICE_PORT);
396  else
397  {
398  OSTRINGSTREAM war;
399  war<<"Unknown port type \'"<<data->Attribute("port_type")<<"\' from "<<szFile<<" at line "\
400  <<data->Row()<<". Available types : stream, event, service";
401  logger->addWarning(war);
402  }
403 
404  TiXmlElement* element;
405  if(input.getPortType() != SERVICE_PORT )
406  {
407 
408  if((element = (TiXmlElement*) data->FirstChild("type")))
409  input.setName(parser->parseText(element->GetText()).c_str());
410  else
411  {
412  OSTRINGSTREAM war;
413  war<<"Input data from "<<szFile<<" at line "\
414  <<data->Row()<<" has no type.";
415  logger->addWarning(war);
416  }
417  }
418  else
419  input.setName("rpc");
420 
421  if((element = (TiXmlElement*) data->FirstChild("port")))
422  {
423  input.setPort(parser->parseText(element->GetText()).c_str());
424  input.setCarrier(element->Attribute("carrier"));
425  }
426  else
427  {
428  OSTRINGSTREAM war;
429  war<<"Input data from "<<szFile<<" at line "\
430  <<data->Row()<<" has no port.";
431  logger->addWarning(war);
432  }
433 
434  if((element = (TiXmlElement*) data->FirstChild("description")))
435  input.setDescription(parser->parseText(element->GetText()).c_str());
436 
437  if((element = (TiXmlElement*) data->FirstChild("required")))
438  if(compareString(parser->parseText(element->GetText()).c_str(), "yes"))
439  input.setRequired(true);
440 
441  if((element = (TiXmlElement*) data->FirstChild("priority")))
442  if(compareString(parser->parseText(element->GetText()).c_str(), "yes"))
443  input.setPriority(true);
444 
445  module.addInput(input);
446  } // end of input data
447 
448  }
449 
450  if(root->FirstChild("services")) {
451  for(TiXmlElement* services = root->FirstChild("services")->FirstChildElement();
452  services; services = services->NextSiblingElement())
453  {
454  /* server */
455  if(compareString(services->Value(), "server"))
456  {
457  InputData input;
458  input.setPortType(SERVICE_PORT);
459  TiXmlElement* element;
460  if((element = (TiXmlElement*) services->FirstChild("port"))) {
461  input.setPort(parser->parseText(element->GetText()).c_str());
462  input.setCarrier("tcp");
463  }
464  if((element = (TiXmlElement*) services->FirstChild("description")))
465  input.setDescription(parser->parseText(element->GetText()).c_str());
466  if((element = (TiXmlElement*) services->FirstChild("type")))
467  input.setName(parser->parseText(element->GetText()).c_str());
468  else
469  input.setName("rpc");
470  module.addInput(input);
471  }
472  /* client */
473  if(compareString(services->Value(), "client"))
474  {
475  OutputData output;
476  output.setPortType(SERVICE_PORT);
477  TiXmlElement* element;
478  if((element = (TiXmlElement*) services->FirstChild("port"))) {
479  output.setPort(parser->parseText(element->GetText()).c_str());
480  output.setCarrier("tcp");
481  }
482  if((element = (TiXmlElement*) services->FirstChild("description")))
483  output.setDescription(parser->parseText(element->GetText()).c_str());
484  if((element = (TiXmlElement*) services->FirstChild("type")))
485  output.setName(parser->parseText(element->GetText()).c_str());
486  else
487  output.setName("rpc");
488  module.addOutput(output);
489  }
490  }
491 
492  }
493 
494  /* retrieving broker*/
495  TiXmlElement* element;
496  if((element = (TiXmlElement*) root->FirstChild("deployer")))
497  {
498  module.setBroker(parser->parseText(element->GetText()).c_str());
499  module.setNeedDeployer(true);
500  }
501 
502  /* retrieving dependencies*/
503  if(root->FirstChild("dependencies"))
504  for(TiXmlElement* restag = root->FirstChild("dependencies")->FirstChildElement();
505  restag; restag = restag->NextSiblingElement())
506  {
507  Computer computer;
508  if(compareString(restag->Value(), "computer"))
509  {
510  Computer computer;
511  computer.setXmlFile(szFile);
512  for(TiXmlElement* comptag = restag->FirstChildElement();
513  comptag; comptag = comptag->NextSiblingElement())
514  {
515  /* retrieving name */
516  if(compareString(comptag->Value(), "name"))
517  computer.setName(parser->parseText(comptag->GetText()).c_str());
518 
519  /* retrieving description */
520  if(compareString(comptag->Value(), "description"))
521  computer.setDescription(parser->parseText(comptag->GetText()).c_str());
522 
523  // platform
524  if(compareString(comptag->Value(), "platform"))
525  {
526  Platform os;
527  TiXmlElement* element;
528  if((element = (TiXmlElement*) comptag->FirstChild("name")))
529  os.setName(parser->parseText(element->GetText()).c_str());
530  if((element = (TiXmlElement*) comptag->FirstChild("distribution")))
531  os.setDistribution(parser->parseText(element->GetText()).c_str());
532  if((element = (TiXmlElement*) comptag->FirstChild("release")))
533  os.setRelease(parser->parseText(element->GetText()).c_str());
534  computer.setPlatform(os);
535  } // end of platform tag
536 
537  /*
538  //multiplatform
539  if(compareString(comptag->Value(), "multiplatform"))
540  {
541  MultiPlatform mltPlatform;
542  for(TiXmlElement* mptag = comptag->FirstChild("multiplatform")->FirstChildElement();
543  mptag; mptag = mptag->NextSiblingElement())
544  {
545  // platform
546  if(compareString(mptag->Value(), "platform"))
547  {
548  Platform os;
549  TiXmlElement* element;
550  if((element = (TiXmlElement*) mptag->FirstChild("name")))
551  os.setName(element->GetText());
552  if((element = (TiXmlElement*) mptag->FirstChild("distribution")))
553  os.setDistribution(element->GetText());
554  if((element = (TiXmlElement*) mptag->FirstChild("release")))
555  os.setDistribution(element->GetText());
556  mltPlatform.addPlatform(os);
557  }
558  }
559  module.addResource(mltPlatform);
560  }
561  // end of multiplatform tag
562  */
563  // memory
564  if(compareString(comptag->Value(), "memory"))
565  {
566  Memory mem;
567  TiXmlElement* element;
568  if((element = (TiXmlElement*) comptag->FirstChild("total_space")))
569  mem.setTotalSpace((Capacity)atol(parser->parseText(element->GetText()).c_str()));
570  if((element = (TiXmlElement*) comptag->FirstChild("free_space")))
571  mem.setFreeSpace((Capacity)atol(parser->parseText(element->GetText()).c_str()));
572  computer.setMemory(mem);
573  } // end of memory tag
574 
575  // storage
576  if(compareString(comptag->Value(), "storage"))
577  {
578  Storage stg;
579  TiXmlElement* element;
580  if((element = (TiXmlElement*) comptag->FirstChild("total_space")))
581  stg.setTotalSpace((Capacity)atol(parser->parseText(element->GetText()).c_str()));
582  if((element = (TiXmlElement*) comptag->FirstChild("free_space")))
583  stg.setFreeSpace((Capacity)atol(parser->parseText(element->GetText()).c_str()));
584  computer.setStorage(stg);
585  } // end of storage tag
586 
587  // processor
588  if(compareString(comptag->Value(), "processor"))
589  {
590  Processor proc;
591  TiXmlElement* element;
592  if((element = (TiXmlElement*) comptag->FirstChild("architecture")))
593  proc.setArchitecture(parser->parseText(element->GetText()).c_str());
594  if((element = (TiXmlElement*) comptag->FirstChild("model")))
595  proc.setModel(parser->parseText(element->GetText()).c_str());
596  if((element = (TiXmlElement*) comptag->FirstChild("cores")))
597  proc.setCores((size_t)atoi(parser->parseText(element->GetText()).c_str()));
598  if((element = (TiXmlElement*) comptag->FirstChild("siblings")))
599  proc.setSiblings((size_t)atoi(parser->parseText(element->GetText()).c_str()));
600  if((element = (TiXmlElement*) comptag->FirstChild("frequency")))
601  proc.setFrequency(atof(parser->parseText(element->GetText()).c_str()));
602  computer.setProcessor(proc);
603  } // end of processor tag
604 
605  // network
606  if(compareString(comptag->Value(), "network"))
607  {
608  Network net;
609  TiXmlElement* element;
610  if((element = (TiXmlElement*) comptag->FirstChild("ip4")))
611  net.setIP4(parser->parseText(element->GetText()).c_str());
612  if((element = (TiXmlElement*) comptag->FirstChild("ip6")))
613  net.setIP6(parser->parseText(element->GetText()).c_str());
614  if((element = (TiXmlElement*) comptag->FirstChild("mac")))
615  net.setMAC(parser->parseText(element->GetText()).c_str());
616  module.addResource(net);
617  computer.setNetwork(net);
618  } // end of network tag
619 
620  // yarp_port
621  if(compareString(comptag->Value(), "yarp_port"))
622  {
623  ResYarpPort yport;
624  auto* element = (TiXmlElement*) comptag->FirstChild("name");
625  if(element && element->GetText())
626  {
627  yport.setName(parser->parseText(element->GetText()).c_str());
628  yport.setPort(parser->parseText(element->GetText()).c_str());
629  computer.addPeripheral(yport);
630  }
631  else
632  {
633  OSTRINGSTREAM war;
634  war<<"yarp_port from "<<szFile<<" at line " <<comptag->Row()<<" has no name.";
635  logger->addWarning(war);
636  }
637  }
638 
639  // gpu
640  if(compareString(comptag->Value(), "gpu"))
641  {
642  GPU gpu;
643  TiXmlElement* element;
644  if((element = (TiXmlElement*) comptag->FirstChild("name")))
645  gpu.setName(parser->parseText(element->GetText()).c_str());
646  if((element = (TiXmlElement*) comptag->FirstChild("capability")))
647  gpu.setCompCompatibility(parser->parseText(element->GetText()).c_str());
648  if((element = (TiXmlElement*) comptag->FirstChild("cores")))
649  gpu.setCores((size_t)atoi(parser->parseText(element->GetText()).c_str()));
650  if((element = (TiXmlElement*) comptag->FirstChild("frequency")))
651  gpu.setFrequency(atof(parser->parseText(element->GetText()).c_str()));
652  if((element = (TiXmlElement*) comptag->FirstChild("register_block")))
653  gpu.setResgisterPerBlock((size_t)atoi(parser->parseText(element->GetText()).c_str()));
654  if((element = (TiXmlElement*) comptag->FirstChild("thread_block")))
655  gpu.setThreadPerBlock((size_t)atoi(parser->parseText(element->GetText()).c_str()));
656  if((element = (TiXmlElement*) comptag->FirstChild("overlap")))
657  {
658  if(compareString(parser->parseText(element->GetText()).c_str(), "yes"))
659  gpu.setOverlap(true);
660  else
661  gpu.setOverlap(false);
662  }
663 
664 
665  // global memory
666  if(comptag->FirstChild("global_memory"))
667  {
668  TiXmlElement* element;
669  element = (TiXmlElement*) comptag->FirstChild("global_memory");
670  if((element = (TiXmlElement*) element->FirstChild("total_space")))
671  gpu.setGlobalMemory((Capacity)atol(parser->parseText(element->GetText()).c_str()));
672  } // end of global memory tag
673 
674  // shared memory
675  if(comptag->FirstChild("shared_memory"))
676  {
677  TiXmlElement* element;
678  element = (TiXmlElement*) comptag->FirstChild("shared_memory");
679  if((element = (TiXmlElement*) element->FirstChild("total_space")))
680  gpu.setSharedMemory((Capacity)atol(parser->parseText(element->GetText()).c_str()));
681  } // end of shared memory tag
682 
683  // constant memory
684  if(comptag->FirstChild("constant_memory"))
685  {
686  TiXmlElement* element;
687  element = (TiXmlElement*) comptag->FirstChild("constant_memory");
688  if((element = (TiXmlElement*) element->FirstChild("total_space")))
689  gpu.setConstantMemory((Capacity)atol(parser->parseText(element->GetText()).c_str()));
690  } // end of shared memory tag
691  computer.addPeripheral(gpu);
692  } // end of gpu tag
693  } // end of computer tag loop
694  module.addResource(computer);
695  } //end of if computer tag
696  }// end of dependecnies tag
697 
698  return &module;
699 }
yarp::manager::Processor::setModel
void setModel(const char *model)
Definition: primresource.h:120
yarp::manager::GPU::setFrequency
void setFrequency(double f)
Definition: physicresource.h:33
filesystem.h
yarp::manager::GPU::setThreadPerBlock
void setThreadPerBlock(size_t val)
Definition: physicresource.h:39
yarp::manager::Author::setName
void setName(const char *name)
Definition: module.h:33
yarp::manager::OutputData::setPort
void setPort(const char *szPort)
Definition: data.h:86
yarp::manager::Processor
Definition: primresource.h:111
yarp::manager::Computer::setProcessor
void setProcessor(Processor &proc)
Definition: primresource.h:167
yarp::manager::Processor::setArchitecture
void setArchitecture(const char *arch)
Definition: primresource.h:119
yarp::manager::InputData::getPortType
NodeType getPortType()
Definition: data.h:50
yarp::manager::Computer::setMemory
void setMemory(Memory &mem)
Definition: primresource.h:165
yarp::manager::Author::setEmail
void setEmail(const char *email)
Definition: module.h:34
yarp::manager::OutputData::setCarrier
void setCarrier(const char *szCr)
Definition: data.h:88
yarp::manager::OSTRINGSTREAM
std::stringstream OSTRINGSTREAM
Definition: utility.h:52
yarp::manager::Computer
Definition: primresource.h:155
yarp::manager::Network::setIP6
void setIP6(const char *ip)
Definition: primresource.h:85
yarp::manager
Definition: application.h:24
yarp::manager::Memory::setTotalSpace
void setTotalSpace(Capacity c)
Definition: primresource.h:35
yarp::manager::Processor::setFrequency
void setFrequency(double f)
Definition: primresource.h:123
yarp::manager::ErrorLogger
Singleton class ErrorLogger.
Definition: utility.h:60
yarp::manager::Storage::setFreeSpace
void setFreeSpace(Capacity c)
Definition: primresource.h:62
yarp::manager::OutputData::setPortType
void setPortType(NodeType type)
Definition: data.h:92
utility.h
yarp::manager::compareString
bool compareString(const char *szFirst, const char *szSecond)
Definition: utility.cpp:305
yarp::manager::GenericResource::setXmlFile
void setXmlFile(const char *szFilename)
Definition: resource.h:39
yarp::manager::GenericResource::setDescription
void setDescription(const char *szDesc)
Definition: resource.h:33
yarp::manager::Network
Definition: primresource.h:76
yarp::manager::Storage
Definition: primresource.h:52
yarp::manager::Platform
Definition: logicresource.h:23
yarp::manager::Module
Class Module.
Definition: module.h:103
yarp::manager::InputData::setPriority
void setPriority(bool prio)
Definition: data.h:43
yarp::manager::Memory
Class Memory.
Definition: primresource.h:27
yarp::manager::EVENT_PORT
@ EVENT_PORT
Definition: ymm-types.h:27
yarp::manager::OutputData
Definition: data.h:72
yarp::manager::TextParser
Definition: textparser.h:24
yarp::manager::GPU
Definition: physicresource.h:22
yarp::manager::Network::setMAC
void setMAC(const char *mac)
Definition: primresource.h:86
yarp::manager::Argument
Class Argument.
Definition: module.h:50
yarp::manager::Platform::setRelease
void setRelease(const char *str)
Definition: logicresource.h:32
primresource.h
yarp::manager::InputData::setPort
void setPort(const char *szPort)
Definition: data.h:39
yarp::manager::ErrorLogger::addError
void addError(const char *szError)
Definition: utility.cpp:121
xmlmodloader.h
yarp::manager::Memory::setFreeSpace
void setFreeSpace(Capacity c)
Definition: primresource.h:37
yarp::manager::ResYarpPort
Definition: logicresource.h:47
textparser.h
yarp::manager::Capacity
size_t Capacity
Definition: primresource.h:22
module
static RFModule * module
Definition: RFModule.cpp:234
yarp::manager::GPU::setSharedMemory
void setSharedMemory(Capacity c)
Definition: physicresource.h:36
yarp::manager::Platform::setDistribution
void setDistribution(const char *str)
Definition: logicresource.h:31
yarp::manager::ErrorLogger::addWarning
void addWarning(const char *szWarning)
Definition: utility.cpp:108
yarp::manager::Computer::addPeripheral
bool addPeripheral(GenericResource &res)
Definition: primresource.cpp:221
yarp::manager::SERVICE_PORT
@ SERVICE_PORT
Definition: ymm-types.h:26
yarp::manager::InputData::setPortType
void setPortType(NodeType type)
Definition: data.h:49
yarp::manager::Computer::setPlatform
void setPlatform(Platform &os)
Definition: primresource.h:169
yarp::manager::ResYarpPort::setPort
void setPort(const char *szPort)
Definition: logicresource.h:52
yarp::manager::GPU::setCompCompatibility
void setCompCompatibility(const char *cap)
Definition: physicresource.h:34
yarp::manager::InputData::setDescription
void setDescription(const char *szDesc)
Definition: data.h:47
yarp::manager::Computer::setNetwork
void setNetwork(Network &net)
Definition: primresource.h:168
yarp::manager::OutputData::setName
void setName(const char *szName)
Definition: data.h:80
yarp::conf::filesystem::preferred_separator
static constexpr value_type preferred_separator
Definition: filesystem.h:28
yarp::manager::InputData::setRequired
void setRequired(bool req)
Definition: data.h:44
yarp::manager::InputData::setName
void setName(const char *szName)
Definition: data.h:33
yarp::manager::Processor::setCores
void setCores(size_t n)
Definition: primresource.h:121
yarp::manager::Author
Definition: module.h:24
logicresource.h
yarp::manager::STREAM_PORT
@ STREAM_PORT
Definition: ymm-types.h:25
yarp::manager::GPU::setCores
void setCores(size_t n)
Definition: physicresource.h:32
yarp::manager::GPU::setGlobalMemory
void setGlobalMemory(Capacity c)
Definition: physicresource.h:35
yarp::manager::Computer::setStorage
void setStorage(Storage &stg)
Definition: primresource.h:166
yarp::manager::GPU::setConstantMemory
void setConstantMemory(Capacity c)
Definition: physicresource.h:37
physicresource.h
yarp::manager::GPU::setOverlap
void setOverlap(bool flag)
Definition: physicresource.h:40
yarp::manager::GenericResource::setName
void setName(const char *szName)
Definition: resource.h:31
yarp::manager::OutputData::getPortType
NodeType getPortType()
Definition: data.h:93
yarp::manager::Module::getName
const char * getName()
Definition: module.h:132
yarp::manager::Processor::setSiblings
void setSiblings(size_t n)
Definition: primresource.h:122
yarp::manager::InputData::setCarrier
void setCarrier(const char *szCr)
Definition: data.h:41
yarp::manager::GPU::setResgisterPerBlock
void setResgisterPerBlock(size_t val)
Definition: physicresource.h:38
yarp::manager::InputData
Class InputData.
Definition: data.h:25
yarp::manager::Network::setIP4
void setIP4(const char *ip)
Definition: primresource.h:84
yarp::manager::OutputData::setDescription
void setDescription(const char *szDesc)
Definition: data.h:90
yarp::manager::Storage::setTotalSpace
void setTotalSpace(Capacity c)
Definition: primresource.h:60