13 #ifndef RTI_XCDR_INTERPRETER_HPP_
14 #define RTI_XCDR_INTERPRETER_HPP_
16 #include "xcdr/xcdr_interpreter.h"
19 namespace rti {
namespace xcdr {
28 template <
typename TopicType>
33 template <
typename TopicType>
34 bool has_cpp_friendly_cdr_layout_impl()
36 RTIXCdrUnsignedLongLong size;
37 RTIXCdrAlignment alignment;
38 return RTIXCdrTypeCode_hasCFriendlyCdrLayout(
39 type_code<TopicType>::get(),
48 template <
typename TopicType>
49 bool has_cpp_friendly_cdr_layout()
51 static bool result = detail::has_cpp_friendly_cdr_layout_impl<TopicType>();
55 struct NoOpPropertyConfigurator {
56 static void configure(RTIXCdrInterpreterProgramsGenProperty&)
94 bool KeysOnly =
false,
95 typename PropertyConfigurator = NoOpPropertyConfigurator>
96 struct ProgramsSingleton {
100 RTIXCdrInterpreterProgramsGenProperty
property =
101 RTIXCdrInterpreterProgramsGenProperty_INITIALIZER;
103 property.generateWithAllFields =
104 KeysOnly ? RTI_XCDR_FALSE : RTI_XCDR_TRUE;
105 property.resolveAlias = ResolveAlias ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
106 property.inlineStruct = InlineStruct ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
107 property.optimizeEnum = OptimizeEnum ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
108 PropertyConfigurator::configure(property);
110 programs_ = RTIXCdrInterpreterPrograms_new(
111 type_code<TopicType>::get(),
118 if (programs_ != NULL) {
119 RTIXCdrInterpreterPrograms_delete(programs_);
123 RTIXCdrInterpreterPrograms *programs_;
128 static RTIXCdrInterpreterPrograms * get_instance()
130 static ProgramsSingleton<
137 PropertyConfigurator> instance;
138 return instance.programs_;
150 typename PropertyConfigurator>
151 RTIXCdrInterpreterPrograms * get_cdr_serialization_programs_w_property_configurator()
153 return ProgramsSingleton<
156 | RTI_XCDR_DESER_PROGRAM
157 | RTI_XCDR_GET_SER_SIZE_PROGRAM
158 | RTI_XCDR_GET_MAX_SER_SIZE_PROGRAM,
163 PropertyConfigurator>::get_instance();
171 RTIXCdrInterpreterPrograms * get_cdr_serialization_programs()
173 return ProgramsSingleton<
176 | RTI_XCDR_DESER_PROGRAM
177 | RTI_XCDR_GET_SER_SIZE_PROGRAM
178 | RTI_XCDR_GET_MAX_SER_SIZE_PROGRAM,
183 NoOpPropertyConfigurator>::get_instance();
196 template <
typename SampleType>
197 struct type_programs;
201 #endif // RTI_XCDR_INTERPRETER_HPP_