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