YARP
Yet Another Robot Platform
Terminator.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_OS_TERMINATOR_H
8 #define YARP_OS_TERMINATOR_H
9 
10 
11 #include <yarp/os/Thread.h>
12 
13 namespace yarp {
14 namespace os {
15 
32 {
33 public:
40  static bool terminateByName(const char* name);
41 };
42 
48 {
49 protected:
51  volatile bool quit;
52  volatile bool ok;
53 
54 public:
59  Terminee(const char* name);
60 
64  virtual ~Terminee();
65 
66 
67  void run() override;
68 
73  bool waitQuit() const;
74 
80  bool mustQuit() const;
81 
86  bool isOk() const;
87 
88  void onStop() override;
89 };
90 
91 } // namespace os
92 } // namespace yarp
93 
94 #endif // YARP_OS_TERMINATOR_H
Send a message to a process that has a corresponding socket port created using the Terminee class to ...
Definition: Terminator.h:32
A class that can be polled to see whether the process has been asked to quit gracefully.
Definition: Terminator.h:48
volatile bool ok
Definition: Terminator.h:52
volatile bool quit
Definition: Terminator.h:51
void * implementation
Definition: Terminator.h:50
An abstraction for a thread of execution.
Definition: Thread.h:22
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18