Skip to content

Commit

Permalink
add to pyrealdds topic_writer:: and topic_reader::qos repr
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Apr 9, 2024
1 parent 29ce06f commit f47e8e5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions third-party/realdds/py/pyrealdds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <realdds/dds-guid.h>
#include <realdds/dds-time.h>
#include <realdds/dds-topic.h>
#include <realdds/dds-serialization.h>
#include <realdds/dds-topic-reader.h>
#include <realdds/dds-topic-writer.h>
#include <realdds/dds-publisher.h>
Expand Down Expand Up @@ -336,7 +337,11 @@ PYBIND11_MODULE(NAME, m) {
py::class_< reader_qos >( m, "reader_qos" ) //
.def( "__repr__", []( reader_qos const & self ) {
std::ostringstream os;
os << "<" SNAME ".reader_qos";
os << "<" SNAME ".reader_qos " << self.reliability();
if( ! ( self.durability() == eprosima::fastdds::dds::DurabilityQosPolicy() ) )
os << /*" durability"*/ " " << self.durability();
if( ! ( self.liveliness() == eprosima::fastdds::dds::LivelinessQosPolicy() ) )
os << " liveliness" " " << self.liveliness();
os << ">";
return os.str();
} );
Expand Down Expand Up @@ -364,7 +369,11 @@ PYBIND11_MODULE(NAME, m) {
py::class_< writer_qos >( m, "writer_qos" ) //
.def( "__repr__", []( writer_qos const & self ) {
std::ostringstream os;
os << "<" SNAME ".writer_qos";
os << "<" SNAME ".writer_qos " << self.reliability();
if( ! ( self.durability() == eprosima::fastdds::dds::DurabilityQosPolicy() ) )
os << /*" durability"*/ " " << self.durability();
if( ! ( self.liveliness() == eprosima::fastdds::dds::LivelinessQosPolicy() ) )
os << " liveliness" " " << self.liveliness();
os << ">";
return os.str();
} );
Expand Down

0 comments on commit f47e8e5

Please sign in to comment.