Fast RTPS  Version 2.14.1
Fast RTPS
Loading...
Searching...
No Matches
AnnotationParameterValue.h
1// Copyright 2016 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
22#ifndef _ANNOTATIONPARAMETERVALUE_H_
23#define _ANNOTATIONPARAMETERVALUE_H_
24
25#if _MSC_VER
26
27#if defined(max)
28#pragma push_macro("max")
29#undef max
30#define FASTDDS_RESTORE_MAX
31#endif // defined(max)
32
33#if defined(min)
34#pragma push_macro("min")
35#undef min
36#define FASTDDS_RESTORE_MIN
37#endif // defined(min)
38
39#endif // if _MSC_VER
40
41#include <array>
42#include <stdint.h>
43#include <vector>
44
45#include <fastrtps/fastrtps_dll.h>
46#include <fastrtps/types/TypeIdentifier.h>
47#include <fastrtps/types/TypesBase.h>
48#include <fastrtps/utils/string_convert.hpp>
49
50namespace eprosima {
51namespace fastcdr {
52class Cdr;
53} // namespace fastcdr
54} // namespace eprosima
55namespace eprosima {
56namespace fastrtps {
57
58namespace types {
59
65{
66public:
67
72
77
84
91
98
105
106#ifndef DOXYGEN_SHOULD_SKIP_THIS
113 FASTDDS_SER_METHOD_DEPRECATED(3,
114 "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::getCdrSerializedSize()",
115 "In favor of version using eprosima::fastcdr::calculate_serialized_size.")
116 RTPS_DllAPI static size_t getCdrSerializedSize(
118 size_t current_alignment = 0);
119
124 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::serialize()",
125 "In favor of version using eprosima::fastcdr::serialize.")
126 RTPS_DllAPI void serialize(
127 eprosima::fastcdr::Cdr& cdr) const;
128
133 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::deserialize()",
134 "In favor of version using eprosima::fastcdr::deserialize.")
135 RTPS_DllAPI void deserialize(
136 eprosima::fastcdr::Cdr& cdr);
137#endif // DOXYGEN_SHOULD_SKIP_THIS
138
145 RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize(
146 size_t current_alignment = 0);
147
151 RTPS_DllAPI static bool isKeyDefined();
152
157 RTPS_DllAPI void serializeKey(
158 eprosima::fastcdr::Cdr& cdr) const;
159
160 RTPS_DllAPI bool operator ==(
162 {
163 return true;
164 }
165
166private:
167};
173{
174public:
175
180
185
191 const AnnotationParameterValue& x);
192
199
205 const AnnotationParameterValue& x);
206
213
219 RTPS_DllAPI void _d(
220 char __d);
221
226 RTPS_DllAPI char _d() const;
227
232 RTPS_DllAPI char& _d();
233
238 RTPS_DllAPI void boolean_value(
239 bool _boolean_value);
240
246 RTPS_DllAPI bool boolean_value() const;
247
253 RTPS_DllAPI bool& boolean_value();
258 RTPS_DllAPI void byte_value(
259 uint8_t _byte_value);
260
266 RTPS_DllAPI uint8_t byte_value() const;
267
273 RTPS_DllAPI uint8_t& byte_value();
278 RTPS_DllAPI void int16_value(
279 int16_t _int16_value);
280
286 RTPS_DllAPI int16_t int16_value() const;
287
293 RTPS_DllAPI int16_t& int16_value();
298 RTPS_DllAPI void uint_16_value(
299 uint16_t _uint_16_value);
300
306 RTPS_DllAPI uint16_t uint_16_value() const;
307
313 RTPS_DllAPI uint16_t& uint_16_value();
318 RTPS_DllAPI void int32_value(
319 int32_t _int32_value);
320
326 RTPS_DllAPI int32_t int32_value() const;
327
333 RTPS_DllAPI int32_t& int32_value();
338 RTPS_DllAPI void uint32_value(
339 uint32_t _uint32_value);
340
346 RTPS_DllAPI uint32_t uint32_value() const;
347
353 RTPS_DllAPI uint32_t& uint32_value();
358 RTPS_DllAPI void int64_value(
359 int64_t _int64_value);
360
366 RTPS_DllAPI int64_t int64_value() const;
367
373 RTPS_DllAPI int64_t& int64_value();
374
379 RTPS_DllAPI void uint64_value(
380 uint64_t _uint64_value);
381
387 RTPS_DllAPI uint64_t uint64_value() const;
388
394 RTPS_DllAPI uint64_t& uint64_value();
399 RTPS_DllAPI void float32_value(
400 float _float32_value);
401
407 RTPS_DllAPI float float32_value() const;
408
414 RTPS_DllAPI float& float32_value();
419 RTPS_DllAPI void float64_value(
420 double _float64_value);
421
427 RTPS_DllAPI double float64_value() const;
428
434 RTPS_DllAPI double& float64_value();
435
440 RTPS_DllAPI void float128_value(
441 long double _float128_value);
442
448 RTPS_DllAPI long double float128_value() const;
449
455 RTPS_DllAPI long double& float128_value();
460 RTPS_DllAPI void char_value(
461 char _char_value);
462
468 RTPS_DllAPI char char_value() const;
469
475 RTPS_DllAPI char& char_value();
480 RTPS_DllAPI void wchar_value(
481 wchar_t _wchar_value);
482
488 RTPS_DllAPI wchar_t wchar_value() const;
489
495 RTPS_DllAPI wchar_t& wchar_value();
500 RTPS_DllAPI void enumerated_value(
501 int32_t _enumerated_value);
502
508 RTPS_DllAPI int32_t enumerated_value() const;
509
515 RTPS_DllAPI int32_t& enumerated_value();
520 RTPS_DllAPI void string8_value(
521 const std::string& _string8_value);
522
527 RTPS_DllAPI void string8_value(
528 std::string&& _string8_value);
529
535 RTPS_DllAPI const std::string& string8_value() const;
536
542 RTPS_DllAPI std::string& string8_value();
547 RTPS_DllAPI void string16_value(
548 const std::wstring& _string16_value);
549
554 RTPS_DllAPI void string16_value(
555 std::wstring&& _string16_value);
556
562 RTPS_DllAPI const std::wstring& string16_value() const;
563
569 RTPS_DllAPI std::wstring& string16_value();
570
575 RTPS_DllAPI void extended_value(
576 const ExtendedAnnotationParameterValue& _extended_value);
577
582 RTPS_DllAPI void extended_value(
583 ExtendedAnnotationParameterValue&& _extended_value);
584
591
598
599#ifndef DOXYGEN_SHOULD_SKIP_THIS
606 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::getCdrSerializedSize()",
607 "In favor of version using eprosima::fastcdr::calculate_serialized_size.")
608 RTPS_DllAPI static size_t getCdrSerializedSize(
609 const AnnotationParameterValue& data,
610 size_t current_alignment = 0);
611
616 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::serialize()",
617 "In favor of version using eprosima::fastcdr::serialize.")
618 RTPS_DllAPI void serialize(
619 eprosima::fastcdr::Cdr& cdr) const;
620
625 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::deserialize()",
626 "In favor of version using eprosima::fastcdr::deserialize.")
627 RTPS_DllAPI void deserialize(
628 eprosima::fastcdr::Cdr& cdr);
629#endif // DOXYGEN_SHOULD_SKIP_THIS
630
637 RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize(
638 size_t current_alignment = 0);
639
643 RTPS_DllAPI static bool isKeyDefined();
644
649 RTPS_DllAPI void serializeKey(
650 eprosima::fastcdr::Cdr& cdr) const;
651
652 RTPS_DllAPI bool operator ==(
653 const AnnotationParameterValue& other) const;
654
658 RTPS_DllAPI std::string to_string() const
659 {
660 switch (m__d)
661 {
662 case TK_BOOLEAN:
663 return (m_boolean_value) ? "true" : "false";
664 case TK_BYTE:
665 return std::to_string(m_byte_value);
666 case TK_INT16:
667 return std::to_string(m_int16_value);
668 case TK_UINT16:
669 return std::to_string(m_uint_16_value);
670 case TK_INT32:
671 return std::to_string(m_int32_value);
672 case TK_UINT32:
673 return std::to_string(m_uint32_value);
674 case TK_INT64:
675 return std::to_string(m_int64_value);
676 case TK_UINT64:
677 return std::to_string(m_uint64_value);
678 case TK_FLOAT32:
679 return std::to_string(m_float32_value);
680 case TK_FLOAT64:
681 return std::to_string(m_float64_value);
682 case TK_FLOAT128:
683 return std::to_string(m_float128_value);
684 case TK_CHAR8:
685 return std::to_string(m_char_value);
686 case TK_CHAR16:
687 return std::to_string(m_wchar_value);
688 case TK_ENUM:
689 return std::to_string(m_enumerated_value);
690 case TK_STRING16:
691 {
692 return wstring_to_bytes(m_string16_value);
693 }
694 case TK_STRING8:
695 case TK_NONE: // Cheat!
696 return m_string8_value;
697 default:
698 return "";
699 }
700 }
701
705 RTPS_DllAPI void from_string(
706 const std::string& value)
707 {
708 switch (m__d)
709 {
710 case TK_BOOLEAN:
711 {
712 std::string val_ = value;
713 std::transform(val_.begin(), val_.end(), val_.begin(),
714 [](unsigned char c)
715 {
716 return static_cast<char>(std::tolower(c));
717 });
718 boolean_value(val_.compare("0") != 0 || val_.compare(CONST_TRUE) == 0);
719 }
720 break;
721 case TK_BYTE:
722 {
723 byte_value(static_cast<uint8_t>(std::stoul(value)));
724 }
725 break;
726 case TK_INT16:
727 {
728 int16_value(static_cast<int16_t>(std::stoi(value)));
729 }
730 break;
731 case TK_INT32:
732 {
733 int32_value(static_cast<int32_t>(std::stoi(value)));
734 }
735 break;
736 case TK_INT64:
737 {
738 int64_value(static_cast<int64_t>(std::stoll(value)));
739 }
740 break;
741 case TK_UINT16:
742 {
743 uint_16_value(static_cast<uint16_t>(std::stoul(value)));
744 }
745 break;
746 case TK_UINT32:
747 {
748 uint32_value(static_cast<uint32_t>(std::stoul(value)));
749 }
750 break;
751 case TK_UINT64:
752 {
753 uint64_value(static_cast<uint64_t>(std::stoull(value)));
754 }
755 break;
756 case TK_FLOAT32:
757 {
758 float32_value(std::stof(value));
759 }
760 break;
761 case TK_FLOAT64:
762 {
763 float64_value(std::stod(value));
764 }
765 break;
766 case TK_FLOAT128:
767 {
768 float128_value(std::stold(value));
769 }
770 break;
771 case TK_CHAR8:
772 {
773 char_value(value.c_str()[0]);
774 }
775 break;
776 case TK_CHAR16:
777 {
778 wchar_value(wstring_from_bytes(value).c_str()[0]);
779 }
780 break;
781 case TK_STRING8:
782 case TK_NONE: // Cheat!
783 {
784 string8_value(value);
785 }
786 break;
787 case TK_STRING16:
788 {
790 }
791 break;
792 case TK_ENUM:
793 {
794 // TODO Translate from enum value name to integer value
795 enumerated_value(static_cast<int32_t>(std::stoul(value)));
796 }
797 break;
798 default:
799 break;
800 }
801 }
802
803private:
804
805 char m__d;
806
807 bool m_boolean_value;
808 uint8_t m_byte_value;
809 int16_t m_int16_value;
810 uint16_t m_uint_16_value;
811 int32_t m_int32_value;
812 uint32_t m_uint32_value;
813 int64_t m_int64_value;
814 uint64_t m_uint64_value;
815 float m_float32_value;
816 double m_float64_value;
817 long double m_float128_value;
818 char m_char_value;
819 wchar_t m_wchar_value;
820 int32_t m_enumerated_value;
821 std::string m_string8_value;
822 std::wstring m_string16_value;
823 ExtendedAnnotationParameterValue m_extended_value;
824};
825
831{
832public:
833
838
843
850
857
864
871
876 inline void paramname_hash(
877 const NameHash& _paramname_hash)
878 {
879 m_paramname_hash = _paramname_hash;
880 }
881
886 inline void paramname_hash(
887 NameHash&& _paramname_hash)
888 {
889 m_paramname_hash = std::move(_paramname_hash);
890 }
891
896 inline const NameHash& paramname_hash() const
897 {
898 return m_paramname_hash;
899 }
900
906 {
907 return m_paramname_hash;
908 }
909
914 inline void value(
915 const AnnotationParameterValue& _value)
916 {
917 m_value = _value;
918 }
919
924 inline void value(
926 {
927 m_value = std::move(_value);
928 }
929
934 inline const AnnotationParameterValue& value() const
935 {
936 return m_value;
937 }
938
944 {
945 return m_value;
946 }
947
948#ifndef DOXYGEN_SHOULD_SKIP_THIS
955 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::getCdrSerializedSize()",
956 "In favor of version using eprosima::fastcdr::calculate_serialized_size.")
957 RTPS_DllAPI static size_t getCdrSerializedSize(
958 const AppliedAnnotationParameter& data,
959 size_t current_alignment = 0);
960
965 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::serialize()",
966 "In favor of version using eprosima::fastcdr::serialize.")
967 RTPS_DllAPI void serialize(
968 eprosima::fastcdr::Cdr& cdr) const;
969
974 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::deserialize()",
975 "In favor of version using eprosima::fastcdr::deserialize.")
976 RTPS_DllAPI void deserialize(
977 eprosima::fastcdr::Cdr& cdr);
978#endif // DOXYGEN_SHOULD_SKIP_THIS
979
986 RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize(
987 size_t current_alignment = 0);
988
992 RTPS_DllAPI static bool isKeyDefined();
993
998 RTPS_DllAPI void serializeKey(
999 eprosima::fastcdr::Cdr& cdr) const;
1000
1001 RTPS_DllAPI bool operator ==(
1002 const AppliedAnnotationParameter& other) const;
1003
1004private:
1005
1006 NameHash m_paramname_hash;
1008};
1009
1010
1011// The application of an annotation to some type or type member
1012/*struct AppliedAnnotationParameter {
1013 NameHash paramname_hash;
1014 AnnotationParameterValue value;
1015 };*/
1016/*
1017 class AppliedAnnotationParameter
1018 {
1019 public:
1020 AppliedAnnotationParameter();
1021 ~AppliedAnnotationParameter();
1022 AppliedAnnotationParameter(const AppliedAnnotationParameter &x);
1023 AppliedAnnotationParameter(AppliedAnnotationParameter &&x);
1024 AppliedAnnotationParameter& operator=(const AppliedAnnotationParameter &x);
1025 AppliedAnnotationParameter& operator=(AppliedAnnotationParameter &&x);
1026
1027 inline void paramname_hash(const NameHash &_paramname_hash) { m_paramname_hash = _paramname_hash; }
1028 inline void paramname_hash(NameHash &&_paramname_hash) { m_paramname_hash = std::move(_paramname_hash); }
1029 inline const NameHash& paramname_hash() const { return m_paramname_hash; }
1030 inline NameHash& paramname_hash() { return m_paramname_hash; }
1031
1032 inline void value(const AnnotationParameterValue &_value) { m_value = _value; }
1033 inline void value(AnnotationParameterValue &&_value) { m_value = std::move(_value); }
1034 inline const AnnotationParameterValue& value() const { return m_value; }
1035 inline AnnotationParameterValue& value() { return m_value; }
1036
1037 static size_t getCdrSerializedSize(const AppliedAnnotationParameter& data, size_t current_alignment = 0);
1038 void serialize(eprosima::fastcdr::Cdr &cdr) const;
1039 void deserialize(eprosima::fastcdr::Cdr &cdr);
1040 static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0);
1041 static bool isKeyDefined();
1042 void serializeKey(eprosima::fastcdr::Cdr &cdr) const;
1043
1044 private:
1045 NameHash m_paramname_hash;
1046 AnnotationParameterValue m_value;
1047 };
1048 */
1049// Sorted by AppliedAnnotationParameter.paramname_hash
1050typedef std::vector<AppliedAnnotationParameter> AppliedAnnotationParameterSeq;
1051
1052/*struct AppliedAnnotation {
1053 TypeIdentifier annotation_typeid;
1054 AppliedAnnotationParameterSeq param_seq; // @Optional
1055 };*/
1057{
1058public:
1059
1060 RTPS_DllAPI AppliedAnnotation();
1061
1062 RTPS_DllAPI ~AppliedAnnotation();
1063
1065 const AppliedAnnotation& x);
1066
1068 AppliedAnnotation&& x);
1070 const AppliedAnnotation& x);
1072 AppliedAnnotation&& x);
1073
1075 const TypeIdentifier& _annotation_typeid)
1076 {
1077 m_annotation_typeid = _annotation_typeid;
1078 }
1079
1081 TypeIdentifier&& _annotation_typeid)
1082 {
1083 m_annotation_typeid = std::move(_annotation_typeid);
1084 }
1085
1086 inline const TypeIdentifier& annotation_typeid() const
1087 {
1088 return m_annotation_typeid;
1089 }
1090
1092 {
1093 return m_annotation_typeid;
1094 }
1095
1096 inline void param_seq(
1097 const AppliedAnnotationParameterSeq& _param_seq)
1098 {
1099 m_param_seq = _param_seq;
1100 }
1101
1102 inline void param_seq(
1103 AppliedAnnotationParameterSeq&& _param_seq)
1104 {
1105 m_param_seq = std::move(_param_seq);
1106 }
1107
1109 {
1110 return m_param_seq;
1111 }
1112
1114 {
1115 return m_param_seq;
1116 }
1117
1118#ifndef DOXYGEN_SHOULD_SKIP_THIS
1119 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::getCdrSerializedSize()",
1120 "In favor of version using eprosima::fastcdr::calculate_serialized_size.")
1121 RTPS_DllAPI static size_t getCdrSerializedSize(
1122 const AppliedAnnotation& data,
1123 size_t current_alignment = 0);
1124 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::serialize()",
1125 "In favor of version using eprosima::fastcdr::serialize.")
1126 RTPS_DllAPI void serialize(
1127 eprosima::fastcdr::Cdr& cdr) const;
1128 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::deserialize()",
1129 "In favor of version using eprosima::fastcdr::deserialize.")
1130 RTPS_DllAPI void deserialize(
1131 eprosima::fastcdr::Cdr& cdr);
1132#endif // DOXYGEN_SHOULD_SKIP_THIS
1133
1134 RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize(
1135 size_t current_alignment = 0);
1136 RTPS_DllAPI static bool isKeyDefined();
1137 RTPS_DllAPI void serializeKey(
1138 eprosima::fastcdr::Cdr& cdr) const;
1139
1140 RTPS_DllAPI bool operator ==(
1141 const AppliedAnnotation& other) const;
1142
1143private:
1144
1145 TypeIdentifier m_annotation_typeid;
1147};
1148
1149// Sorted by AppliedAnnotation.annotation_typeid
1150typedef std::vector<AppliedAnnotation> AppliedAnnotationSeq;
1151
1152// @verbatim(placement="<placement>", language="<lang>", text="<text>")
1153/*struct AppliedVerbatimAnnotation {
1154 std::string placement; // 32
1155 std::string language; // 32
1156 std::string text;
1157 };*/
1159{
1160public:
1161
1163
1165
1167 const AppliedVerbatimAnnotation& x);
1168
1171
1173 const AppliedVerbatimAnnotation& x);
1174
1177
1178 inline void placement(
1179 const std::string& _placement)
1180 {
1181 m_placement = _placement;
1182 }
1183
1184 inline void placement(
1185 std::string&& _placement)
1186 {
1187 m_placement = std::move(_placement);
1188 }
1189
1190 inline const std::string& placement() const
1191 {
1192 return m_placement;
1193 }
1194
1195 inline std::string& placement()
1196 {
1197 return m_placement;
1198 }
1199
1200 inline void language(
1201 const std::string& _language)
1202 {
1203 m_language = _language;
1204 }
1205
1206 inline void language(
1207 std::string&& _language)
1208 {
1209 m_language = std::move(_language);
1210 }
1211
1212 inline const std::string& language() const
1213 {
1214 return m_language;
1215 }
1216
1217 inline std::string& language()
1218 {
1219 return m_language;
1220 }
1221
1222 inline void text(
1223 const std::string& _text)
1224 {
1225 m_text = _text;
1226 }
1227
1228 inline void text(
1229 std::string&& _text)
1230 {
1231 m_text = std::move(_text);
1232 }
1233
1234 inline const std::string& text() const
1235 {
1236 return m_text;
1237 }
1238
1239 inline std::string& text()
1240 {
1241 return m_text;
1242 }
1243
1244#ifndef DOXYGEN_SHOULD_SKIP_THIS
1245 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::getCdrSerializedSize()",
1246 "In favor of version using eprosima::fastcdr::calculate_serialized_size.")
1247 RTPS_DllAPI static size_t getCdrSerializedSize(
1248 const AppliedVerbatimAnnotation& data,
1249 size_t current_alignment = 0);
1250
1251 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::serialize()",
1252 "In favor of version using eprosima::fastcdr::serialize.")
1253 RTPS_DllAPI void serialize(
1254 eprosima::fastcdr::Cdr& cdr) const;
1255
1256 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::deserialize()",
1257 "In favor of version using eprosima::fastcdr::deserialize.")
1258 RTPS_DllAPI void deserialize(
1259 eprosima::fastcdr::Cdr& cdr);
1260#endif // DOXYGEN_SHOULD_SKIP_THIS
1261
1262 RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize(
1263 size_t current_alignment = 0);
1264
1265 RTPS_DllAPI static bool isKeyDefined();
1266
1267 RTPS_DllAPI void serializeKey(
1268 eprosima::fastcdr::Cdr& cdr) const;
1269
1270 RTPS_DllAPI bool operator ==(
1271 const AppliedVerbatimAnnotation& other) const;
1272
1273private:
1274
1275 std::string m_placement;
1276 std::string m_language;
1277 std::string m_text;
1278};
1279
1280// --- Aggregate types: -----------------------------------------------
1281/*struct AppliedBuiltinMemberAnnotations {
1282 std::string unit; // @unit("<unit>") // @Optional
1283 AnnotationParameterValue min; // @min , @range // @Optional
1284 AnnotationParameterValue max; // @max , @range // @Optional
1285 std::string hash_id; // @hash_id("<membername>") // @Optional
1286 };
1287 */
1289{
1290public:
1291
1293
1295
1298
1301
1304
1307
1308 inline void unit(
1309 const std::string& _unit)
1310 {
1311 m_unit = _unit;
1312 }
1313
1314 inline void unit(
1315 std::string&& _unit)
1316 {
1317 m_unit = std::move(_unit);
1318 }
1319
1320 inline const std::string& unit() const
1321 {
1322 return m_unit;
1323 }
1324
1325 inline std::string& unit()
1326 {
1327 return m_unit;
1328 }
1329
1330 inline void min(
1331 const AnnotationParameterValue& _min)
1332 {
1333 m_min = _min;
1334 }
1335
1336 inline void min(
1338 {
1339 m_min = std::move(_min);
1340 }
1341
1342 inline const AnnotationParameterValue& min() const
1343 {
1344 return m_min;
1345 }
1346
1348 {
1349 return m_min;
1350 }
1351
1352 inline void max(
1353 const AnnotationParameterValue& _max)
1354 {
1355 m_max = _max;
1356 }
1357
1358 inline void max(
1360 {
1361 m_max = std::move(_max);
1362 }
1363
1364 inline const AnnotationParameterValue& max() const
1365 {
1366 return m_max;
1367 }
1368
1370 {
1371 return m_max;
1372 }
1373
1374 inline void hash_id(
1375 const std::string& _hash_id)
1376 {
1377 m_hash_id = _hash_id;
1378 }
1379
1380 inline void hash_id(
1381 std::string&& _hash_id)
1382 {
1383 m_hash_id = std::move(_hash_id);
1384 }
1385
1386 inline const std::string& hash_id() const
1387 {
1388 return m_hash_id;
1389 }
1390
1391 inline std::string& hash_id()
1392 {
1393 return m_hash_id;
1394 }
1395
1396#ifndef DOXYGEN_SHOULD_SKIP_THIS
1397 FASTDDS_SER_METHOD_DEPRECATED(3,
1398 "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::getCdrSerializedSize()",
1399 "In favor of version using eprosima::fastcdr::calculate_serialized_size.")
1400 RTPS_DllAPI static size_t getCdrSerializedSize(
1402 size_t current_alignment = 0);
1403
1404 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::serialize()",
1405 "In favor of version using eprosima::fastcdr::serialize.")
1406 RTPS_DllAPI void serialize(
1407 eprosima::fastcdr::Cdr& cdr) const;
1408
1409 FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::deserialize()",
1410 "In favor of version using eprosima::fastcdr::deserialize.")
1411 RTPS_DllAPI void deserialize(
1412 eprosima::fastcdr::Cdr& cdr);
1413#endif // DOXYGEN_SHOULD_SKIP_THIS
1414
1415 RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize(
1416 size_t current_alignment = 0);
1417
1418 RTPS_DllAPI static bool isKeyDefined();
1419
1420 RTPS_DllAPI void serializeKey(
1421 eprosima::fastcdr::Cdr& cdr) const;
1422
1423 RTPS_DllAPI bool operator ==(
1424 const AppliedBuiltinMemberAnnotations& other) const;
1425
1426private:
1427
1428 std::string m_unit;
1431 std::string m_hash_id;
1432};
1433
1434
1435} // namespace types
1436} // namespace fastrtps
1437} // namespace eprosima
1438
1439#if _MSC_VER
1440
1441#if defined(FASTDDS_RESTORE_MIN)
1442#pragma pop_macro("min")
1443#undef FASTDDS_RESTORE_MIN
1444#endif // defined(FASTDDS_RESTORE_MIN)
1445
1446#if defined(FASTDDS_RESTORE_MAX)
1447#pragma pop_macro("max")
1448#undef FASTDDS_RESTORE_MAX
1449#endif // defined(FASTDDS_RESTORE_MAX)
1450
1451#endif // if _MSC_VER
1452
1453#endif // _ANNOTATIONPARAMETERVALUE_H_
This class represents the union AnnotationParameterValue defined by the user in the IDL file.
Definition AnnotationParameterValue.h:173
RTPS_DllAPI void int16_value(int16_t _int16_value)
This function sets a value in member int16_value.
RTPS_DllAPI const std::string & string8_value() const
This function returns a constant reference to member string8_value.
RTPS_DllAPI wchar_t & wchar_value()
This function returns a reference to member wchar_value.
RTPS_DllAPI long double & float128_value()
This function returns a reference to member float128_value.
RTPS_DllAPI void wchar_value(wchar_t _wchar_value)
This function sets a value in member wchar_value.
RTPS_DllAPI double & float64_value()
This function returns a reference to member float64_value.
RTPS_DllAPI uint32_t & uint32_value()
This function returns a reference to member uint32_value.
RTPS_DllAPI int32_t int32_value() const
This function returns the value of member int32_value.
RTPS_DllAPI AnnotationParameterValue(const AnnotationParameterValue &x)
Copy constructor.
RTPS_DllAPI void byte_value(uint8_t _byte_value)
This function sets a value in member byte_value.
RTPS_DllAPI uint64_t & uint64_value()
This function returns a reference to member uint64_value.
RTPS_DllAPI char & char_value()
This function returns a reference to member char_value.
RTPS_DllAPI void from_string(const std::string &value)
Aux method to set value from its string representation.
Definition AnnotationParameterValue.h:705
RTPS_DllAPI std::wstring & string16_value()
This function returns a reference to member string16_value.
RTPS_DllAPI void extended_value(const ExtendedAnnotationParameterValue &_extended_value)
This function copies the value in member extended_value.
RTPS_DllAPI long double float128_value() const
This function returns the value of member float128_value.
RTPS_DllAPI void string16_value(std::wstring &&_string16_value)
This function moves the value in member string16_value.
RTPS_DllAPI uint32_t uint32_value() const
This function returns the value of member uint32_value.
RTPS_DllAPI void string8_value(std::string &&_string8_value)
This function moves the value in member string8_value.
RTPS_DllAPI const std::wstring & string16_value() const
This function returns a constant reference to member string16_value.
RTPS_DllAPI uint8_t byte_value() const
This function returns the value of member byte_value.
static RTPS_DllAPI size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of the Key of an object depending on the buffer ali...
RTPS_DllAPI std::string to_string() const
Aux method to return value as its string representation.
Definition AnnotationParameterValue.h:658
RTPS_DllAPI const ExtendedAnnotationParameterValue & extended_value() const
This function returns a constant reference to member extended_value.
RTPS_DllAPI bool boolean_value() const
This function returns the value of member boolean_value.
RTPS_DllAPI int16_t int16_value() const
This function returns the value of member int16_value.
RTPS_DllAPI float float32_value() const
This function returns the value of member float32_value.
RTPS_DllAPI void enumerated_value(int32_t _enumerated_value)
This function sets a value in member enumerated_value.
RTPS_DllAPI int32_t enumerated_value() const
This function returns the value of member enumerated_value.
RTPS_DllAPI uint8_t & byte_value()
This function returns a reference to member byte_value.
RTPS_DllAPI void uint32_value(uint32_t _uint32_value)
This function sets a value in member uint32_value.
RTPS_DllAPI int32_t & int32_value()
This function returns a reference to member int32_value.
RTPS_DllAPI bool & boolean_value()
This function returns a reference to member boolean_value.
RTPS_DllAPI int64_t int64_value() const
This function returns the value of member int64_value.
RTPS_DllAPI std::string & string8_value()
This function returns a reference to member string8_value.
static RTPS_DllAPI bool isKeyDefined()
This function tells you if the Key has been defined for this type.
RTPS_DllAPI void int32_value(int32_t _int32_value)
This function sets a value in member int32_value.
RTPS_DllAPI char _d() const
This function returns the value of the discriminator.
RTPS_DllAPI int16_t & int16_value()
This function returns a reference to member int16_value.
RTPS_DllAPI AnnotationParameterValue(AnnotationParameterValue &&x)
Move constructor.
RTPS_DllAPI wchar_t wchar_value() const
This function returns the value of member wchar_value.
RTPS_DllAPI uint64_t uint64_value() const
This function returns the value of member uint64_value.
RTPS_DllAPI void string16_value(const std::wstring &_string16_value)
This function copies the value in member string16_value.
RTPS_DllAPI void extended_value(ExtendedAnnotationParameterValue &&_extended_value)
This function moves the value in member extended_value.
RTPS_DllAPI void float32_value(float _float32_value)
This function sets a value in member float32_value.
RTPS_DllAPI void int64_value(int64_t _int64_value)
This function sets a value in member int64_value.
RTPS_DllAPI void float128_value(long double _float128_value)
This function sets a value in member float128_value.
RTPS_DllAPI int64_t & int64_value()
This function returns a reference to member int64_value.
RTPS_DllAPI void char_value(char _char_value)
This function sets a value in member char_value.
RTPS_DllAPI double float64_value() const
This function returns the value of member float64_value.
RTPS_DllAPI AnnotationParameterValue & operator=(const AnnotationParameterValue &x)
Copy assignment.
RTPS_DllAPI void uint_16_value(uint16_t _uint_16_value)
This function sets a value in member uint_16_value.
RTPS_DllAPI ~AnnotationParameterValue()
Default destructor.
RTPS_DllAPI float & float32_value()
This function returns a reference to member float32_value.
RTPS_DllAPI AnnotationParameterValue()
Default constructor.
RTPS_DllAPI uint16_t & uint_16_value()
This function returns a reference to member uint_16_value.
RTPS_DllAPI void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
RTPS_DllAPI int32_t & enumerated_value()
This function returns a reference to member enumerated_value.
RTPS_DllAPI bool operator==(const AnnotationParameterValue &other) const
RTPS_DllAPI void string8_value(const std::string &_string8_value)
This function copies the value in member string8_value.
RTPS_DllAPI void _d(char __d)
This function sets the discriminator value.
RTPS_DllAPI uint16_t uint_16_value() const
This function returns the value of member uint_16_value.
RTPS_DllAPI void uint64_value(uint64_t _uint64_value)
This function sets a value in member uint64_value.
RTPS_DllAPI void boolean_value(bool _boolean_value)
This function sets a value in member boolean_value.
RTPS_DllAPI char char_value() const
This function returns the value of member char_value.
RTPS_DllAPI char & _d()
This function returns a reference to the discriminator.
RTPS_DllAPI ExtendedAnnotationParameterValue & extended_value()
This function returns a reference to member extended_value.
RTPS_DllAPI void float64_value(double _float64_value)
This function sets a value in member float64_value.
Definition AnnotationParameterValue.h:1057
RTPS_DllAPI bool operator==(const AppliedAnnotation &other) const
void param_seq(const AppliedAnnotationParameterSeq &_param_seq)
Definition AnnotationParameterValue.h:1096
const TypeIdentifier & annotation_typeid() const
Definition AnnotationParameterValue.h:1086
void annotation_typeid(const TypeIdentifier &_annotation_typeid)
Definition AnnotationParameterValue.h:1074
TypeIdentifier & annotation_typeid()
Definition AnnotationParameterValue.h:1091
static RTPS_DllAPI size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
const AppliedAnnotationParameterSeq & param_seq() const
Definition AnnotationParameterValue.h:1108
void param_seq(AppliedAnnotationParameterSeq &&_param_seq)
Definition AnnotationParameterValue.h:1102
RTPS_DllAPI AppliedAnnotation(AppliedAnnotation &&x)
RTPS_DllAPI AppliedAnnotation & operator=(const AppliedAnnotation &x)
AppliedAnnotationParameterSeq & param_seq()
Definition AnnotationParameterValue.h:1113
RTPS_DllAPI void serializeKey(eprosima::fastcdr::Cdr &cdr) const
RTPS_DllAPI AppliedAnnotation(const AppliedAnnotation &x)
void annotation_typeid(TypeIdentifier &&_annotation_typeid)
Definition AnnotationParameterValue.h:1080
This class represents the structure AppliedAnnotationParameter defined by the user in the IDL file.
Definition AnnotationParameterValue.h:831
RTPS_DllAPI AppliedAnnotationParameter()
Default constructor.
const NameHash & paramname_hash() const
This function returns a constant reference to member paramname_hash.
Definition AnnotationParameterValue.h:896
RTPS_DllAPI bool operator==(const AppliedAnnotationParameter &other) const
RTPS_DllAPI AppliedAnnotationParameter(const AppliedAnnotationParameter &x)
Copy constructor.
void value(const AnnotationParameterValue &_value)
This function copies the value in member value.
Definition AnnotationParameterValue.h:914
AnnotationParameterValue & value()
This function returns a reference to member value.
Definition AnnotationParameterValue.h:943
void value(AnnotationParameterValue &&_value)
This function moves the value in member value.
Definition AnnotationParameterValue.h:924
const AnnotationParameterValue & value() const
This function returns a constant reference to member value.
Definition AnnotationParameterValue.h:934
static RTPS_DllAPI size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of the Key of an object depending on the buffer ali...
NameHash & paramname_hash()
This function returns a reference to member paramname_hash.
Definition AnnotationParameterValue.h:905
void paramname_hash(const NameHash &_paramname_hash)
This function copies the value in member paramname_hash.
Definition AnnotationParameterValue.h:876
RTPS_DllAPI AppliedAnnotationParameter & operator=(const AppliedAnnotationParameter &x)
Copy assignment.
static RTPS_DllAPI bool isKeyDefined()
This function tells you if the Key has been defined for this type.
RTPS_DllAPI AppliedAnnotationParameter(AppliedAnnotationParameter &&x)
Move constructor.
void paramname_hash(NameHash &&_paramname_hash)
This function moves the value in member paramname_hash.
Definition AnnotationParameterValue.h:886
RTPS_DllAPI void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
RTPS_DllAPI ~AppliedAnnotationParameter()
Default destructor.
Definition AnnotationParameterValue.h:1289
void max(const AnnotationParameterValue &_max)
Definition AnnotationParameterValue.h:1352
void min(AnnotationParameterValue &&_min)
Definition AnnotationParameterValue.h:1336
AnnotationParameterValue & max()
Definition AnnotationParameterValue.h:1369
AnnotationParameterValue & min()
Definition AnnotationParameterValue.h:1347
std::string & unit()
Definition AnnotationParameterValue.h:1325
void hash_id(std::string &&_hash_id)
Definition AnnotationParameterValue.h:1380
void unit(std::string &&_unit)
Definition AnnotationParameterValue.h:1314
void max(AnnotationParameterValue &&_max)
Definition AnnotationParameterValue.h:1358
static RTPS_DllAPI size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
const AnnotationParameterValue & min() const
Definition AnnotationParameterValue.h:1342
RTPS_DllAPI AppliedBuiltinMemberAnnotations(AppliedBuiltinMemberAnnotations &&x)
std::string & hash_id()
Definition AnnotationParameterValue.h:1391
const AnnotationParameterValue & max() const
Definition AnnotationParameterValue.h:1364
RTPS_DllAPI AppliedBuiltinMemberAnnotations(const AppliedBuiltinMemberAnnotations &x)
RTPS_DllAPI AppliedBuiltinMemberAnnotations & operator=(const AppliedBuiltinMemberAnnotations &x)
const std::string & unit() const
Definition AnnotationParameterValue.h:1320
void unit(const std::string &_unit)
Definition AnnotationParameterValue.h:1308
RTPS_DllAPI void serializeKey(eprosima::fastcdr::Cdr &cdr) const
void hash_id(const std::string &_hash_id)
Definition AnnotationParameterValue.h:1374
void min(const AnnotationParameterValue &_min)
Definition AnnotationParameterValue.h:1330
RTPS_DllAPI bool operator==(const AppliedBuiltinMemberAnnotations &other) const
const std::string & hash_id() const
Definition AnnotationParameterValue.h:1386
Definition AnnotationParameterValue.h:1159
void text(const std::string &_text)
Definition AnnotationParameterValue.h:1222
void text(std::string &&_text)
Definition AnnotationParameterValue.h:1228
const std::string & language() const
Definition AnnotationParameterValue.h:1212
static RTPS_DllAPI size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
void placement(std::string &&_placement)
Definition AnnotationParameterValue.h:1184
RTPS_DllAPI AppliedVerbatimAnnotation(const AppliedVerbatimAnnotation &x)
const std::string & placement() const
Definition AnnotationParameterValue.h:1190
RTPS_DllAPI bool operator==(const AppliedVerbatimAnnotation &other) const
void placement(const std::string &_placement)
Definition AnnotationParameterValue.h:1178
RTPS_DllAPI AppliedVerbatimAnnotation(AppliedVerbatimAnnotation &&x)
void language(const std::string &_language)
Definition AnnotationParameterValue.h:1200
void language(std::string &&_language)
Definition AnnotationParameterValue.h:1206
std::string & language()
Definition AnnotationParameterValue.h:1217
const std::string & text() const
Definition AnnotationParameterValue.h:1234
RTPS_DllAPI void serializeKey(eprosima::fastcdr::Cdr &cdr) const
std::string & text()
Definition AnnotationParameterValue.h:1239
std::string & placement()
Definition AnnotationParameterValue.h:1195
RTPS_DllAPI AppliedVerbatimAnnotation & operator=(const AppliedVerbatimAnnotation &x)
This class represents the structure ExtendedAnnotationParameterValue defined by the user in the IDL f...
Definition AnnotationParameterValue.h:65
RTPS_DllAPI ExtendedAnnotationParameterValue & operator=(const ExtendedAnnotationParameterValue &x)
Copy assignment.
static RTPS_DllAPI size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of the Key of an object depending on the buffer ali...
RTPS_DllAPI ExtendedAnnotationParameterValue(ExtendedAnnotationParameterValue &&x)
Move constructor.
RTPS_DllAPI ExtendedAnnotationParameterValue(const ExtendedAnnotationParameterValue &x)
Copy constructor.
RTPS_DllAPI ExtendedAnnotationParameterValue()
Default constructor.
static RTPS_DllAPI bool isKeyDefined()
This function tells you if the Key has been defined for this type.
RTPS_DllAPI bool operator==(const ExtendedAnnotationParameterValue &) const
Definition AnnotationParameterValue.h:160
RTPS_DllAPI ~ExtendedAnnotationParameterValue()
Default destructor.
RTPS_DllAPI void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
Definition TypeIdentifier.h:81
const octet TK_FLOAT32
Definition TypesBase.h:131
const octet TK_BYTE
Definition TypesBase.h:124
const octet TK_UINT64
Definition TypesBase.h:130
const octet TK_FLOAT64
Definition TypesBase.h:132
const octet TK_STRING16
Definition TypesBase.h:139
const octet TK_INT32
Definition TypesBase.h:126
const octet TK_UINT16
Definition TypesBase.h:128
const octet TK_CHAR8
Definition TypesBase.h:134
std::vector< AppliedAnnotationParameter > AppliedAnnotationParameterSeq
Definition AnnotationParameterValue.h:1050
const octet TK_CHAR16
Definition TypesBase.h:135
const std::string CONST_TRUE
Definition TypesBase.h:59
const octet TK_INT16
Definition TypesBase.h:125
const octet TK_BOOLEAN
Definition TypesBase.h:123
const octet TK_FLOAT128
Definition TypesBase.h:133
const octet TK_ENUM
Definition TypesBase.h:146
std::vector< AppliedAnnotation > AppliedAnnotationSeq
Definition AnnotationParameterValue.h:1150
const octet TK_INT64
Definition TypesBase.h:127
const octet TK_NONE
Definition TypesBase.h:122
const octet TK_STRING8
Definition TypesBase.h:138
const octet TK_UINT32
Definition TypesBase.h:129
std::array< uint8_t, 4 > NameHash
Definition TypesBase.h:179
std::string wstring_to_bytes(const std::wstring &str)
std::wstring wstring_from_bytes(const std::string &str)
eProsima namespace.
Definition LibrarySettingsAttributes.h:23