Orocos Real-Time Toolkit  2.8.3
Public Member Functions | Protected Attributes | List of all members
RTT::CleanupHandle Class Reference

A connection Handle of a (connected) slot which disconnects and cleans up (free all resources) the connection object in its destructor. More...

#include <rtt/Handle.hpp>

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

Public Member Functions

 CleanupHandle (const Handle &hs)
 
 ~CleanupHandle ()
 Cleanup all signal and slot connection resources. More...
 
bool connect ()
 (Re-)Connect the slot with the signal. More...
 
bool disconnect ()
 Disconnect the slot from the signal. More...
 
bool connected () const
 Inspect if this Handle represents a connected signal and slot. More...
 
 operator bool () const
 Inspect if this Handle is pointing to a valid (existing) connection. More...
 
bool ready () const
 Inspect if this handle is pointing to valid (existing) connection(s). More...
 

Protected Attributes

connection_t m_conn
 This is actually a smart pointer which always points to an existing connection object. More...
 

Detailed Description

A connection Handle of a (connected) slot which disconnects and cleans up (free all resources) the connection object in its destructor.

After CleanupHandle was destroyed, the connection is no longer usable and all associated callbacks have been removed. If another Handle object shares the same connection, it will no longer be able to connect().

Definition at line 163 of file Handle.hpp.

Constructor & Destructor Documentation

RTT::CleanupHandle::CleanupHandle ( const Handle hs)

Definition at line 102 of file Handle.cpp.

RTT::CleanupHandle::~CleanupHandle ( )

Cleanup all signal and slot connection resources.

If connected, disconnect the slot from the signal. Calls connection::destroy() on the connection object.

Definition at line 107 of file Handle.cpp.

References RTT::Handle::m_conn.

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.

Referenced by RTT::DataFlowInterface::addEventPort(), and RTT::internal::OROCOS_SIGNAL_N< R, SlotFunctionT >::connect().

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 RTT::DataFlowInterface::addEventPort(), and RTT::ScopedHandle::~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.

Member Data Documentation

connection_t RTT::Handle::m_conn
protectedinherited

This is actually a smart pointer which always points to an existing connection object.

Definition at line 126 of file Handle.hpp.

Referenced by RTT::Handle::connect(), RTT::Handle::connected(), RTT::Handle::disconnect(), RTT::Handle::operator bool(), RTT::Handle::ready(), and ~CleanupHandle().


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