28 if (name ==
nullptr) {
34 if (s.find(
"/quit") == std::string::npos) {
64#define TermineeHelper Port
65#define HELPER(x) (*((TermineeHelper*)(x)))
71 if (name ==
nullptr) {
90 yCError(
TERMINATOR,
"Kill port conflict: make sure you supply a distinct --name /PORTNAME");
125 bool ok = helper.
read(cmd,
true);
classes to handle graceful process termination.
A simple collection of objects that can be described and transmitted in a portable way.
void addVocab32(yarp::conf::vocab32_t x)
Places a vocabulary item in the bottle, at the end of the list.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
A mini-server for performing network communication in the background.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void interrupt() override
Interrupt any current reads or writes attached to the port.
T * read(bool shouldWait=true) override
Read an available object from the port.
static Contact queryName(const std::string &name)
Find out information about a registered name.
static int sendMessage(const std::string &port, yarp::os::PortWriter &writable, bool silent=false)
Just a reminder to sendMessage with temporary output parameter that will be discarded.
static bool write(const Contact &contact, PortWriter &cmd, PortReader &reply, bool admin=false, bool quiet=false, double timeout=-1)
Send a single command to a port and await a single response.
static bool terminateByName(const char *name)
Send a quit message to a specific socket port.
void run() override
Main body of the new thread.
Terminee(const char *name)
Constructor.
virtual ~Terminee()
Destructor.
bool isOk() const
Check whether the message mechanism is ok.
bool mustQuit() const
Call this method to see whether a quit message has been received.
void onStop() override
Call-back, called while halting the thread (before join).
bool waitQuit() const
Call this method to wait for a quit message.
bool stop()
Stop the thread.
bool isStopping()
Returns true if the thread is stopping (Thread::stop has been called).
bool start()
Start the new thread running.
virtual std::string asString() const
Get string value.
Simple Readable and Writable object representing a command to a YARP port.
#define yCError(component,...)
#define yCAssert(component, x)
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.