Skip to content

Commit

Permalink
Refs #20815: Use alias for TypeTraits::DataListType in PubSub* classes
Browse files Browse the repository at this point in the history
Signed-off-by: eduponz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz committed Jun 5, 2024
1 parent 1e196dc commit f1a5840
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
13 changes: 7 additions & 6 deletions test/blackbox/api/dds-pim/PubSubReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class PubSubReader

typedef TypeSupport type_support;
typedef typename type_support::type type;
typedef typename TypeTraits::DataListType datalist_type;

protected:

Expand Down Expand Up @@ -529,14 +530,14 @@ class PubSubReader
initialized_ = false;
}

std::list<typename TypeTraits::DataListType> data_not_received()
std::list<datalist_type> data_not_received()
{
std::unique_lock<std::mutex> lock(mutex_);
return total_msgs_;
}

eprosima::fastrtps::rtps::SequenceNumber_t startReception(
const std::list<typename TypeTraits::DataListType>& msgs)
const std::list<datalist_type>& msgs)
{
mutex_.lock();
total_msgs_ = msgs;
Expand Down Expand Up @@ -672,7 +673,7 @@ class PubSubReader
if (info_seq[n].valid_data)
{
auto it = std::find_if(expected_messages.begin(), expected_messages.end(),
[&](const typename TypeTraits::DataListType& elem)
[&](const datalist_type& elem)
{
return TypeTraits::compare_data(data_seq[n], elem);
});
Expand Down Expand Up @@ -1940,7 +1941,7 @@ class PubSubReader
if (!total_msgs_.empty())
{
auto it = std::find_if(total_msgs_.begin(), total_msgs_.end(),
[&](const typename TypeTraits::DataListType& elem)
[&](const datalist_type& elem)
{
return TypeTraits::compare_data(*data, elem);
});
Expand Down Expand Up @@ -2004,7 +2005,7 @@ class PubSubReader
if (!total_msgs_.empty())
{
auto it = std::find_if(total_msgs_.begin(), total_msgs_.end(),
[&data](const typename TypeTraits::DataListType& elem)
[&data](const datalist_type& elem)
{
return TypeTraits::compare_data(data, elem);
});
Expand Down Expand Up @@ -2104,7 +2105,7 @@ class PubSubReader
eprosima::fastrtps::rtps::GUID_t participant_guid_;
eprosima::fastrtps::rtps::GUID_t datareader_guid_;
bool initialized_;
std::list<typename TypeTraits::DataListType> total_msgs_;
std::list<datalist_type> total_msgs_;
std::mutex mutex_;
std::condition_variable cv_;
std::mutex mutexDiscovery_;
Expand Down
3 changes: 2 additions & 1 deletion test/blackbox/api/dds-pim/PubSubWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ class PubSubWriter

typedef TypeSupport type_support;
typedef typename type_support::type type;
typedef typename TypeTraits::DataListType datalist_type;

PubSubWriter(
const std::string& topic_name)
Expand Down Expand Up @@ -495,7 +496,7 @@ class PubSubWriter
}

void send(
std::list<typename TypeTraits::DataListType>& msgs,
std::list<datalist_type>& msgs,
uint32_t milliseconds = 0)
{
auto it = msgs.begin();
Expand Down
11 changes: 6 additions & 5 deletions test/blackbox/api/dds-pim/PubSubWriterReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ class PubSubWriterReader

typedef TypeSupport type_support;
typedef typename type_support::type type;
typedef typename TypeTraits::DataListType datalist_type;

PubSubWriterReader(
const std::string& topic_name)
Expand Down Expand Up @@ -540,7 +541,7 @@ class PubSubWriterReader
}

void send(
std::list<typename TypeTraits::DataListType>& msgs)
std::list<datalist_type>& msgs)
{
auto it = msgs.begin();

Expand All @@ -564,14 +565,14 @@ class PubSubWriterReader
}
}

std::list<typename TypeTraits::DataListType> data_not_received()
std::list<datalist_type> data_not_received()
{
std::unique_lock<std::mutex> lock(mutex_);
return total_msgs_;
}

void startReception(
std::list<typename TypeTraits::DataListType>& msgs)
std::list<datalist_type>& msgs)
{
mutex_.lock();
total_msgs_ = msgs;
Expand Down Expand Up @@ -928,7 +929,7 @@ class PubSubWriterReader
if (info.instance_state == eprosima::fastdds::dds::ALIVE_INSTANCE_STATE)
{
auto it = std::find_if(total_msgs_.begin(), total_msgs_.end(),
[&](const typename TypeTraits::DataListType& elem)
[&](const datalist_type& elem)
{
return TypeTraits::compare_data(elem, *data);
});
Expand Down Expand Up @@ -1020,7 +1021,7 @@ class PubSubWriterReader

std::string topic_name_;
bool initialized_;
std::list<typename TypeTraits::DataListType> total_msgs_;
std::list<datalist_type> total_msgs_;
std::mutex mutex_;
std::condition_variable cv_;
std::mutex mutexDiscovery_;
Expand Down

0 comments on commit f1a5840

Please sign in to comment.