/*
*
*
* Distributed under the Apache License.
* See: https://github.com/frehberg/rtps-gen/blob/master/LICENSE
*/
#ifndef DDS_DCPS_SUBSCRIPTION_EXT_IDL
#define DDS_DCPS_SUBSCRIPTION_EXT_IDL
// DDS extensions to the DDS Subscription Module
#include "dds/DdsDcpsSubscription.idl"
#include "dds/DdsDcpsGuid.idl"
module DDS
{
module DCPS
{
struct SubscriptionLostStatus {
::DDS::InstanceHandleSeq publication_handles;
};
typedef SubscriptionLostStatus SubscriptionDisconnectedStatus;
typedef SubscriptionLostStatus SubscriptionReconnectedStatus;
struct BudgetExceededStatus {
long total_count;
long total_count_change;
::DDS::InstanceHandle_t last_instance_handle;
};
/// Collection of latency statistics for a single association.
struct LatencyStatistics {
GUID_t publication;
unsigned long n;
double maximum;
double minimum;
double mean;
double variance;
};
local interface DataReaderListener : ::DDS::DataReaderListener {
// Called when a connection failure has been detected
// and there are still associations using the connection
// after the configurable graceful_disconnected_period.
// When connection is gracefully disconnected, this callback
// is also triggered.
void on_subscription_disconnected(
in ::DDS::DataReader reader,
in SubscriptionDisconnectedStatus status);
// Called when a disconnected connection
// has been reconnected.
void on_subscription_reconnected(
in ::DDS::DataReader reader,
in SubscriptionReconnectedStatus status);
// called when a connection is lost and hence one
// or more associations from this subscription to
// some publishers have been lost.
// A connection is "lost" when the retry attempts
// have been exhausted.
void on_subscription_lost(
in ::DDS::DataReader reader,
in SubscriptionLostStatus status);
// called when the connection object is cleaned up and
// the reconnect thread exits.
// This hook is added for testing the reconnect thread
// leaking problem when the subscriber crashes.
void on_connection_deleted(
in ::DDS::DataReader reader);
// Called when the latency budget has been exceeded.
void on_budget_exceeded(
in ::DDS::DataReader reader,
in BudgetExceededStatus status);
};
#ifndef DDS_SAFETY_PROFILE
typedef sequence<LatencyStatistics> LatencyStatisticsSeq;
local interface DataReaderEx : ::DDS::DataReader {
/// Obtain a sequence of statistics summaries.
void get_latency_stats( inout LatencyStatisticsSeq stats);
/// Clear any intermediate statistical values.
void reset_latency_stats();
/// Statistics gathering enable state.
attribute boolean statistics_enabled;
};
#else
local interface DataReaderEx : ::DDS::DataReader { };
#endif
};
};
#endif /* DDS_DCPS_SUBSCRIPTION_EXT_IDL */