YARP
Yet Another Robot Platform
singleapploader.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/manager/utility.h>
8 
9 
10 using namespace yarp::manager;
11 
12 
13 SingleAppLoader::SingleAppLoader(const char* szModule, const char* szHost)
14 {
15  if (szModule) {
16  strModule = szModule;
17  }
18  if (szHost) {
19  strHost = szHost;
20  }
21 }
22 
23 
25 
26 
28 {
30  app.clear();
31  if(strModule.empty())
32  {
33  logger->addError("Empty module name.");
34  return false;
35  }
36 
37  app.setName(strModule.c_str());
38  ModuleInterface module(strModule.c_str());
39  module.setHost(strHost.c_str());
40  app.addImodule(module);
41  return true;
42 }
43 
44 
46 {
47  app.clear();
48 }
49 
50 
52 {
53  return &app;
54 }
static RFModule * module
Definition: RFModule.cpp:231
Class Application.
Definition: application.h:289
void setName(const char *szName)
Definition: application.h:296
bool addImodule(ModuleInterface &imod)
Singleton class ErrorLogger.
Definition: utility.h:57
void addError(const char *szError)
Definition: utility.cpp:118
static ErrorLogger * Instance()
Singleton class ErrorLogger.
Definition: utility.cpp:98
Class ModuleInterface.
Definition: application.h:161
SingleAppLoader(const char *szModule, const char *strHost)
Application * getNextApplication() override