Class astutedds::dcps::LivelinessManager

ClassList > astutedds > dcps > LivelinessManager

Liveliness Manager for participant-level liveliness monitoring. More...

  • #include <liveliness_manager.hpp>

Public Functions

Type Name
LivelinessManager (const rtps::GUID_t & participant_guid)
Construct a new Liveliness Manager.
LivelinessManager (const LivelinessManager &) = delete
void add_remote_writer (const rtps::GUID_t & writer_guid, const LivelinessQosPolicy & qos)
Register a remote writer discovered through SEDP.
int32_t alive_count () const
Get count of alive writers.
bool assert_liveliness (const rtps::GUID_t & writer_guid)
Assert liveliness for a specific writer (MANUAL_BY_TOPIC)
bool assert_liveliness_for_participant ()
Assert liveliness for all writers in participant (MANUAL_BY_PARTICIPANT)
LivelinessChangedStatus get_liveliness_changed_status () const
Get liveliness changed status for reader monitoring.
LivelinessStatus get_status (const rtps::GUID_t & writer_guid) const
Get liveliness status for a writer.
bool is_writer_alive (const rtps::GUID_t & writer_guid) const
Check if a specific writer is alive.
int32_t not_alive_count () const
Get count of not-alive writers.
void on_data_received (const rtps::GUID_t & writer_guid)
Update liveliness based on received data/heartbeat.
LivelinessManager & operator= (const LivelinessManager &) = delete
void register_writer (const rtps::GUID_t & writer_guid, const LivelinessQosPolicy & qos)
Register a local DataWriter for liveliness management.
void remove_remote_writer (const rtps::GUID_t & writer_guid)
Remove a remote writer.
void set_liveliness_changed_callback (LivelinessChangedCallback callback)
Set callback for liveliness changed events.
void set_liveliness_lost_callback (LivelinessLostCallback callback)
Set callback for liveliness lost events (for writers)
void start ()
Start the liveliness monitoring thread.
void stop ()
Stop the liveliness monitoring thread.
void unregister_writer (const rtps::GUID_t & writer_guid)
Unregister a local DataWriter .
~LivelinessManager ()
Destroy the Liveliness Manager.

Detailed Description

Manages liveliness for all DataWriters within a DomainParticipant. Handles automatic liveliness assertion for AUTOMATIC mode, and monitors lease expiration for all modes.

Public Functions Documentation

function LivelinessManager [1/2]

Construct a new Liveliness Manager.

explicit astutedds::dcps::LivelinessManager::LivelinessManager (
    const rtps::GUID_t & participant_guid
) 

Parameters:

  • participant_guid GUID of the owning participant

function LivelinessManager [2/2]

astutedds::dcps::LivelinessManager::LivelinessManager (
    const LivelinessManager &
) = delete

function add_remote_writer

Register a remote writer discovered through SEDP.

void astutedds::dcps::LivelinessManager::add_remote_writer (
    const rtps::GUID_t & writer_guid,
    const LivelinessQosPolicy & qos
) 

Parameters:

  • writer_guid GUID of the remote writer
  • qos Liveliness QoS policy

function alive_count

Get count of alive writers.

int32_t astutedds::dcps::LivelinessManager::alive_count () const

Returns:

Number of alive writers


function assert_liveliness

Assert liveliness for a specific writer (MANUAL_BY_TOPIC)

bool astutedds::dcps::LivelinessManager::assert_liveliness (
    const rtps::GUID_t & writer_guid
) 

Parameters:

  • writer_guid GUID of the writer

Returns:

true if assertion was successful


function assert_liveliness_for_participant

Assert liveliness for all writers in participant (MANUAL_BY_PARTICIPANT)

bool astutedds::dcps::LivelinessManager::assert_liveliness_for_participant () 

Returns:

true if assertion was successful


function get_liveliness_changed_status

Get liveliness changed status for reader monitoring.

LivelinessChangedStatus astutedds::dcps::LivelinessManager::get_liveliness_changed_status () const

Returns:

Current liveliness changed status


function get_status

Get liveliness status for a writer.

LivelinessStatus astutedds::dcps::LivelinessManager::get_status (
    const rtps::GUID_t & writer_guid
) const

Parameters:

  • writer_guid GUID of the writer

Returns:

Current liveliness status


function is_writer_alive

Check if a specific writer is alive.

bool astutedds::dcps::LivelinessManager::is_writer_alive (
    const rtps::GUID_t & writer_guid
) const

Parameters:

  • writer_guid GUID of the writer

Returns:

true if writer is alive


function not_alive_count

Get count of not-alive writers.

int32_t astutedds::dcps::LivelinessManager::not_alive_count () const

Returns:

Number of not-alive writers


function on_data_received

Update liveliness based on received data/heartbeat.

void astutedds::dcps::LivelinessManager::on_data_received (
    const rtps::GUID_t & writer_guid
) 

Parameters:

  • writer_guid GUID of the writer

function operator=

LivelinessManager & astutedds::dcps::LivelinessManager::operator= (
    const LivelinessManager &
) = delete

function register_writer

Register a local DataWriter for liveliness management.

void astutedds::dcps::LivelinessManager::register_writer (
    const rtps::GUID_t & writer_guid,
    const LivelinessQosPolicy & qos
) 

Parameters:

  • writer_guid GUID of the writer
  • qos Liveliness QoS policy

function remove_remote_writer

Remove a remote writer.

void astutedds::dcps::LivelinessManager::remove_remote_writer (
    const rtps::GUID_t & writer_guid
) 

Parameters:

  • writer_guid GUID of the remote writer

function set_liveliness_changed_callback

Set callback for liveliness changed events.

void astutedds::dcps::LivelinessManager::set_liveliness_changed_callback (
    LivelinessChangedCallback callback
) 

Parameters:

  • callback Function to call when liveliness changes

function set_liveliness_lost_callback

Set callback for liveliness lost events (for writers)

void astutedds::dcps::LivelinessManager::set_liveliness_lost_callback (
    LivelinessLostCallback callback
) 

Parameters:

  • callback Function to call when writer loses liveliness

function start

Start the liveliness monitoring thread.

void astutedds::dcps::LivelinessManager::start () 


function stop

Stop the liveliness monitoring thread.

void astutedds::dcps::LivelinessManager::stop () 


function unregister_writer

Unregister a local DataWriter .

void astutedds::dcps::LivelinessManager::unregister_writer (
    const rtps::GUID_t & writer_guid
) 

Parameters:

  • writer_guid GUID of the writer

function ~LivelinessManager

Destroy the Liveliness Manager.

astutedds::dcps::LivelinessManager::~LivelinessManager () 



The documentation for this class was generated from the following file include/astutedds/dcps/liveliness_manager.hpp