RTI Connext Modern C++ API  Version 6.1.2
rti::core::xtypes::DynamicTypePrintFormatProperty Class Reference

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

#include <rti/core/xtypes/DynamicTypePrintFormat.hpp>

Public Member Functions

 DynamicTypePrintFormatProperty (unsigned int indent_in=0, bool print_ordinals_in=false)
 Initializes the properties. More...
 
unsigned int indent () const
 Get the value of indent. More...
 
DynamicTypePrintFormatPropertyindent (unsigned int value)
 Set the amount of additional indent to be included when converting a DynamicType to a string. More...
 
bool print_ordinals () const
 Get the value of print_ordinals. More...
 
DynamicTypePrintFormatPropertyprint_ordinals (bool value)
 Set whether or not to print ordinal values when printing EnumTypes. More...
 

Detailed Description

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

See also
rti::core::xtypes::to_string

Constructor & Destructor Documentation

◆ DynamicTypePrintFormatProperty()

rti::core::xtypes::DynamicTypePrintFormatProperty::DynamicTypePrintFormatProperty ( unsigned int  indent_in = 0,
bool  print_ordinals_in = false 
)
inlineexplicit

Initializes the properties.

Member Function Documentation

◆ indent() [1/2]

unsigned int rti::core::xtypes::DynamicTypePrintFormatProperty::indent ( ) const
inline

Get the value of indent.

See also
indent(unsigned int value)

◆ indent() [2/2]

DynamicTypePrintFormatProperty& rti::core::xtypes::DynamicTypePrintFormatProperty::indent ( unsigned int  value)
inline

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

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

struct myType {
      long x;
  };

Using an indent of 1, the same TypeCode would be printed as:

      struct myType {
          long x;
      };

I.e., the entire structure is indented.

Parameters
valueThe value to set for indent

◆ print_ordinals() [1/2]

bool rti::core::xtypes::DynamicTypePrintFormatProperty::print_ordinals ( ) const
inline

Get the value of print_ordinals.

See also
print_ordinals(bool value)

◆ print_ordinals() [2/2]

DynamicTypePrintFormatProperty& rti::core::xtypes::DynamicTypePrintFormatProperty::print_ordinals ( bool  value)
inline

Set whether or not to print ordinal values when printing EnumTypes.

When set to true, the ordinal value of each enumerator within an enum will be printed, otherwise only non-default ordinals are printed. Take for example the following enum:

enum myEnum {
      RED,
      GREEN = 3,
      BLUE,
  };

When print_ordinals is set to false it would be printed as:

enum myEnum {
      RED,
      GREEN = 3,
      BLUE,
  };

But with print_ordinals set to true it would be printed as:

enum myEnum {
      RED = 0,
      GREEN = 3,
      BLUE = 4,
  };
Parameters
valueThe value to set for print_ordinals