#include <rtt/Handle.hpp>

It is returned by the connect() and setup() methods of Event and can be used to (dis)connect a handler function from the event. Handle objects may be assigned to each other and will always point to the same connection. If the last Handle object is destroyed, and is not connected, the connection is destroyed. Thus the resource management (deallocation) is handled by Orocos itself.
To inspect if the Handle points to a valid, existing connection, one can use :
Handle handle;
// ...
if ( !handle ) {
// not valid !
}
Definition at line 67 of file Handle.hpp.
Public Member Functions | |
| Handle () | |
| the connection type for the slot of this Handle | |
| Handle (connection_t conn) | |
| Handle (const Handle &hs) | |
| Create a copy-equivalent Handle. | |
| ~Handle () | |
| No-op destructor, does not change signal/slot state. | |
| bool | connect () |
| (Re-)Connect the slot with the signal. | |
| bool | disconnect () |
| Disconnect the slot from the signal. | |
| bool | connected () const |
| Inspect if this Handle represents a connected signal and slot. | |
| operator bool () const | |
| Inspect if this Handle is pointing to a valid (existing) connection. | |
| bool | ready () const |
| Inspect if this handle is pointing to valid (existing) connection(s). | |
Protected Attributes | |
| connection_t | m_conn |
| This is actually a smart pointer which always points to an existing connection object. | |
| Handle | ( | ) |
the connection type for the slot of this Handle
Create an empty Handle.
Definition at line 45 of file Handle.cpp.
| bool connect | ( | ) |
(Re-)Connect the slot with the signal.
| true | the slot is connected. | |
| false | no valid signal or slot in this Handle |
Definition at line 64 of file Handle.cpp.
References Handle::connected(), and Handle::m_conn.
Referenced by EventProcessor::connect(), Event< void(void) >::connect(), and EventDrivenActivity::start().
| bool disconnect | ( | ) |
Disconnect the slot from the signal.
| true | the slot is disconnected. | |
| false | no valid signal or slot in this Handle |
Definition at line 71 of file Handle.cpp.
References Handle::connected(), and Handle::m_conn.
Referenced by EventDrivenActivity::stop(), and ScopedHandle::~ScopedHandle().
| bool connected | ( | ) | const |
Inspect if this Handle represents a connected signal and slot.
Definition at line 78 of file Handle.cpp.
References Handle::m_conn.
Referenced by Handle::connect(), and Handle::disconnect().
| operator bool | ( | ) | const |
Inspect if this Handle is pointing to a valid (existing) connection.
Definition at line 82 of file Handle.cpp.
References Handle::m_conn.
| bool ready | ( | ) | const |
Inspect if this handle is pointing to valid (existing) connection(s).
Definition at line 86 of file Handle.cpp.
References Handle::m_conn.
1.5.3