YARP
Yet Another Robot Platform
scriptbroker.h
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 #ifndef YARP_MANAGER_SCRIPT_BROKER
10 #define YARP_MANAGER_SCRIPT_BROKER
11 
12 #include <string>
13 
14 #include <yarp/os/Log.h>
15 
18 
19 namespace yarp {
20 namespace manager {
21 
23 {
24 
25 public:
26  ScriptLocalBroker(const char* sc) : LocalBroker() {
27  yAssert(sc);
28  script = sc;
29  }
30  virtual ~ScriptLocalBroker() {}
31  using LocalBroker::init;
32  bool init(const char* szcmd, const char* szparam,
33  const char* szhost, const char* szstdio,
34  const char* szworkdir, const char* szenv) override;
35 private:
36  std::string script;
37 };
38 
39 
41 {
42 
43 public:
44  ScriptYarprunBroker(const char* sc) : YarpBroker() {
45  yAssert(sc);
46  script = sc;
47  }
48  virtual ~ScriptYarprunBroker() {}
49  using YarpBroker::init;
50  bool init(const char* szcmd, const char* szparam,
51  const char* szhost, const char* szstdio,
52  const char* szworkdir, const char* szenv) override;
53 private:
54  bool whichFile(const char* server, const char* filename, std::string& filenameWithPath);
55  std::string script;
56 };
57 
58 } // namespace yarp
59 } // namespace manager
60 
61 
62 #endif // __YARP_MANAGER_SCRIPT_BROKER__
yarp::manager::ScriptLocalBroker::~ScriptLocalBroker
virtual ~ScriptLocalBroker()
Definition: scriptbroker.h:30
yarp::manager::ScriptLocalBroker::init
bool init() override
Definition: localbroker.cpp:164
yarp::manager::ScriptYarprunBroker::~ScriptYarprunBroker
virtual ~ScriptYarprunBroker()
Definition: scriptbroker.h:48
localbroker.h
Log.h
yarp::manager::LocalBroker::init
bool init() override
Definition: localbroker.cpp:164
yarp::manager::YarpBroker
Class Broker.
Definition: yarpbroker.h:37
yarpbroker.h
yarp::manager::ScriptYarprunBroker::init
bool init() override
Definition: yarpbroker.cpp:64
yarp::manager::ScriptLocalBroker::ScriptLocalBroker
ScriptLocalBroker(const char *sc)
Definition: scriptbroker.h:26
yarp::manager::ScriptLocalBroker
Definition: scriptbroker.h:23
yarp::manager::YarpBroker::init
bool init() override
Definition: yarpbroker.cpp:64
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::manager::LocalBroker
Class LocalBroker.
Definition: localbroker.h:37
yarp::manager::ScriptYarprunBroker
Definition: scriptbroker.h:41
yAssert
#define yAssert(x)
Definition: Log.h:297
yarp::manager::ScriptYarprunBroker::ScriptYarprunBroker
ScriptYarprunBroker(const char *sc)
Definition: scriptbroker.h:44