RTI Connext Modern C++ API  Version 6.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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.
 
unsigned int indent () const
 Get the value of indent.
 
DynamicTypePrintFormatPropertyindent (unsigned int value)
 Set the amount of additional indent to be included when converting a DynamicType to a string.
 
bool print_ordinals () const
 Get the value of print_ordinals.
 
DynamicTypePrintFormatPropertyprint_ordinals (bool value)
 Set whether or not to print ordinal values when printing EnumTypes.
 

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

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

Initializes the properties.

Member Function Documentation

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

Get the value of indent.

See Also
indent(unsigned int value)
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
bool rti::core::xtypes::DynamicTypePrintFormatProperty::print_ordinals ( ) const
inline

Get the value of print_ordinals.

See Also
print_ordinals(bool value)
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

RTI Connext Modern C++ API Version 6.0.1 Copyright © Sat Nov 23 2019 Real-Time Innovations, Inc