13#ifndef RTI_XCDR_INTERPRETER_HPP_
14#define RTI_XCDR_INTERPRETER_HPP_
16#include "xcdr/xcdr_interpreter.h"
19namespace rti {
namespace xcdr {
28template <
typename TopicType>
33template <
typename TopicType,
bool IsCollection>
34bool has_cpp_friendly_cdr_layout_impl()
36 RTIXCdrUnsignedLongLong size;
37 RTIXCdrAlignment alignment;
38 struct RTIXCdrGlobalTypePluginProgramProperty property;
40 RTIXCdrInterpreter_getGlobalTypePluginProgramProperty(&property);
42 return RTIXCdrTypeCode_hasCFriendlyCdrLayout(
43 type_code<TopicType>::get(),
52 property.dheaderInNonPrimitiveCollections);
57template <
typename TopicType>
58bool has_cpp_friendly_cdr_layout()
61 detail::has_cpp_friendly_cdr_layout_impl<TopicType, false>();
65template <
typename TopicType>
66bool has_cpp_friendly_cdr_layout_collection()
69 detail::has_cpp_friendly_cdr_layout_impl<TopicType, true>();
73struct NoOpPropertyConfigurator {
74 static void configure(RTIXCdrInterpreterProgramsGenProperty&)
112 bool KeysOnly =
false,
113 typename PropertyConfigurator = NoOpPropertyConfigurator>
114struct ProgramsSingleton {
118 RTIXCdrInterpreterProgramsGenProperty
property =
119 RTIXCdrInterpreterProgramsGenProperty_INITIALIZER;
121 property.generateWithAllFields =
122 KeysOnly ? RTI_XCDR_FALSE : RTI_XCDR_TRUE;
123 property.resolveAlias = ResolveAlias ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
124 property.inlineStruct = InlineStruct ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
125 property.optimizeEnum = OptimizeEnum ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
126 PropertyConfigurator::configure(property);
128 programs_ = RTIXCdrInterpreterPrograms_new(
129 type_code<TopicType>::get(),
136 if (programs_ != NULL) {
137 RTIXCdrInterpreterPrograms_delete(programs_);
141 RTIXCdrInterpreterPrograms *programs_;
146 static RTIXCdrInterpreterPrograms * get_instance()
148 static ProgramsSingleton<
155 PropertyConfigurator> instance;
156 return instance.programs_;
168 typename PropertyConfigurator>
169RTIXCdrInterpreterPrograms * get_cdr_serialization_programs_w_property_configurator()
171 return ProgramsSingleton<
174 | RTI_XCDR_DESER_PROGRAM
175 | RTI_XCDR_GET_SER_SIZE_PROGRAM
176 | RTI_XCDR_GET_MAX_SER_SIZE_PROGRAM,
181 PropertyConfigurator>::get_instance();
189RTIXCdrInterpreterPrograms * get_cdr_serialization_programs()
191 return ProgramsSingleton<
194 | RTI_XCDR_DESER_PROGRAM
195 | RTI_XCDR_GET_SER_SIZE_PROGRAM
196 | RTI_XCDR_GET_MAX_SER_SIZE_PROGRAM,
201 NoOpPropertyConfigurator>::get_instance();
214template <
typename SampleType>
The RTI namespace.
Definition: AggregationBuilders.hpp:17