|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
25 RUNLOG(
"RunWrite: could not open output port")
26 fprintf(stderr,
"RunWrite: could not open output port\n");
33 fprintf(stderr,
"RunWrite: could not mmake connection with the logger\n");
39 std::string tag=std::string(
"[")+
wPortName+std::string(
"]");
43 if (!fgets(txt, 2048, stdin) || ferror(stdin) || feof(stdin))
break;
66 RUNLOG(
"RunRead: could not open input port")
67 fprintf(stderr,
"RunRead: could not open input port\n");
76 RUNLOG(
"!rPort.read(bot, true)")
88 printf(
"%s\n", bot.
toString().c_str());
109 RUNLOG(
"RunReadWrite: could not open input port")
110 fprintf(stderr,
"RunReadWrite: could not open input port\n");
124 tag=std::string(
"[")+
fPortName+std::string(
"]");
127 RUNLOG(
"RunReadWrite: could not open forward port")
128 fprintf(stderr,
"RunReadWrite: could not open forward port\n");
138 if (yarp::os::impl::getppid()!=1)
147 if (yarp::os::impl::getppid()==1)
break;
154 RUNLOG(
"!rPort.read(bot, true)")
161 if (yarp::os::impl::getppid()==1)
break;
179 printf(
"%s\n", bot.
toString().c_str());
202 int warn_suppress = yarp::run::impl::pipe(term_pipe);
204 yarp::run::impl::dup2(term_pipe[0], STDIN_FILENO);
205 FILE* file_term_pipe=fdopen(term_pipe[1],
"w");
206 fprintf(file_term_pipe,
"SHKIATTETE!\n");
207 fflush(file_term_pipe);
208 fclose(file_term_pipe);
225 RUNLOG(
"RunReadWrite: could not open output port")
226 fprintf(stderr,
"RunReadWrite: could not open output port\n");
240 if (yarp::os::impl::getppid()==1)
break;
243 if (!fgets(txt, 2048, stdin) || ferror(stdin) || feof(stdin))
break;
248 if (yarp::os::impl::getppid()==1)
break;
258 RUNLOG(
"<<<wPort.write(bot)")
260 RUNLOG(
">>>wPort.write(bot)")
void close() override
Stop port activity.
A simple collection of objects that can be described and transmitted in a portable way.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
size_type size() const
Gets the number of elements in the bottle.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
void run() override
Main body of the new thread.
virtual std::string asString() const
Get string value.
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
bool read(PortReader &reader, bool willReply=false) override
Read an object from the port.
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
bool start()
Start the new thread running.
static bool exists(const std::string &port, bool quiet=true, bool checkVer=true)
Check for a port to be ready and responsive.