Orocos Real-Time Toolkit  2.6.0
Public Member Functions | Protected Attributes
RTT::Handle Class Reference

The Handle holds the information, and allows manipulation, of a connection between a internal::Signal Handler function and the Signal itself. More...

#include <rtt/Handle.hpp>

Inheritance diagram for RTT::Handle:
RTT::CleanupHandle RTT::ScopedHandle

List of all members.

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.

Detailed Description

The Handle holds the information, and allows manipulation, of a connection between a internal::Signal Handler function and the Signal itself.

It is returned by the connect() and setup() methods of Signal and can be used to (dis)connect a handler function from the signal. 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 66 of file Handle.hpp.


Constructor & Destructor Documentation

the connection type for the slot of this Handle

Create an empty Handle.

Definition at line 46 of file Handle.cpp.


Member Function Documentation

(Re-)Connect the slot with the signal.

Return values:
truethe slot is connected.
falseno valid signal or slot in this Handle

Definition at line 65 of file Handle.cpp.

References connected(), and m_conn.

bool RTT::Handle::connected ( ) const

Inspect if this Handle represents a connected signal and slot.

Returns:
true if a connection is present.

Definition at line 79 of file Handle.cpp.

References m_conn.

Referenced by connect(), and disconnect().

Disconnect the slot from the signal.

Return values:
truethe slot is disconnected.
falseno valid signal or slot in this Handle

Definition at line 72 of file Handle.cpp.

References connected(), and m_conn.

Referenced by RTT::ScopedHandle::~ScopedHandle().

RTT::Handle::operator bool ( ) const

Inspect if this Handle is pointing to a valid (existing) connection.

Returns:
false if no connection is associated with this Handle.

Definition at line 83 of file Handle.cpp.

References m_conn.

bool RTT::Handle::ready ( ) const

Inspect if this handle is pointing to valid (existing) connection(s).

Returns:
false if no connection(s) is associated with this handle.

Definition at line 87 of file Handle.cpp.

References m_conn.

Referenced by RTT::scripting::StateMachine::createEventTransition().


The documentation for this class was generated from the following files: