Skip to content

Commit

Permalink
Refs #21280: Uncrustify
Browse files Browse the repository at this point in the history
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
  • Loading branch information
elianalf committed Jul 22, 2024
1 parent 78357ea commit bed9b14
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
9 changes: 5 additions & 4 deletions examples/cpp/rtps_entities/ReaderApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ void eprosima::fastcdr::deserialize(
switch (mid.id)
{
case 0:
dcdr >> data.index();
dcdr >> data.index();
break;

case 1:
dcdr >> data.message();
dcdr >> data.message();
break;

default:
Expand Down Expand Up @@ -123,7 +123,7 @@ ReaderApp::ReaderApp(
reader_qos.m_durability.kind = eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS;
reader_qos.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS;

// Register entity
// Register entity
if (!rtps_participant_->registerReader(rtps_reader_, topic_att, reader_qos))
{
throw std::runtime_error("Entity registration failed");
Expand Down Expand Up @@ -168,7 +168,8 @@ void ReaderApp::on_new_cache_change_added(
{
if (deserialize_payload(change->serializedPayload, data_))
{
std::cout << "Message: " << data_->message() << " with index " << data_->index() << " RECEIVED" << std::endl;
std::cout << "Message: " << data_->message() << " with index " << data_->index() << " RECEIVED" <<
std::endl;
samples_received_++;
}
else
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/rtps_entities/ReaderApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class ReaderApp : public Application, public ReaderListener
public:

ReaderApp(
const CLIParser::rtps_entities_config& config,
const std::string& topic_name);
const CLIParser::rtps_entities_config& config,
const std::string& topic_name);

virtual ~ReaderApp();

Expand Down
10 changes: 5 additions & 5 deletions examples/cpp/rtps_entities/WriterApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void eprosima::fastcdr::serialize<HelloWorld>(
scdr.end_serialize_type(current_state);
}


using namespace eprosima::fastdds;
using namespace eprosima::fastdds::rtps;

Expand Down Expand Up @@ -150,7 +149,7 @@ void WriterApp::run()
{
while (!is_stopped() && ((samples_ == 0) || (samples_sent_ < samples_)))
{
if(add_change_to_history())
if (add_change_to_history())
{
std::cout << "Message " << data_->message() << " with index " << data_->index() << " SENT" << std::endl;
}
Expand All @@ -174,7 +173,8 @@ bool WriterApp::serialize_payload(
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
eprosima::fastcdr::CdrVersion::XCDRv1);

payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;

Expand Down Expand Up @@ -226,13 +226,13 @@ bool WriterApp::add_change_to_history()
}

data_->message("Hello World");
data_->index(data_->index()+1);
data_->index(data_->index() + 1);

if (serialize_payload(data_, ch->serializedPayload))
{
++samples_sent_;

if(writer_history_->add_change(ch))
if (writer_history_->add_change(ch))
{
ret = true;
}
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/rtps_entities/WriterApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class WriterApp : public Application, public WriterListener
public:

WriterApp(
const CLIParser::rtps_entities_config& config,
const std::string& topic_name);
const CLIParser::rtps_entities_config& config,
const std::string& topic_name);

virtual ~WriterApp();

Expand All @@ -69,8 +69,8 @@ class WriterApp : public Application, public WriterListener

//! Serialize payload
bool serialize_payload(
const HelloWorld* data,
eprosima::fastdds::rtps::SerializedPayload_t& payload);
const HelloWorld* data,
eprosima::fastdds::rtps::SerializedPayload_t& payload);

uint16_t samples_;

Expand Down

0 comments on commit bed9b14

Please sign in to comment.