Skip to content

Commit

Permalink
Clarify the Topic QoS logs
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <[email protected]>
  • Loading branch information
Tempate committed Dec 4, 2023
1 parent 6b33623 commit 69105a4
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
27 changes: 27 additions & 0 deletions ddspipe_core/include/ddspipe_core/types/dds/TopicQoS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ std::ostream& operator <<(
std::ostream& os,
const DurabilityKind& kind);

/**
* @brief The operator << must be overloaded for Fuzzy so that the \c DurabilityKind overloaded operator << gets
* called.
*/
DDSPIPE_CORE_DllAPI
std::ostream& operator <<(
std::ostream& os,
const utils::Fuzzy<DurabilityKind>& qos);

/**
* @brief \c ReliabilityKind to stream serialization
*/
Expand All @@ -218,6 +227,15 @@ std::ostream& operator <<(
std::ostream& os,
const ReliabilityKind& kind);

/**
* @brief The operator << must be overloaded for Fuzzy so that the \c ReliabilityKind overloaded operator << gets
* called.
*/
DDSPIPE_CORE_DllAPI
std::ostream& operator <<(
std::ostream& os,
const utils::Fuzzy<ReliabilityKind>& qos);

/**
* @brief \c OwnershipQosPolicyKind to stream serialization
*/
Expand All @@ -226,6 +244,15 @@ std::ostream& operator <<(
std::ostream& os,
const OwnershipQosPolicyKind& qos);

/**
* @brief The operator << must be overloaded for Fuzzy so that the \c OwnershipQosPolicyKind overloaded operator << gets
* called.
*/
DDSPIPE_CORE_DllAPI
std::ostream& operator <<(
std::ostream& os,
const utils::Fuzzy<OwnershipQosPolicyKind>& qos);

/**
* @brief \c TopicQoS to stream serialization
*/
Expand Down
31 changes: 28 additions & 3 deletions ddspipe_core/src/cpp/types/dds/TopicQoS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ std::ostream& operator <<(
return os;
}

std::ostream& operator <<(
std::ostream& os,
const utils::Fuzzy<DurabilityKind>& qos)
{
os << "Fuzzy{Level(" << qos.get_level_as_str() << ") " << qos.get_reference() << "}";
return os;
}

std::ostream& operator <<(
std::ostream& os,
const ReliabilityKind& kind)
Expand All @@ -199,6 +207,14 @@ std::ostream& operator <<(
return os;
}

std::ostream& operator <<(
std::ostream& os,
const utils::Fuzzy<ReliabilityKind>& qos)
{
os << "Fuzzy{Level(" << qos.get_level_as_str() << ") " << qos.get_reference() << "}";
return os;
}

std::ostream& operator <<(
std::ostream& os,
const OwnershipQosPolicyKind& kind)
Expand All @@ -221,14 +237,23 @@ std::ostream& operator <<(
return os;
}

std::ostream& operator <<(
std::ostream& os,
const utils::Fuzzy<OwnershipQosPolicyKind>& qos)
{
os << "Fuzzy{Level(" << qos.get_level_as_str() << ") " << qos.get_reference() << "}";
return os;
}

std::ostream& operator <<(
std::ostream& os,
const TopicQoS& qos)
{
os <<
"TopicQoS{" << qos.durability_qos <<
";" << qos.reliability_qos <<
";" << qos.ownership_qos <<
"TopicQoS{" <<
"durability(" << qos.durability_qos << ")" <<
";reliability(" << qos.reliability_qos << ")" <<
";ownership(" << qos.ownership_qos << ")" <<
(qos.has_partitions() ? ";partitions" : "") <<
(qos.keyed ? ";keyed" : "") <<
";depth(" << qos.history_depth << ")" <<
Expand Down

0 comments on commit 69105a4

Please sign in to comment.