24class TerminatorServer :
28 explicit TerminatorServer(
volatile bool&
quitFlag) :
40 volatile bool& m_quit;
48 if (name ==
nullptr) {
88#define TermineeHelper Port
89#define HELPER(x) (*((TermineeHelper*)(x)))
95 if (name ==
nullptr) {
102 if (name[0] !=
'/') {
114 yCError(
TERMINATOR,
"Kill port conflict: make sure you supply a distinct --name /PORTNAME");
classes to handle graceful process termination.
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.
static Contact queryName(const std::string &name)
Find out information about a registered name.
A mini-server for network communication.
bool addOutput(const std::string &name) override
Add an output connection to the specified port.
bool openFake(const std::string &name)
Start port without making it accessible from the network.
Commands accepted by the port opened by yarp::os::Terminee, and sent by yarp::os::Terminator::termina...
virtual bool quit()
Ask the process which owns the port to start a graceful quit procedure.
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.
bool attachAsClient(yarp::os::UnbufferedContactable &port)
Tag this WireLink as a client, sending data via the specified port.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
#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.
The main, catch-all namespace for YARP.