6#ifndef YARP_MANAGER_LOCALBROKER
7#define YARP_MANAGER_LOCALBROKER
46 bool init(
const char* szcmd,
const char* szparam,
47 const char* szhost,
const char* szstdio,
48 const char* szworkdir,
const char* szenv)
override;
50 bool start()
override;
53 bool connect(
const std::string& from,
const std::string& to,
const std::string& carrier,
bool persist =
false)
override;
54 bool disconnect(
const std::string& from,
const std::string& to,
const std::string& carrier)
override;
56 bool exists(
const std::string& port)
override;
57 std::string
requestRpc(
const std::string& szport,
const std::string& request,
double timeout)
override;
58 bool connected(
const std::string& from,
const std::string& to,
const std::string& carrier)
override;
59 std::string
error()
override;
79 std::string strWorkdir;
86 int pipe_to_stdout[2];
90 bool timeout(
double base,
double timeout);
93 bool killCmd(
int pid);
94 bool stopCmd(
int pid);
96 HANDLE read_from_pipe_cmd_to_stdout;
97 HANDLE write_to_pipe_cmd_to_stdout;
98 std::string lastError2String();
100 int waitPipe(
int pipe_fd);
101 int waitPipeSignal(
int pipe_fd);
102 void splitLine(
char *pLine,
char **pArgs);
103 void parseArguments(
char *io_pLine,
int *o_pArgc,
char **o_pArgv);
108 inline bool IS_PARENT_OF(
int pid){
return pid>0; }
109 inline bool IS_NEW_PROCESS(
int pid){
return !pid; }
110 inline bool IS_INVALID(
int pid){
return pid<0; }
std::string requestRpc(const std::string &szport, const std::string &request, double timeout) override
void run() override
Main body of the new thread.
void setWindowMode(WindowMode m)
Define if the application will be visible or not.
bool exists(const std::string &port) override
bool initialized() override
bool threadInit() override
Initialization method.
bool disconnect(const std::string &from, const std::string &to, const std::string &carrier) override
void threadRelease() override
Release method.
bool connected(const std::string &from, const std::string &to, const std::string &carrier) override
std::string error() override
void detachStdout() override
bool attachStdout() override
bool connect(const std::string &from, const std::string &to, const std::string &carrier, bool persist=false) override
connection broker
A mini-server for performing network communication in the background.
An abstraction for a thread of execution.