YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
9#ifdef ENABLED_PORTMONITOR_PYTHON
10 #include "python/MonitorPython.h"
11#endif
12
13#include "MonitorLogComponent.h"
14
15#ifdef ENABLED_PORTMONITOR_LUA
16 #include "MonitorLua.h"
17#endif
18
19#include <string>
20#include <yarp/os/LogStream.h>
21
22using namespace yarp::os;
23
29
31{
32 if(std::string(script_type) == "lua")
33 {
34#ifdef ENABLED_PORTMONITOR_LUA
35 return new MonitorLua();
36#else
37 yCError(PORTMONITORCARRIER) << "Cannot load LUA plugin. YARP portmonitor was built without LUA support";
38 return nullptr;
39#endif
40 }
41 else if(std::string(script_type) == "dll")
42 {
43 return new MonitorSharedLib();
44 }
45 else if(std::string(script_type) == "python")
46 {
47#ifdef ENABLED_PORTMONITOR_PYTHON
48 return new MonitorPython();
49#else
50 yCError(PORTMONITORCARRIER) << "Cannot load PYTHON plugin. YARP portmonitor was built without PYTHON support";
51 return nullptr;
52#endif
53 }
54 else
55 {
56 yCError(PORTMONITORCARRIER, R"(Currently only 'lua','dll','python' objects are supported by portmonitor)");
57 }
58
59
60 return nullptr;
61}
const yarp::os::LogComponent & PORTMONITORCARRIER()
virtual ~MonitorBinding()
Class MonitorBinding.
static MonitorBinding * create(const char *script_type)
factory method
A mini-server for performing network communication in the background.
#define yCError(component,...)
An interface to the operating system, including Port based communication.