DynamicData.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. // Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima).
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef TYPES_DYNAMIC_DATA_H
  15. #define TYPES_DYNAMIC_DATA_H
  16. #include <fastrtps/types/TypesBase.h>
  17. #include <fastrtps/types/DynamicDataPtr.h>
  18. #include <fastrtps/types/DynamicTypePtr.h>
  19. //#define DYNAMIC_TYPES_CHECKING
  20. namespace eprosima {
  21. namespace fastrtps {
  22. namespace types {
  23. class DynamicType;
  24. class MemberDescriptor;
  25. class DynamicData
  26. {
  27. protected:
  28. DynamicData();
  29. DynamicData(const DynamicData* pData);
  30. DynamicData(DynamicType_ptr pType);
  31. ~DynamicData();
  32. void add_value(
  33. TypeKind kind,
  34. MemberId id);
  35. void create_members(DynamicType_ptr pType);
  36. void create_members(const DynamicData* pData);
  37. void clean();
  38. void clean_members();
  39. void* clone_value(
  40. MemberId id,
  41. TypeKind kind) const;
  42. bool compare_values(
  43. TypeKind kind,
  44. void* left,
  45. void* right) const;
  46. ReturnCode_t insert_array_data(MemberId indexId);
  47. void serialize_empty_data(
  48. const DynamicType_ptr pType,
  49. eprosima::fastcdr::Cdr& cdr) const;
  50. void set_default_value(MemberId id);
  51. void get_value(
  52. std::string& sOutValue,
  53. MemberId id = MEMBER_ID_INVALID) const;
  54. void set_value(
  55. const std::string& sValue,
  56. MemberId id = MEMBER_ID_INVALID);
  57. void set_type_name(const std::string& name);
  58. ReturnCode_t set_union_id(MemberId id);
  59. void update_union_discriminator();
  60. void sort_member_ids(MemberId startId);
  61. void set_union_discriminator(DynamicData* pData);
  62. // Serializes and deserializes the Dynamic Data.
  63. bool deserialize(eprosima::fastcdr::Cdr& cdr);
  64. bool deserialize_discriminator(eprosima::fastcdr::Cdr& cdr);
  65. static size_t getCdrSerializedSize(
  66. const DynamicData* data,
  67. size_t current_alignment = 0);
  68. static size_t getEmptyCdrSerializedSize(
  69. const DynamicType* type,
  70. size_t current_alignment = 0);
  71. static size_t getKeyMaxCdrSerializedSize(
  72. const DynamicType_ptr type,
  73. size_t current_alignment = 0);
  74. static size_t getMaxCdrSerializedSize(
  75. const DynamicType_ptr type,
  76. size_t current_alignment = 0);
  77. void serialize(eprosima::fastcdr::Cdr& cdr) const;
  78. void serialize_discriminator(eprosima::fastcdr::Cdr& cdr) const;
  79. void serializeKey(eprosima::fastcdr::Cdr& cdr) const;
  80. DynamicType_ptr type_;
  81. std::map<MemberId, MemberDescriptor*> descriptors_;
  82. #ifdef DYNAMIC_TYPES_CHECKING
  83. int32_t int32_value_;
  84. uint32_t uint32_value_;
  85. int16_t int16_value_;
  86. uint16_t uint16_value_;
  87. int64_t int64_value_;
  88. uint64_t uint64_value_;
  89. float float32_value_;
  90. double float64_value_;
  91. long double float128_value_;
  92. char char8_value_;
  93. wchar_t char16_value_;
  94. octet byte_value_;
  95. bool bool_value_;
  96. std::string string_value_;
  97. std::wstring wstring_value_;
  98. std::map<MemberId, DynamicData*> complex_values_;
  99. #else
  100. std::map<MemberId, void*> values_;
  101. #endif
  102. std::vector<MemberId> loaned_values_;
  103. bool key_element_;
  104. DynamicData* default_array_value_;
  105. uint64_t union_label_;
  106. MemberId union_id_;
  107. DynamicData* union_discriminator_;
  108. uint64_t discriminator_value_;
  109. friend class DynamicDataFactory;
  110. friend class DynamicPubSubType;
  111. friend class DynamicDataHelper;
  112. public:
  113. RTPS_DllAPI ReturnCode_t get_descriptor(
  114. MemberDescriptor& value,
  115. MemberId id);
  116. RTPS_DllAPI ReturnCode_t set_descriptor(
  117. MemberId id,
  118. const MemberDescriptor* value);
  119. RTPS_DllAPI ReturnCode_t clear_all_values();
  120. RTPS_DllAPI ReturnCode_t clear_nonkey_values();
  121. RTPS_DllAPI ReturnCode_t clear_value(MemberId id);
  122. RTPS_DllAPI bool equals(const DynamicData* other) const;
  123. RTPS_DllAPI TypeKind get_kind() const;
  124. RTPS_DllAPI uint32_t get_item_count() const;
  125. RTPS_DllAPI std::string get_name();
  126. RTPS_DllAPI MemberId get_member_id_by_name(const std::string& name) const;
  127. RTPS_DllAPI MemberId get_member_id_at_index(uint32_t index) const;
  128. RTPS_DllAPI DynamicData* loan_value(MemberId id);
  129. RTPS_DllAPI ReturnCode_t return_loaned_value(const DynamicData* value);
  130. RTPS_DllAPI MemberId get_array_index(const std::vector<uint32_t>& position);
  131. RTPS_DllAPI ReturnCode_t insert_sequence_data(MemberId& outId);
  132. RTPS_DllAPI ReturnCode_t insert_int32_value(
  133. int32_t value,
  134. MemberId& outId);
  135. RTPS_DllAPI ReturnCode_t insert_uint32_value(
  136. uint32_t value,
  137. MemberId& outId);
  138. RTPS_DllAPI ReturnCode_t insert_int16_value(
  139. int16_t value,
  140. MemberId& outId);
  141. RTPS_DllAPI ReturnCode_t insert_uint16_value(
  142. uint16_t value,
  143. MemberId& outId);
  144. RTPS_DllAPI ReturnCode_t insert_int64_value(
  145. int64_t value,
  146. MemberId& outId);
  147. RTPS_DllAPI ReturnCode_t insert_uint64_value(
  148. uint64_t value,
  149. MemberId& outId);
  150. RTPS_DllAPI ReturnCode_t insert_float32_value(
  151. float value,
  152. MemberId& outId);
  153. RTPS_DllAPI ReturnCode_t insert_float64_value(
  154. double value,
  155. MemberId& outId);
  156. RTPS_DllAPI ReturnCode_t insert_float128_value(
  157. long double value,
  158. MemberId& outId);
  159. RTPS_DllAPI ReturnCode_t insert_char8_value(
  160. char value,
  161. MemberId& outId);
  162. RTPS_DllAPI ReturnCode_t insert_char16_value(
  163. wchar_t value,
  164. MemberId& outId);
  165. RTPS_DllAPI ReturnCode_t insert_byte_value(
  166. octet value,
  167. MemberId& outId);
  168. RTPS_DllAPI ReturnCode_t insert_bool_value(
  169. bool value,
  170. MemberId& outId);
  171. RTPS_DllAPI ReturnCode_t insert_string_value(
  172. const std::string& value,
  173. MemberId& outId);
  174. RTPS_DllAPI ReturnCode_t insert_wstring_value(
  175. const std::wstring& value,
  176. MemberId& outId);
  177. RTPS_DllAPI ReturnCode_t insert_enum_value(
  178. const std::string& value,
  179. MemberId& outId);
  180. RTPS_DllAPI ReturnCode_t insert_complex_value(
  181. const DynamicData* value,
  182. MemberId& outId);
  183. RTPS_DllAPI ReturnCode_t insert_complex_value(
  184. DynamicData* value,
  185. MemberId& outId);
  186. RTPS_DllAPI ReturnCode_t insert_complex_value(
  187. DynamicData_ptr value,
  188. MemberId& outId);
  189. RTPS_DllAPI ReturnCode_t remove_sequence_data(MemberId id);
  190. RTPS_DllAPI ReturnCode_t clear_data();
  191. RTPS_DllAPI ReturnCode_t clear_array_data(MemberId indexId);
  192. RTPS_DllAPI ReturnCode_t insert_map_data(
  193. const DynamicData* key,
  194. MemberId& outKeyId,
  195. MemberId& outValueId);
  196. RTPS_DllAPI ReturnCode_t insert_map_data(
  197. const DynamicData* key,
  198. DynamicData* value,
  199. MemberId& outKey,
  200. MemberId& outValue);
  201. RTPS_DllAPI ReturnCode_t insert_map_data(
  202. const DynamicData* key,
  203. const DynamicData* value,
  204. MemberId& outKey,
  205. MemberId& outValue);
  206. RTPS_DllAPI ReturnCode_t insert_map_data(
  207. const DynamicData* key,
  208. DynamicData_ptr value,
  209. MemberId& outKey,
  210. MemberId& outValue);
  211. RTPS_DllAPI ReturnCode_t remove_map_data(MemberId keyId);
  212. RTPS_DllAPI ReturnCode_t get_int32_value(
  213. int32_t& value,
  214. MemberId id) const;
  215. RTPS_DllAPI ReturnCode_t set_int32_value(
  216. int32_t value,
  217. MemberId id = MEMBER_ID_INVALID);
  218. RTPS_DllAPI ReturnCode_t get_uint32_value(
  219. uint32_t& value,
  220. MemberId id) const;
  221. RTPS_DllAPI ReturnCode_t set_uint32_value(
  222. uint32_t value,
  223. MemberId id = MEMBER_ID_INVALID);
  224. RTPS_DllAPI ReturnCode_t get_int16_value(
  225. int16_t& value,
  226. MemberId id) const;
  227. RTPS_DllAPI ReturnCode_t set_int16_value(
  228. int16_t value,
  229. MemberId id = MEMBER_ID_INVALID);
  230. RTPS_DllAPI ReturnCode_t get_uint16_value(
  231. uint16_t& value,
  232. MemberId id) const;
  233. RTPS_DllAPI ReturnCode_t set_uint16_value(
  234. uint16_t value,
  235. MemberId id = MEMBER_ID_INVALID);
  236. RTPS_DllAPI ReturnCode_t get_int64_value(
  237. int64_t& value,
  238. MemberId id) const;
  239. RTPS_DllAPI ReturnCode_t set_int64_value(
  240. int64_t value,
  241. MemberId id = MEMBER_ID_INVALID);
  242. RTPS_DllAPI ReturnCode_t get_uint64_value(
  243. uint64_t& value,
  244. MemberId id) const;
  245. RTPS_DllAPI ReturnCode_t set_uint64_value(
  246. uint64_t value,
  247. MemberId id = MEMBER_ID_INVALID);
  248. RTPS_DllAPI ReturnCode_t get_float32_value(
  249. float& value,
  250. MemberId id) const;
  251. RTPS_DllAPI ReturnCode_t set_float32_value(
  252. float value,
  253. MemberId id = MEMBER_ID_INVALID);
  254. RTPS_DllAPI ReturnCode_t get_float64_value(
  255. double& value,
  256. MemberId id) const;
  257. RTPS_DllAPI ReturnCode_t set_float64_value(
  258. double value,
  259. MemberId id = MEMBER_ID_INVALID);
  260. RTPS_DllAPI ReturnCode_t get_float128_value(
  261. long double& value,
  262. MemberId id) const;
  263. RTPS_DllAPI ReturnCode_t set_float128_value(
  264. long double value,
  265. MemberId id = MEMBER_ID_INVALID);
  266. RTPS_DllAPI ReturnCode_t get_char8_value(
  267. char& value,
  268. MemberId id) const;
  269. RTPS_DllAPI ReturnCode_t set_char8_value(
  270. char value,
  271. MemberId id = MEMBER_ID_INVALID);
  272. RTPS_DllAPI ReturnCode_t get_char16_value(
  273. wchar_t& value,
  274. MemberId id) const;
  275. RTPS_DllAPI ReturnCode_t set_char16_value(
  276. wchar_t value,
  277. MemberId id = MEMBER_ID_INVALID);
  278. RTPS_DllAPI ReturnCode_t get_byte_value(
  279. octet& value,
  280. MemberId id) const;
  281. RTPS_DllAPI ReturnCode_t set_byte_value(
  282. octet value,
  283. MemberId id = MEMBER_ID_INVALID);
  284. RTPS_DllAPI ReturnCode_t get_int8_value(
  285. int8_t& value,
  286. MemberId id) const
  287. {
  288. octet aux;
  289. ReturnCode_t result = get_byte_value(aux, id);
  290. value = static_cast<int8_t>(aux);
  291. return result;
  292. }
  293. RTPS_DllAPI ReturnCode_t set_int8_value(
  294. int8_t value,
  295. MemberId id = MEMBER_ID_INVALID)
  296. {
  297. return set_byte_value(static_cast<octet>(value), id);
  298. }
  299. RTPS_DllAPI ReturnCode_t get_uint8_value(
  300. uint8_t& value,
  301. MemberId id) const
  302. {
  303. octet aux;
  304. ReturnCode_t result = get_byte_value(aux, id);
  305. value = static_cast<uint8_t>(aux);
  306. return result;
  307. }
  308. RTPS_DllAPI ReturnCode_t set_uint8_value(
  309. uint8_t value,
  310. MemberId id = MEMBER_ID_INVALID)
  311. {
  312. return set_byte_value(static_cast<octet>(value), id);
  313. }
  314. RTPS_DllAPI ReturnCode_t get_bool_value(
  315. bool& value,
  316. MemberId id) const;
  317. RTPS_DllAPI ReturnCode_t set_bool_value(
  318. bool value,
  319. MemberId id = MEMBER_ID_INVALID);
  320. RTPS_DllAPI ReturnCode_t set_bool_value(
  321. bool value,
  322. const std::string& name)
  323. {
  324. MemberId id = get_member_id_by_name(name);
  325. if (id != MEMBER_ID_INVALID)
  326. {
  327. return set_bool_value(value, id);
  328. }
  329. return ReturnCode_t::RETCODE_BAD_PARAMETER;
  330. }
  331. RTPS_DllAPI ReturnCode_t get_string_value(
  332. std::string& value,
  333. MemberId id) const;
  334. RTPS_DllAPI ReturnCode_t set_string_value(
  335. const std::string& value,
  336. MemberId id = MEMBER_ID_INVALID);
  337. RTPS_DllAPI ReturnCode_t get_wstring_value(
  338. std::wstring& value,
  339. MemberId id) const;
  340. RTPS_DllAPI ReturnCode_t set_wstring_value(
  341. const std::wstring& value,
  342. MemberId id = MEMBER_ID_INVALID);
  343. RTPS_DllAPI ReturnCode_t get_enum_value(
  344. std::string& value,
  345. MemberId id) const;
  346. RTPS_DllAPI ReturnCode_t set_enum_value(
  347. const std::string& value,
  348. MemberId id = MEMBER_ID_INVALID);
  349. RTPS_DllAPI ReturnCode_t get_enum_value(
  350. uint32_t& value,
  351. MemberId id) const;
  352. RTPS_DllAPI ReturnCode_t set_enum_value(
  353. const uint32_t& value,
  354. MemberId id = MEMBER_ID_INVALID);
  355. RTPS_DllAPI ReturnCode_t get_bitmask_value(uint64_t& value) const;
  356. RTPS_DllAPI uint64_t get_bitmask_value() const
  357. {
  358. uint64_t value;
  359. if (get_bitmask_value(value) != ReturnCode_t::RETCODE_OK)
  360. {
  361. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  362. }
  363. return value;
  364. }
  365. RTPS_DllAPI ReturnCode_t set_bitmask_value(uint64_t value);
  366. RTPS_DllAPI ReturnCode_t get_complex_value(
  367. DynamicData** value,
  368. MemberId id) const;
  369. RTPS_DllAPI ReturnCode_t set_complex_value(
  370. DynamicData* value,
  371. MemberId id = MEMBER_ID_INVALID);
  372. RTPS_DllAPI ReturnCode_t get_union_label(uint64_t& value) const;
  373. // Basic types returns (copy)
  374. RTPS_DllAPI int32_t get_int32_value(MemberId id) const
  375. {
  376. int32_t value;
  377. if (get_int32_value(value, id) != ReturnCode_t::RETCODE_OK)
  378. {
  379. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  380. }
  381. return value;
  382. }
  383. RTPS_DllAPI uint32_t get_uint32_value(MemberId id) const
  384. {
  385. uint32_t value;
  386. if (get_uint32_value(value, id) != ReturnCode_t::RETCODE_OK)
  387. {
  388. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  389. }
  390. return value;
  391. }
  392. RTPS_DllAPI int16_t get_int16_value(MemberId id) const
  393. {
  394. int16_t value;
  395. if (get_int16_value(value, id) != ReturnCode_t::RETCODE_OK)
  396. {
  397. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  398. }
  399. return value;
  400. }
  401. RTPS_DllAPI uint16_t get_uint16_value(MemberId id) const
  402. {
  403. uint16_t value;
  404. if (get_uint16_value(value, id) != ReturnCode_t::RETCODE_OK)
  405. {
  406. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  407. }
  408. return value;
  409. }
  410. RTPS_DllAPI int64_t get_int64_value(MemberId id) const
  411. {
  412. int64_t value;
  413. if (get_int64_value(value, id) != ReturnCode_t::RETCODE_OK)
  414. {
  415. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  416. }
  417. return value;
  418. }
  419. RTPS_DllAPI uint64_t get_uint64_value(MemberId id) const
  420. {
  421. uint64_t value;
  422. if (get_uint64_value(value, id) != ReturnCode_t::RETCODE_OK)
  423. {
  424. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  425. }
  426. return value;
  427. }
  428. RTPS_DllAPI float get_float32_value(MemberId id) const
  429. {
  430. float value;
  431. if (get_float32_value(value, id) != ReturnCode_t::RETCODE_OK)
  432. {
  433. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  434. }
  435. return value;
  436. }
  437. RTPS_DllAPI double get_float64_value(MemberId id) const
  438. {
  439. double value;
  440. if (get_float64_value(value, id) != ReturnCode_t::RETCODE_OK)
  441. {
  442. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  443. }
  444. return value;
  445. }
  446. RTPS_DllAPI long double get_float128_value(MemberId id) const
  447. {
  448. long double value;
  449. if (get_float128_value(value, id) != ReturnCode_t::RETCODE_OK)
  450. {
  451. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  452. }
  453. return value;
  454. }
  455. RTPS_DllAPI char get_char8_value(MemberId id) const
  456. {
  457. char value;
  458. if (get_char8_value(value, id) != ReturnCode_t::RETCODE_OK)
  459. {
  460. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  461. }
  462. return value;
  463. }
  464. RTPS_DllAPI wchar_t get_char16_value(MemberId id) const
  465. {
  466. wchar_t value;
  467. if (get_char16_value(value, id) != ReturnCode_t::RETCODE_OK)
  468. {
  469. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  470. }
  471. return value;
  472. }
  473. RTPS_DllAPI octet get_byte_value(MemberId id) const
  474. {
  475. octet value;
  476. if (get_byte_value(value, id) != ReturnCode_t::RETCODE_OK)
  477. {
  478. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  479. }
  480. return value;
  481. }
  482. RTPS_DllAPI int8_t get_int8_value(MemberId id) const
  483. {
  484. int8_t value;
  485. if (get_int8_value(value, id) != ReturnCode_t::RETCODE_OK)
  486. {
  487. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  488. }
  489. return value;
  490. }
  491. RTPS_DllAPI uint8_t get_uint8_value(MemberId id) const
  492. {
  493. uint8_t value;
  494. if (get_uint8_value(value, id) != ReturnCode_t::RETCODE_OK)
  495. {
  496. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  497. }
  498. return value;
  499. }
  500. RTPS_DllAPI bool get_bool_value(MemberId id) const
  501. {
  502. bool value;
  503. if (get_bool_value(value, id) != ReturnCode_t::RETCODE_OK)
  504. {
  505. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  506. }
  507. return value;
  508. }
  509. RTPS_DllAPI bool get_bool_value(const std::string& name) const
  510. {
  511. MemberId id = get_member_id_by_name(name);
  512. bool value;
  513. if (get_bool_value(value, id) != ReturnCode_t::RETCODE_OK)
  514. {
  515. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  516. }
  517. return value;
  518. }
  519. RTPS_DllAPI std::string get_string_value(MemberId id) const
  520. {
  521. std::string value;
  522. if (get_string_value(value, id) != ReturnCode_t::RETCODE_OK)
  523. {
  524. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  525. }
  526. return value;
  527. }
  528. RTPS_DllAPI std::wstring get_wstring_value(MemberId id) const
  529. {
  530. std::wstring value;
  531. if (get_wstring_value(value, id) != ReturnCode_t::RETCODE_OK)
  532. {
  533. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  534. }
  535. return value;
  536. }
  537. RTPS_DllAPI std::string get_enum_value(MemberId id) const
  538. {
  539. std::string value;
  540. if (get_enum_value(value, id) != ReturnCode_t::RETCODE_OK)
  541. {
  542. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  543. }
  544. return value;
  545. }
  546. RTPS_DllAPI uint64_t get_union_label() const
  547. {
  548. uint64_t value;
  549. if (get_union_label(value) != ReturnCode_t::RETCODE_OK)
  550. {
  551. throw ReturnCode_t::RETCODE_BAD_PARAMETER;
  552. }
  553. return value;
  554. }
  555. RTPS_DllAPI uint64_t get_discriminator_value() const
  556. {
  557. return discriminator_value_;
  558. }
  559. RTPS_DllAPI void get_discriminator_value(uint64_t& outValue) const
  560. {
  561. outValue = discriminator_value_;
  562. }
  563. RTPS_DllAPI void set_discriminator_value(uint64_t value)
  564. {
  565. discriminator_value_ = value;
  566. }
  567. };
  568. } // namespace types
  569. } // namespace fastrtps
  570. } // namespace eprosima
  571. #endif // TYPES_DYNAMIC_DATA_H