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

A scoped connection Handle of a (connected) slot which disconnects a slot from a signal in its destructor. More...

#include <rtt/Handle.hpp>

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

List of all members.

Public Member Functions

 ScopedHandle (const Handle &hs)
 ~ScopedHandle ()
 If connected, disconnect the slot from the signal.
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

A scoped connection Handle of a (connected) slot which disconnects a slot from a signal in its destructor.

This does not invalidate the connection if this handle is shared with another handle object. Meaning, if ScopedHandle disconnects(), another handle object may re-connect().

Definition at line 137 of file Handle.hpp.


Constructor & Destructor Documentation

If connected, disconnect the slot from the signal.

Calls this->disconnect(), but keeps the connection object alive.

Definition at line 98 of file Handle.cpp.

References RTT::Handle::disconnect().


Member Function Documentation

bool RTT::Handle::connect ( ) [inherited]

(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 RTT::Handle::connected(), and RTT::Handle::m_conn.

bool RTT::Handle::connected ( ) const [inherited]

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 RTT::Handle::m_conn.

Referenced by RTT::Handle::connect(), and RTT::Handle::disconnect().

bool RTT::Handle::disconnect ( ) [inherited]

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 RTT::Handle::connected(), and RTT::Handle::m_conn.

Referenced by ~ScopedHandle().

RTT::Handle::operator bool ( ) const [inherited]

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 RTT::Handle::m_conn.

bool RTT::Handle::ready ( ) const [inherited]

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 RTT::Handle::m_conn.

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


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