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