Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix statistics header file inclusion [11614] #1983

Merged
merged 2 commits into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions include/fastdds/rtps/reader/RTPSReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@
#include <fastrtps/qos/LivelinessChangedStatus.h>
#include <fastrtps/utils/TimedConditionVariable.hpp>

#ifdef FASTDDS_STATISTICS
#include <fastdds/statistics/rtps/StatisticsCommon.hpp>
#else
#include <fastdds/statistics/rtps/StatisticsCommonEmpty.hpp>
#endif // FASTDDS_STATISTICS

namespace eprosima {
namespace fastrtps {
Expand Down
4 changes: 0 additions & 4 deletions include/fastdds/rtps/writer/RTPSWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
#include <fastrtps/qos/LivelinessLostStatus.h>
#include <fastrtps/utils/collections/ResourceLimitedVector.hpp>

#ifdef FASTDDS_STATISTICS
#include <fastdds/statistics/rtps/StatisticsCommon.hpp>
#else
#include <fastdds/statistics/rtps/StatisticsCommonEmpty.hpp>
#endif // FASTDDS_STATISTICS

namespace eprosima {
namespace fastrtps {
Expand Down
119 changes: 119 additions & 0 deletions include/fastdds/statistics/rtps/StatisticsCommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class RTPSMessageGroup;
namespace fastdds {
namespace statistics {

#ifdef FASTDDS_STATISTICS

// Members are private details
struct StatisticsAncillary;

Expand Down Expand Up @@ -256,6 +258,123 @@ class StatisticsReaderImpl
uint32_t payload);
};

#else // when FASTDDS_STATISTICS is not defined a dummy implementation is used

class StatisticsWriterImpl
{
protected:

// TODO: methods for listeners callbacks

/**
* @brief Report a change on the number of DATA / DATAFRAG submessages sent for a specific sample.
* @param SampleIdentity of the affected sample.
* @param Current total number of submessages sent for the affected sample.
*/
inline void on_sample_datas(
const fastrtps::rtps::SampleIdentity&,
size_t)
{
}

/**
* @brief Report that a HEARTBEAT message is sent
* @param current count of heartbeats
*/
inline void on_heartbeat(
uint32_t)
{
}

/**
* @brief Report that a DATA / DATA_FRAG message is generated
* @param number of locators to which the message will be sent
*/
inline void on_data_generated(
size_t)
{
}

/// Notify listeners of DATA / DATA_FRAG counts
inline void on_data_sent()
{
}

/**
* @brief Reports publication throughtput based on last added sample to writer's history
* @param size of the message sent
*/
inline void on_publish_throughput(
uint32_t)
{
}

/// Report that a GAP message is sent
inline void on_gap()
{
}

/*
* @brief Report that several changes are marked for redelivery
* @param number of changes to redeliver
*/
inline void on_resent_data(
uint32_t)
{
}

};

class StatisticsReaderImpl
{
friend class fastrtps::rtps::RTPSMessageGroup;

protected:

// TODO: methods for listeners callbacks

/**
* @brief Report that a sample has been notified to the user.
* @param GUID of the writer from where the sample was received.
* @param Source timestamp received from the writer for the sample being notified.
*/
inline void on_data_notify(
const fastrtps::rtps::GUID_t&,
const fastrtps::rtps::Time_t&)
{
}

/**
* @brief Report that an ACKNACK message is sent
* @param current count of ACKNACKs
*/
inline void on_acknack(
int32_t)
{
}

/**
* @brief Report that a NACKFRAG message is sent
* @param current count of NACKFRAGs
*/
inline void on_nackfrag(
int32_t)
{
}

/**
* @brief Reports subscription throughtput based on last added sample to reader's history
* @param size of the message received
*/
inline void on_subscribe_throughput(
uint32_t)
{
}

};

#endif // FASTDDS_STATISTICS

} // namespace statistics
} // namespace fastdds
} // namespace eprosima
Expand Down
158 changes: 0 additions & 158 deletions include/fastdds/statistics/rtps/StatisticsCommonEmpty.hpp

This file was deleted.