YARP
Yet Another Robot Platform
MonitorBinding.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 
6 #include "MonitorBinding.h"
7 #include "MonitorSharedLib.h"
8 #include "MonitorLogComponent.h"
9 
10 #ifdef ENABLED_PORTMONITOR_LUA
11  #include "MonitorLua.h"
12 #endif
13 
14 #include <string>
15 #include <yarp/os/LogStream.h>
16 
17 using namespace yarp::os;
18 
24 
25 MonitorBinding* MonitorBinding::create(const char* script_type)
26 {
27  if(std::string(script_type) == "lua") {
28 #ifdef ENABLED_PORTMONITOR_LUA
29  return new MonitorLua();
30 #else
31  yCError(PORTMONITORCARRIER) << "Cannot load LUA plugin. YARP portmonitor was built without LUA support";
32  return nullptr;
33 #endif
34  }
35 
36  if(std::string(script_type) == "dll") {
37  return new MonitorSharedLib();
38  }
39 
40  return nullptr;
41 }
const yarp::os::LogComponent & PORTMONITORCARRIER()
virtual ~MonitorBinding()
Class MonitorBinding.
static MonitorBinding * create(const char *script_type)
factory method
#define yCError(component,...)
Definition: LogComponent.h:154
An interface to the operating system, including Port based communication.