RTI Connext Modern C++ API
Version 6.1.2
|
<<reference-type>> Automatically manages the association of an Entity and a Listener More...
#include <rti/core/ListenerBinder.hpp>
Public Member Functions | |
Listener * | get () |
(Deprecated) Use listener() More... | |
const Listener * | get () const |
(Deprecated) Use listener() More... | |
Listener * | listener () |
Retrieves the listener. More... | |
const Listener * | listener () const |
Retrieves the listener. More... | |
Entity | entity () const |
Retrieves the Entity associated with the listener. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Entity , typename Listener > | |
ListenerBinder< Entity, Listener > | bind_listener (Entity entity, Listener *the_listener, dds::core::status::StatusMask mask) |
Sets the listener and creates a ListenerBinder that automatically resets it when all references go out of scope. More... | |
template<typename Entity , typename Listener > | |
ListenerBinder< Entity, Listener > | bind_listener (Entity entity, Listener *the_listener) |
Sets the listener and creates a ListenerBinder that automatically resets it when all references go out of scope. More... | |
template<typename Entity , typename Listener > | |
ListenerBinder< Entity, Listener > | bind_and_manage_listener (Entity entity, Listener *the_listener, dds::core::status::StatusMask mask) |
Sets the listener and creates a ListenerBinder that automatically resets and deletes it when all references go out of scope. More... | |
template<typename Entity , typename Listener > | |
ListenerBinder< Entity, Listener > | bind_and_manage_listener (Entity entity, Listener *the_listener) |
Sets the listener and creates a ListenerBinder that automatically resets and deletes it when all references go out of scope. More... | |
<<reference-type>> Automatically manages the association of an Entity and a Listener
[DEPRECATED] The use of ListenerBinder is no longer required as long as the a std::shared_ptr
is used to set an Entity's listener.
Ties the association listener/Entity to the existence of references to this type–that is, the constructor sets the listener; when the last reference is destroyed, the entity's listener is unset. Depending on how this type is created, the listener may also be deleted:
rti::core::bind_listener()
creates a ListenerBinder that doesn't own the listener and won't delete itrti::core::bind_and_manage_listener()
creates a ListenerBinder that owns the listener and will delete it.The goal is to simplify the destruction of an Entity by the application, which otherwise would have to reset the listener or close the Entity explicitly.
Example:
To create a ListenerBinder use rti::core::bind_listener() or rti::core::bind_and_manage_listener(). To retrieve the listener use ListenerBinder::listener(); to retrieve the entity, use ListenerBinder::entity().
If the Entity changes its listener while references to this ListenerBinder still exist, the ListenerBinder will not reset the listener.
Entity | A subclass of dds::core::Entity |
Listener | The listener type, by default Entity::Listener |
|
inline |
(Deprecated) Use listener()
|
inline |
(Deprecated) Use listener()
|
inline |
Retrieves the listener.
|
inline |
Retrieves the listener.
|
inline |
Retrieves the Entity associated with the listener.
Referenced by rti::core::bind_and_manage_listener(), and rti::core::bind_listener().
|
related |
Sets the listener and creates a ListenerBinder that automatically resets it when all references go out of scope.
[DEPRECATED] The use of ListenerBinder is no longer required as long as the a std::shared_ptr
is used to set an Entity's listener.
The ListenerBinder created from this function does not delete the listener, it simply sets the listener back to NULL in the Entity. The application is responsible for the life-cycle of the listener.
To also delete the listener when all references go out of scope, see bind_and_manage_listener().
|
related |
Sets the listener and creates a ListenerBinder that automatically resets it when all references go out of scope.
[DEPRECATED] The use of ListenerBinder is no longer required as long as the a std::shared_ptr
is used to set an Entity's listener.
This overload works for listeners that don't use a mask
|
related |
Sets the listener and creates a ListenerBinder that automatically resets and deletes it when all references go out of scope.
[DEPRECATED] The use of ListenerBinder is no longer required as long as the a std::shared_ptr
is used to set an Entity's listener.
Example:
|
related |
Sets the listener and creates a ListenerBinder that automatically resets and deletes it when all references go out of scope.
[DEPRECATED] The use of ListenerBinder is no longer required as long as the a std::shared_ptr
is used to set an Entity's listener.
This overload works for listeners that don't use a mask