Handle Class Reference
[Event Interface.]

#include </home/sspr/src/www/orocos-1.0/export/build/orocos-rtt-1.2.2/build/rtt/Handle.hpp>

Inheritance diagram for Handle:

CleanupHandle ScopedHandle List of all members.

Detailed Description

The Handle holds the information, and allows manipulation, of a connection between an Event Handler function and the Event itself.

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 !
     }
     


Public Member Functions

 Handle ()
 Create an empty 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.


Member Function Documentation

bool connect (  ) 

(Re-)Connect the slot with the signal.

Return values:
true the slot is connected.
false no valid signal or slot in this Handle

bool disconnect (  ) 

Disconnect the slot from the signal.

Return values:
true the slot is disconnected.
false no valid signal or slot in this Handle

bool connected (  )  const

Inspect if this Handle represents a connected signal and slot.

Returns:
true if a connection is present.

operator bool (  )  const

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

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

bool ready (  )  const

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

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


The documentation for this class was generated from the following file:
Generated on Fri Oct 19 16:27:24 2007 for Orocos by  doxygen 1.5.1