RTI Connext Modern C++ API  Version 7.0.0
rti::core::QosPrintFormat Class Reference

<<extension>> <<value-type>> A collection of attributes used to configure how QoS will be formatted when converted to strings. More...

#include <rti/core/QosPrintFormat.hpp>

Public Member Functions

 QosPrintFormat ()
 Initializes the properties with the default values. More...
 
 QosPrintFormat (unsigned int indent_in, bool print_private_in, bool is_standalone_in)
 Initializes the properties. More...
 
unsigned int indent () const
 Get the value of indent. More...
 
QosPrintFormatindent (unsigned int value)
 Set the amount of additional indent to be included when converting a QoS to a string. More...
 
bool print_private () const
 Get the value of print_private. More...
 
QosPrintFormatprint_private (bool value)
 Set whether or not to print private Qos fields. More...
 
bool is_standalone () const
 Get the value of is_standalone. More...
 
QosPrintFormatis_standalone (bool value)
 Set whether or not to print the XML preamble. More...
 

Detailed Description

<<extension>> <<value-type>> A collection of attributes used to configure how QoS will be formatted when converted to strings.

Constructor & Destructor Documentation

◆ QosPrintFormat() [1/2]

rti::core::QosPrintFormat::QosPrintFormat ( )
inline

Initializes the properties with the default values.

◆ QosPrintFormat() [2/2]

rti::core::QosPrintFormat::QosPrintFormat ( unsigned int  indent_in,
bool  print_private_in,
bool  is_standalone_in 
)
inline

Initializes the properties.

Member Function Documentation

◆ indent() [1/2]

unsigned int rti::core::QosPrintFormat::indent ( ) const
inline

Get the value of indent.

See also
indent(unsigned int value)

◆ indent() [2/2]

QosPrintFormat& rti::core::QosPrintFormat::indent ( unsigned int  value)
inline

Set the amount of additional indent to be included when converting a QoS to a string.

Configures how much additional indent is applied when converting a QoS to a string. This value acts as a total offset on the string, increasing the indent which is applied to all elements by the same amount. With indent set to 0, a string representation of a QoS may appear as:

  <datareader_qos>
      <durability>
          <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind>
      </durability>
  </datareader_qos>

Setting the indent property to 1, the same QoS would be printed as:

      <datareader_qos>
          <durability>
              <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind>
          </durability>
      </datareader_qos>

I.e., the entire structure is indented.

[default] 0

Parameters
valueThe value to set for indent

◆ print_private() [1/2]

bool rti::core::QosPrintFormat::print_private ( ) const
inline

Get the value of print_private.

See also
print_private(bool value)

◆ print_private() [2/2]

QosPrintFormat& rti::core::QosPrintFormat::print_private ( bool  value)
inline

Set whether or not to print private Qos fields.

There are some QoS policies which are not intended for external use. By default, these QoS policies are only printed if they are different to the default value for that policy. When true, private policies are treated like any other policy, and printed if they are different to the supplied base QoS. These private policies cannot be parsed from XML, and are always printed as XML comments.

[default] false

Parameters
valueThe value to set for print_private.

◆ is_standalone() [1/2]

bool rti::core::QosPrintFormat::is_standalone ( ) const
inline

Get the value of is_standalone.

See also
print_private(bool value)

◆ is_standalone() [2/2]

QosPrintFormat& rti::core::QosPrintFormat::is_standalone ( bool  value)
inline

Set whether or not to print the XML preamble.

The default value for this property (false) results in QoS being printed starting from the <ENTITY_qos> tag (where the <ENTITY_qos> tag is, e.g., <domain_participant_qos>, or, <datareader_qos>. This result cannot be directly parsed as valid XML (as it lacks <dds>, <qos_library>, and <qos_profile> tags). If is_standalone is set to true, these additional tags are printed, resulting in valid, parseable XML.

For example, with is_standalone set to false, a Qos may appear as:

  <datareader_qos>
      <durability>
          <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind>
      </durability>
  </datareader_qos>

Setting is_standalone to true would result in the same Qos being printed as:

  <?xml version="1.0"?>
  <dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <qos_library name="QosLibrary">
          <qos_profile name="QosProfile">
              <datareader_qos>
                  <durability>
                      <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind>
                  </durability>
              </datareader_qos>
          </qos_profile>
      </qos_library>
  </dds> 

[default] false

Parameters
valueThe value to set for is_standalone.