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,
bool IsCollection>
34 bool has_cpp_friendly_cdr_layout_impl()
36 RTIXCdrUnsignedLongLong size;
37 RTIXCdrAlignment alignment;
38 return RTIXCdrTypeCode_hasCFriendlyCdrLayout(
39 type_code<TopicType>::get(),
50 template <
typename TopicType>
51 bool has_cpp_friendly_cdr_layout()
54 detail::has_cpp_friendly_cdr_layout_impl<TopicType, false>();
58 template <
typename TopicType>
59 bool has_cpp_friendly_cdr_layout_collection()
62 detail::has_cpp_friendly_cdr_layout_impl<TopicType, true>();
66 struct NoOpPropertyConfigurator {
67 static void configure(RTIXCdrInterpreterProgramsGenProperty&)
105 bool KeysOnly =
false,
106 typename PropertyConfigurator = NoOpPropertyConfigurator>
107 struct ProgramsSingleton {
111 RTIXCdrInterpreterProgramsGenProperty
property =
112 RTIXCdrInterpreterProgramsGenProperty_INITIALIZER;
114 property.generateWithAllFields =
115 KeysOnly ? RTI_XCDR_FALSE : RTI_XCDR_TRUE;
116 property.resolveAlias = ResolveAlias ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
117 property.inlineStruct = InlineStruct ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
118 property.optimizeEnum = OptimizeEnum ? RTI_XCDR_TRUE : RTI_XCDR_FALSE;
119 PropertyConfigurator::configure(property);
121 programs_ = RTIXCdrInterpreterPrograms_new(
122 type_code<TopicType>::get(),
129 if (programs_ != NULL) {
130 RTIXCdrInterpreterPrograms_delete(programs_);
134 RTIXCdrInterpreterPrograms *programs_;
139 static RTIXCdrInterpreterPrograms * get_instance()
141 static ProgramsSingleton<
148 PropertyConfigurator> instance;
149 return instance.programs_;
161 typename PropertyConfigurator>
162 RTIXCdrInterpreterPrograms * get_cdr_serialization_programs_w_property_configurator()
164 return ProgramsSingleton<
167 | RTI_XCDR_DESER_PROGRAM
168 | RTI_XCDR_GET_SER_SIZE_PROGRAM
169 | RTI_XCDR_GET_MAX_SER_SIZE_PROGRAM,
174 PropertyConfigurator>::get_instance();
182 RTIXCdrInterpreterPrograms * get_cdr_serialization_programs()
184 return ProgramsSingleton<
187 | RTI_XCDR_DESER_PROGRAM
188 | RTI_XCDR_GET_SER_SIZE_PROGRAM
189 | RTI_XCDR_GET_MAX_SER_SIZE_PROGRAM,
194 NoOpPropertyConfigurator>::get_instance();
207 template <
typename SampleType>
208 struct type_programs;
212 #endif // RTI_XCDR_INTERPRETER_HPP_ Definition: AggregationBuilders.hpp:17