RTI Connext Modern C++ API Version 7.3.0
|
<<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, const DynamicTypePrintKind print_kind_in=rti::core::xtypes::DynamicTypePrintKind::idl, bool print_complete_type_in=false) | |
Initializes the properties. More... | |
unsigned int | indent () const |
Get the value of indent. More... | |
DynamicTypePrintFormatProperty & | indent (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... | |
DynamicTypePrintFormatProperty & | print_ordinals (bool value) |
Set whether or not to print ordinal values when printing EnumTypes. More... | |
DynamicTypePrintKind | print_kind () const |
Get the value of print_kind. More... | |
DynamicTypePrintFormatProperty & | print_kind (DynamicTypePrintKind value) |
Sets the format to use when printing the TypeCode. More... | |
bool | print_complete_type () const |
Get the value of print_complete_type. More... | |
DynamicTypePrintFormatProperty & | print_complete_type (bool value) |
Set whether or not to print the complete type. More... | |
<<extension>> <<value-type>> A collection of attributes used to configure how DynamicTypes will be formatted when converted to strings.
|
inlineexplicit |
Initializes the properties.
|
inline |
Get the value of indent.
|
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.
value | The value to set for indent |
|
inline |
Get the value of print_ordinals.
|
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, };
value | The value to set for print_ordinals |
|
inline |
Get the value of print_kind.
|
inline |
Sets the format to use when printing the TypeCode.
When print_kind is DDS_TYPE_CODE_PRINT_KIND_IDL, the type will be printed in IDL format. For example:
struct Foo { float32 bar; };
When print_kind is DDS_TYPE_CODE_PRINT_KIND_XML, the type will be printed in XML format. For example:
<struct name="Foo"> <member name="bar" type="float32"/> </struct>
value | The value to set for print_kind |
|
inline |
Get the value of print_complete_type.
|
inline |
Set whether or not to print the complete type.
When print_complete_type is true, the complete type will be printed. When print_complete_type is false, only the top level will be printed.
Take for example the following types:
struct Foo { float32 member; }; struct Bar { Foo foo; };
When print_complete_type is false, this is printed as:
struct Bar { Foo foo; };
When print_complete_type is true, this is printed as:
struct Foo { float32 member; }; struct Bar { Foo foo; };
value | The value to set for print_complete_type |