diff --git a/cyclonedds/idl/_main.py b/cyclonedds/idl/_main.py index eec4d124..26f8a218 100644 --- a/cyclonedds/idl/_main.py +++ b/cyclonedds/idl/_main.py @@ -406,6 +406,7 @@ def _union_default_finder(_type, cases): types.int32: (-1, -1, -2147483648), types.int64: (-1, -1, -9223372036854775808), int: (-1, -1, -9223372036854775808), + types.byte: (0, 1, 255), types.uint8: (0, 1, 255), types.uint16: (0, 1, 65535), types.uint32: (0, 1, 4294967295), diff --git a/cyclonedds/idl/_typesupport/DDS/XTypes/__init__.py b/cyclonedds/idl/_typesupport/DDS/XTypes/__init__.py index 57b7f4fb..0dd14d2b 100644 --- a/cyclonedds/idl/_typesupport/DDS/XTypes/__init__.py +++ b/cyclonedds/idl/_typesupport/DDS/XTypes/__init__.py @@ -5,6 +5,6 @@ """ -from ._ddsi_xt_type_object import ANNOTATION_OCTETSEC_VALUE_MAX_LEN, ANNOTATION_STR_VALUE_MAX_LEN, AliasMemberFlag, AliasTypeFlag, AnnotationParameterFlag, AnnotationParameterValue, AnnotationTypeFlag, AppliedAnnotation, AppliedAnnotationParameter, AppliedAnnotationParameterSeq, AppliedAnnotationSeq, AppliedBuiltinMemberAnnotations, AppliedBuiltinTypeAnnotations, AppliedVerbatimAnnotation, BitBound, BitflagFlag, BitmaskTypeFlag, BitsetMemberFlag, BitsetTypeFlag, CollectionElementFlag, CollectionTypeFlag, CommonAliasBody, CommonAnnotationParameter, CommonArrayHeader, CommonBitfield, CommonBitflag, CommonBitmaskHeader, CommonCollectionElement, CommonCollectionHeader, CommonDiscriminatorMember, CommonEnumeratedHeader, CommonEnumeratedLiteral, CommonStructMember, CommonUnionMember, CompleteAliasBody, CompleteAliasHeader, CompleteAliasType, CompleteAnnotationHeader, CompleteAnnotationParameter, CompleteAnnotationParameterSeq, CompleteAnnotationType, CompleteArrayHeader, CompleteArrayType, CompleteBitfield, CompleteBitfieldSeq, CompleteBitflag, CompleteBitflagSeq, CompleteBitmaskHeader, CompleteBitmaskType, CompleteBitsetHeader, CompleteBitsetType, CompleteCollectionElement, CompleteCollectionHeader, CompleteDiscriminatorMember, CompleteElementDetail, CompleteEnumeratedHeader, CompleteEnumeratedLiteral, CompleteEnumeratedLiteralSeq, CompleteEnumeratedType, CompleteExtendedType, CompleteMapType, CompleteMemberDetail, CompleteSequenceType, CompleteStructHeader, CompleteStructMember, CompleteStructMemberSeq, CompleteStructType, CompleteTypeDetail, CompleteTypeObject, CompleteUnionHeader, CompleteUnionMember, CompleteUnionMemberSeq, CompleteUnionType, EK_BOTH, EK_COMPLETE, EK_MINIMAL, EnumTypeFlag, EnumeratedLiteralFlag, EquivalenceHash, EquivalenceKind, ExtendedAnnotationParameterValue, ExtendedTypeDefn, INVALID_LBOUND, INVALID_SBOUND, LBound, LBoundSeq, MEMBER_NAME_MAX_LENGTH, MemberFlag, MemberFlagMinimalMask, MemberId, MemberName, MinimalAliasBody, MinimalAliasHeader, MinimalAliasType, MinimalAnnotationHeader, MinimalAnnotationParameter, MinimalAnnotationParameterSeq, MinimalAnnotationType, MinimalArrayHeader, MinimalArrayType, MinimalBitfield, MinimalBitfieldSeq, MinimalBitflag, MinimalBitflagSeq, MinimalBitmaskHeader, MinimalBitmaskType, MinimalBitsetHeader, MinimalBitsetType, MinimalCollectionElement, MinimalCollectionHeader, MinimalDiscriminatorMember, MinimalEnumeratedHeader, MinimalEnumeratedLiteral, MinimalEnumeratedLiteralSeq, MinimalEnumeratedType, MinimalExtendedType, MinimalMapType, MinimalMemberDetail, MinimalSequenceType, MinimalStructHeader, MinimalStructMember, MinimalStructMemberSeq, MinimalStructType, MinimalTypeDetail, MinimalTypeObject, MinimalUnionHeader, MinimalUnionMember, MinimalUnionMemberSeq, MinimalUnionType, NameHash, PlainArrayLElemDefn, PlainArraySElemDefn, PlainCollectionHeader, PlainMapLTypeDefn, PlainMapSTypeDefn, PlainSequenceLElemDefn, PlainSequenceSElemDefn, PrimitiveTypeId, QualifiedTypeName, SBound, SBoundSeq, StringLTypeDefn, StringSTypeDefn, StronglyConnectedComponent, StronglyConnectedComponentId, StructMemberFlag, StructTypeFlag, TI_PLAIN_ARRAY_LARGE, TI_PLAIN_ARRAY_SMALL, TI_PLAIN_MAP_LARGE, TI_PLAIN_MAP_SMALL, TI_PLAIN_SEQUENCE_LARGE, TI_PLAIN_SEQUENCE_SMALL, TI_STRING16_LARGE, TI_STRING16_SMALL, TI_STRING8_LARGE, TI_STRING8_SMALL, TI_STRONGLY_CONNECTED_COMPONENT, TK_ALIAS, TK_ANNOTATION, TK_ARRAY, TK_BITMASK, TK_BITSET, TK_BOOLEAN, TK_BYTE, TK_CHAR16, TK_CHAR8, TK_ENUM, TK_FLOAT128, TK_FLOAT32, TK_FLOAT64, TK_INT16, TK_INT32, TK_INT64, TK_MAP, TK_NONE, TK_SEQUENCE, TK_STRING16, TK_STRING8, TK_STRUCTURE, TK_UINT16, TK_UINT32, TK_UINT64, TK_UNION, TYPE_NAME_MAX_LENGTH, TypeFlag, TypeFlagMinimalMask, TypeIdentfierWithSizeSeq, TypeIdentiferKind, TypeIdentifier, TypeIdentifierPair, TypeIdentifierPairSeq, TypeIdentifierSeq, TypeIdentifierTypeObjectPair, TypeIdentifierTypeObjectPairSeq, TypeIdentifierWithDependencies, TypeIdentifierWithDependenciesSeq, TypeIdentifierWithSize, TypeInformation, TypeInformationSeq, TypeKind, TypeObject, TypeObjectHashId, TypeObjectSeq, UnionCaseLabelSeq, UnionDiscriminatorFlag, UnionMemberFlag, UnionTypeFlag +from ._ddsi_xt_type_object import ANNOTATION_OCTETSEC_VALUE_MAX_LEN, ANNOTATION_STR_VALUE_MAX_LEN, AliasMemberFlag, AliasTypeFlag, AnnotationParameterFlag, AnnotationParameterValue, AnnotationTypeFlag, AppliedAnnotation, AppliedAnnotationParameter, AppliedAnnotationParameterSeq, AppliedAnnotationSeq, AppliedBuiltinMemberAnnotations, AppliedBuiltinTypeAnnotations, AppliedVerbatimAnnotation, BitBound, BitflagFlag, BitmaskTypeFlag, BitsetMemberFlag, BitsetTypeFlag, CollectionElementFlag, CollectionTypeFlag, CommonAliasBody, CommonAnnotationParameter, CommonArrayHeader, CommonBitfield, CommonBitflag, CommonBitmaskHeader, CommonCollectionElement, CommonCollectionHeader, CommonDiscriminatorMember, CommonEnumeratedHeader, CommonEnumeratedLiteral, CommonStructMember, CommonUnionMember, CompleteAliasBody, CompleteAliasHeader, CompleteAliasType, CompleteAnnotationHeader, CompleteAnnotationParameter, CompleteAnnotationParameterSeq, CompleteAnnotationType, CompleteArrayHeader, CompleteArrayType, CompleteBitfield, CompleteBitfieldSeq, CompleteBitflag, CompleteBitflagSeq, CompleteBitmaskHeader, CompleteBitmaskType, CompleteBitsetHeader, CompleteBitsetType, CompleteCollectionElement, CompleteCollectionHeader, CompleteDiscriminatorMember, CompleteElementDetail, CompleteEnumeratedHeader, CompleteEnumeratedLiteral, CompleteEnumeratedLiteralSeq, CompleteEnumeratedType, CompleteExtendedType, CompleteMapType, CompleteMemberDetail, CompleteSequenceType, CompleteStructHeader, CompleteStructMember, CompleteStructMemberSeq, CompleteStructType, CompleteTypeDetail, CompleteTypeObject, CompleteUnionHeader, CompleteUnionMember, CompleteUnionMemberSeq, CompleteUnionType, EK_BOTH, EK_COMPLETE, EK_MINIMAL, EnumTypeFlag, EnumeratedLiteralFlag, EquivalenceHash, EquivalenceKind, ExtendedAnnotationParameterValue, ExtendedTypeDefn, INVALID_LBOUND, INVALID_SBOUND, LBound, LBoundSeq, MEMBER_NAME_MAX_LENGTH, MemberFlag, MemberFlagMinimalMask, MemberId, MemberName, MinimalAliasBody, MinimalAliasHeader, MinimalAliasType, MinimalAnnotationHeader, MinimalAnnotationParameter, MinimalAnnotationParameterSeq, MinimalAnnotationType, MinimalArrayHeader, MinimalArrayType, MinimalBitfield, MinimalBitfieldSeq, MinimalBitflag, MinimalBitflagSeq, MinimalBitmaskHeader, MinimalBitmaskType, MinimalBitsetHeader, MinimalBitsetType, MinimalCollectionElement, MinimalCollectionHeader, MinimalDiscriminatorMember, MinimalEnumeratedHeader, MinimalEnumeratedLiteral, MinimalEnumeratedLiteralSeq, MinimalEnumeratedType, MinimalExtendedType, MinimalMapType, MinimalMemberDetail, MinimalSequenceType, MinimalStructHeader, MinimalStructMember, MinimalStructMemberSeq, MinimalStructType, MinimalTypeDetail, MinimalTypeObject, MinimalUnionHeader, MinimalUnionMember, MinimalUnionMemberSeq, MinimalUnionType, NameHash, PlainArrayLElemDefn, PlainArraySElemDefn, PlainCollectionHeader, PlainMapLTypeDefn, PlainMapSTypeDefn, PlainSequenceLElemDefn, PlainSequenceSElemDefn, PrimitiveTypeId, QualifiedTypeName, SBound, SBoundSeq, StringLTypeDefn, StringSTypeDefn, StronglyConnectedComponent, StronglyConnectedComponentId, StructMemberFlag, StructTypeFlag, TI_PLAIN_ARRAY_LARGE, TI_PLAIN_ARRAY_SMALL, TI_PLAIN_MAP_LARGE, TI_PLAIN_MAP_SMALL, TI_PLAIN_SEQUENCE_LARGE, TI_PLAIN_SEQUENCE_SMALL, TI_STRING16_LARGE, TI_STRING16_SMALL, TI_STRING8_LARGE, TI_STRING8_SMALL, TI_STRONGLY_CONNECTED_COMPONENT, TK_ALIAS, TK_ANNOTATION, TK_ARRAY, TK_BITMASK, TK_BITSET, TK_BOOLEAN, TK_BYTE, TK_CHAR16, TK_CHAR8, TK_ENUM, TK_FLOAT128, TK_FLOAT32, TK_FLOAT64, TK_INT8, TK_INT16, TK_INT32, TK_INT64, TK_MAP, TK_NONE, TK_SEQUENCE, TK_STRING16, TK_STRING8, TK_STRUCTURE, TK_UINT8, TK_UINT16, TK_UINT32, TK_UINT64, TK_UNION, TYPE_NAME_MAX_LENGTH, TypeFlag, TypeFlagMinimalMask, TypeIdentfierWithSizeSeq, TypeIdentiferKind, TypeIdentifier, TypeIdentifierPair, TypeIdentifierPairSeq, TypeIdentifierSeq, TypeIdentifierTypeObjectPair, TypeIdentifierTypeObjectPairSeq, TypeIdentifierWithDependencies, TypeIdentifierWithDependenciesSeq, TypeIdentifierWithSize, TypeInformation, TypeInformationSeq, TypeKind, TypeObject, TypeObjectHashId, TypeObjectSeq, UnionCaseLabelSeq, UnionDiscriminatorFlag, UnionMemberFlag, UnionTypeFlag from ._ddsi_xt_typemap import TypeMapping -__all__ = ["ANNOTATION_OCTETSEC_VALUE_MAX_LEN", "ANNOTATION_STR_VALUE_MAX_LEN", "AliasMemberFlag", "AliasTypeFlag", "AnnotationParameterFlag", "AnnotationParameterValue", "AnnotationTypeFlag", "AppliedAnnotation", "AppliedAnnotationParameter", "AppliedAnnotationParameterSeq", "AppliedAnnotationSeq", "AppliedBuiltinMemberAnnotations", "AppliedBuiltinTypeAnnotations", "AppliedVerbatimAnnotation", "BitBound", "BitflagFlag", "BitmaskTypeFlag", "BitsetMemberFlag", "BitsetTypeFlag", "CollectionElementFlag", "CollectionTypeFlag", "CommonAliasBody", "CommonAnnotationParameter", "CommonArrayHeader", "CommonBitfield", "CommonBitflag", "CommonBitmaskHeader", "CommonCollectionElement", "CommonCollectionHeader", "CommonDiscriminatorMember", "CommonEnumeratedHeader", "CommonEnumeratedLiteral", "CommonStructMember", "CommonUnionMember", "CompleteAliasBody", "CompleteAliasHeader", "CompleteAliasType", "CompleteAnnotationHeader", "CompleteAnnotationParameter", "CompleteAnnotationParameterSeq", "CompleteAnnotationType", "CompleteArrayHeader", "CompleteArrayType", "CompleteBitfield", "CompleteBitfieldSeq", "CompleteBitflag", "CompleteBitflagSeq", "CompleteBitmaskHeader", "CompleteBitmaskType", "CompleteBitsetHeader", "CompleteBitsetType", "CompleteCollectionElement", "CompleteCollectionHeader", "CompleteDiscriminatorMember", "CompleteElementDetail", "CompleteEnumeratedHeader", "CompleteEnumeratedLiteral", "CompleteEnumeratedLiteralSeq", "CompleteEnumeratedType", "CompleteExtendedType", "CompleteMapType", "CompleteMemberDetail", "CompleteSequenceType", "CompleteStructHeader", "CompleteStructMember", "CompleteStructMemberSeq", "CompleteStructType", "CompleteTypeDetail", "CompleteTypeObject", "CompleteUnionHeader", "CompleteUnionMember", "CompleteUnionMemberSeq", "CompleteUnionType", "EK_BOTH", "EK_COMPLETE", "EK_MINIMAL", "EnumTypeFlag", "EnumeratedLiteralFlag", "EquivalenceHash", "EquivalenceKind", "ExtendedAnnotationParameterValue", "ExtendedTypeDefn", "INVALID_LBOUND", "INVALID_SBOUND", "LBound", "LBoundSeq", "MEMBER_NAME_MAX_LENGTH", "MemberFlag", "MemberFlagMinimalMask", "MemberId", "MemberName", "MinimalAliasBody", "MinimalAliasHeader", "MinimalAliasType", "MinimalAnnotationHeader", "MinimalAnnotationParameter", "MinimalAnnotationParameterSeq", "MinimalAnnotationType", "MinimalArrayHeader", "MinimalArrayType", "MinimalBitfield", "MinimalBitfieldSeq", "MinimalBitflag", "MinimalBitflagSeq", "MinimalBitmaskHeader", "MinimalBitmaskType", "MinimalBitsetHeader", "MinimalBitsetType", "MinimalCollectionElement", "MinimalCollectionHeader", "MinimalDiscriminatorMember", "MinimalEnumeratedHeader", "MinimalEnumeratedLiteral", "MinimalEnumeratedLiteralSeq", "MinimalEnumeratedType", "MinimalExtendedType", "MinimalMapType", "MinimalMemberDetail", "MinimalSequenceType", "MinimalStructHeader", "MinimalStructMember", "MinimalStructMemberSeq", "MinimalStructType", "MinimalTypeDetail", "MinimalTypeObject", "MinimalUnionHeader", "MinimalUnionMember", "MinimalUnionMemberSeq", "MinimalUnionType", "NameHash", "PlainArrayLElemDefn", "PlainArraySElemDefn", "PlainCollectionHeader", "PlainMapLTypeDefn", "PlainMapSTypeDefn", "PlainSequenceLElemDefn", "PlainSequenceSElemDefn", "PrimitiveTypeId", "QualifiedTypeName", "SBound", "SBoundSeq", "StringLTypeDefn", "StringSTypeDefn", "StronglyConnectedComponent", "StronglyConnectedComponentId", "StructMemberFlag", "StructTypeFlag", "TI_PLAIN_ARRAY_LARGE", "TI_PLAIN_ARRAY_SMALL", "TI_PLAIN_MAP_LARGE", "TI_PLAIN_MAP_SMALL", "TI_PLAIN_SEQUENCE_LARGE", "TI_PLAIN_SEQUENCE_SMALL", "TI_STRING16_LARGE", "TI_STRING16_SMALL", "TI_STRING8_LARGE", "TI_STRING8_SMALL", "TI_STRONGLY_CONNECTED_COMPONENT", "TK_ALIAS", "TK_ANNOTATION", "TK_ARRAY", "TK_BITMASK", "TK_BITSET", "TK_BOOLEAN", "TK_BYTE", "TK_CHAR16", "TK_CHAR8", "TK_ENUM", "TK_FLOAT128", "TK_FLOAT32", "TK_FLOAT64", "TK_INT16", "TK_INT32", "TK_INT64", "TK_MAP", "TK_NONE", "TK_SEQUENCE", "TK_STRING16", "TK_STRING8", "TK_STRUCTURE", "TK_UINT16", "TK_UINT32", "TK_UINT64", "TK_UNION", "TYPE_NAME_MAX_LENGTH", "TypeFlag", "TypeFlagMinimalMask", "TypeIdentfierWithSizeSeq", "TypeIdentiferKind", "TypeIdentifier", "TypeIdentifierPair", "TypeIdentifierPairSeq", "TypeIdentifierSeq", "TypeIdentifierTypeObjectPair", "TypeIdentifierTypeObjectPairSeq", "TypeIdentifierWithDependencies", "TypeIdentifierWithDependenciesSeq", "TypeIdentifierWithSize", "TypeInformation", "TypeInformationSeq", "TypeKind", "TypeObject", "TypeObjectHashId", "TypeObjectSeq", "UnionCaseLabelSeq", "UnionDiscriminatorFlag", "UnionMemberFlag", "UnionTypeFlag", "TypeMapping", ] +__all__ = ["ANNOTATION_OCTETSEC_VALUE_MAX_LEN", "ANNOTATION_STR_VALUE_MAX_LEN", "AliasMemberFlag", "AliasTypeFlag", "AnnotationParameterFlag", "AnnotationParameterValue", "AnnotationTypeFlag", "AppliedAnnotation", "AppliedAnnotationParameter", "AppliedAnnotationParameterSeq", "AppliedAnnotationSeq", "AppliedBuiltinMemberAnnotations", "AppliedBuiltinTypeAnnotations", "AppliedVerbatimAnnotation", "BitBound", "BitflagFlag", "BitmaskTypeFlag", "BitsetMemberFlag", "BitsetTypeFlag", "CollectionElementFlag", "CollectionTypeFlag", "CommonAliasBody", "CommonAnnotationParameter", "CommonArrayHeader", "CommonBitfield", "CommonBitflag", "CommonBitmaskHeader", "CommonCollectionElement", "CommonCollectionHeader", "CommonDiscriminatorMember", "CommonEnumeratedHeader", "CommonEnumeratedLiteral", "CommonStructMember", "CommonUnionMember", "CompleteAliasBody", "CompleteAliasHeader", "CompleteAliasType", "CompleteAnnotationHeader", "CompleteAnnotationParameter", "CompleteAnnotationParameterSeq", "CompleteAnnotationType", "CompleteArrayHeader", "CompleteArrayType", "CompleteBitfield", "CompleteBitfieldSeq", "CompleteBitflag", "CompleteBitflagSeq", "CompleteBitmaskHeader", "CompleteBitmaskType", "CompleteBitsetHeader", "CompleteBitsetType", "CompleteCollectionElement", "CompleteCollectionHeader", "CompleteDiscriminatorMember", "CompleteElementDetail", "CompleteEnumeratedHeader", "CompleteEnumeratedLiteral", "CompleteEnumeratedLiteralSeq", "CompleteEnumeratedType", "CompleteExtendedType", "CompleteMapType", "CompleteMemberDetail", "CompleteSequenceType", "CompleteStructHeader", "CompleteStructMember", "CompleteStructMemberSeq", "CompleteStructType", "CompleteTypeDetail", "CompleteTypeObject", "CompleteUnionHeader", "CompleteUnionMember", "CompleteUnionMemberSeq", "CompleteUnionType", "EK_BOTH", "EK_COMPLETE", "EK_MINIMAL", "EnumTypeFlag", "EnumeratedLiteralFlag", "EquivalenceHash", "EquivalenceKind", "ExtendedAnnotationParameterValue", "ExtendedTypeDefn", "INVALID_LBOUND", "INVALID_SBOUND", "LBound", "LBoundSeq", "MEMBER_NAME_MAX_LENGTH", "MemberFlag", "MemberFlagMinimalMask", "MemberId", "MemberName", "MinimalAliasBody", "MinimalAliasHeader", "MinimalAliasType", "MinimalAnnotationHeader", "MinimalAnnotationParameter", "MinimalAnnotationParameterSeq", "MinimalAnnotationType", "MinimalArrayHeader", "MinimalArrayType", "MinimalBitfield", "MinimalBitfieldSeq", "MinimalBitflag", "MinimalBitflagSeq", "MinimalBitmaskHeader", "MinimalBitmaskType", "MinimalBitsetHeader", "MinimalBitsetType", "MinimalCollectionElement", "MinimalCollectionHeader", "MinimalDiscriminatorMember", "MinimalEnumeratedHeader", "MinimalEnumeratedLiteral", "MinimalEnumeratedLiteralSeq", "MinimalEnumeratedType", "MinimalExtendedType", "MinimalMapType", "MinimalMemberDetail", "MinimalSequenceType", "MinimalStructHeader", "MinimalStructMember", "MinimalStructMemberSeq", "MinimalStructType", "MinimalTypeDetail", "MinimalTypeObject", "MinimalUnionHeader", "MinimalUnionMember", "MinimalUnionMemberSeq", "MinimalUnionType", "NameHash", "PlainArrayLElemDefn", "PlainArraySElemDefn", "PlainCollectionHeader", "PlainMapLTypeDefn", "PlainMapSTypeDefn", "PlainSequenceLElemDefn", "PlainSequenceSElemDefn", "PrimitiveTypeId", "QualifiedTypeName", "SBound", "SBoundSeq", "StringLTypeDefn", "StringSTypeDefn", "StronglyConnectedComponent", "StronglyConnectedComponentId", "StructMemberFlag", "StructTypeFlag", "TI_PLAIN_ARRAY_LARGE", "TI_PLAIN_ARRAY_SMALL", "TI_PLAIN_MAP_LARGE", "TI_PLAIN_MAP_SMALL", "TI_PLAIN_SEQUENCE_LARGE", "TI_PLAIN_SEQUENCE_SMALL", "TI_STRING16_LARGE", "TI_STRING16_SMALL", "TI_STRING8_LARGE", "TI_STRING8_SMALL", "TI_STRONGLY_CONNECTED_COMPONENT", "TK_ALIAS", "TK_ANNOTATION", "TK_ARRAY", "TK_BITMASK", "TK_BITSET", "TK_BOOLEAN", "TK_BYTE", "TK_CHAR16", "TK_CHAR8", "TK_ENUM", "TK_FLOAT128", "TK_FLOAT32", "TK_FLOAT64", "TK_INT8", "TK_INT16", "TK_INT32", "TK_INT64", "TK_MAP", "TK_NONE", "TK_SEQUENCE", "TK_STRING16", "TK_STRING8", "TK_STRUCTURE", "TK_UINT8", "TK_UINT16", "TK_UINT32", "TK_UINT64", "TK_UNION", "TYPE_NAME_MAX_LENGTH", "TypeFlag", "TypeFlagMinimalMask", "TypeIdentfierWithSizeSeq", "TypeIdentiferKind", "TypeIdentifier", "TypeIdentifierPair", "TypeIdentifierPairSeq", "TypeIdentifierSeq", "TypeIdentifierTypeObjectPair", "TypeIdentifierTypeObjectPairSeq", "TypeIdentifierWithDependencies", "TypeIdentifierWithDependenciesSeq", "TypeIdentifierWithSize", "TypeInformation", "TypeInformationSeq", "TypeKind", "TypeObject", "TypeObjectHashId", "TypeObjectSeq", "UnionCaseLabelSeq", "UnionDiscriminatorFlag", "UnionMemberFlag", "UnionTypeFlag", "TypeMapping", ] diff --git a/cyclonedds/idl/_typesupport/DDS/XTypes/_ddsi_xt_type_object.py b/cyclonedds/idl/_typesupport/DDS/XTypes/_ddsi_xt_type_object.py index d7780bc1..9af17dfe 100644 --- a/cyclonedds/idl/_typesupport/DDS/XTypes/_ddsi_xt_type_object.py +++ b/cyclonedds/idl/_typesupport/DDS/XTypes/_ddsi_xt_type_object.py @@ -34,6 +34,8 @@ TK_FLOAT32 = 9 TK_FLOAT64 = 10 TK_FLOAT128 = 11 +TK_INT8 = 12 +TK_UINT8 = 13 TK_CHAR8 = 16 TK_CHAR16 = 17 TK_STRING8 = 32 @@ -283,6 +285,8 @@ class ExtendedAnnotationParameterValue(idl.IdlStruct, typename="DDS.XTypes.Exten class AnnotationParameterValue(idl.IdlUnion, discriminator=types.uint8, discriminator_is_key=False, typename="DDS.XTypes.AnnotationParameterValue"): boolean_value: types.case[[1], bool] byte_value: types.case[[2], types.uint8] + int8_value: types.case[[12], types.int8] + uint_8_value: types.case[[13], types.uint8] int16_value: types.case[[3], types.int16] uint_16_value: types.case[[6], types.uint16] int32_value: types.case[[4], types.int32] diff --git a/cyclonedds/idl/_typesupport/ddsi_xt_type_object.idl b/cyclonedds/idl/_typesupport/ddsi_xt_type_object.idl index 8ee22e56..56bcc1b1 100644 --- a/cyclonedds/idl/_typesupport/ddsi_xt_type_object.idl +++ b/cyclonedds/idl/_typesupport/ddsi_xt_type_object.idl @@ -2,7 +2,7 @@ // The types in this file shall be serialized with XCDR encoding version 2 module DDS { module XTypes { - + // ---------- Equivalence Kinds ------------------- typedef octet EquivalenceKind; const octet EK_MINIMAL = 0xF1; // 0x1111 0001 @@ -11,7 +11,7 @@ module DDS { module XTypes { // ---------- TypeKinds (begin) ------------------- typedef octet TypeKind; - + // Primitive TKs const octet TK_NONE = 0x00; const octet TK_BOOLEAN = 0x01; @@ -25,6 +25,8 @@ module DDS { module XTypes { const octet TK_FLOAT32 = 0x09; const octet TK_FLOAT64 = 0x0A; const octet TK_FLOAT128 = 0x0B; + const octet TK_INT8 = 0x0C; // XTypes 1.3 spec Annex B + const octet TK_UINT8 = 0x0D; // XTypes 1.3 spec Annex B const octet TK_CHAR8 = 0x10; const octet TK_CHAR16 = 0x11; @@ -44,7 +46,7 @@ module DDS { module XTypes { const octet TK_STRUCTURE = 0x51; const octet TK_UNION = 0x52; const octet TK_BITSET = 0x53; - + // Collection TKs const octet TK_SEQUENCE = 0x60; const octet TK_ARRAY = 0x61; @@ -60,10 +62,10 @@ module DDS { module XTypes { const octet TI_PLAIN_SEQUENCE_SMALL = 0x80; const octet TI_PLAIN_SEQUENCE_LARGE = 0x81; - + const octet TI_PLAIN_ARRAY_SMALL = 0x90; const octet TI_PLAIN_ARRAY_LARGE = 0x91; - + const octet TI_PLAIN_MAP_SMALL = 0xA0; const octet TI_PLAIN_MAP_LARGE = 0xA1; @@ -91,12 +93,12 @@ module DDS { module XTypes { // using UTF-8 encoding and without a 'nul' terminator. // Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF} typedef octet NameHash[4]; - + // Long Bound of a collection type typedef unsigned long LBound; typedef sequence LBoundSeq; const LBound INVALID_LBOUND = 0; - + // Short Bound of a collection type typedef octet SBound; typedef sequence SBoundSeq; @@ -108,7 +110,7 @@ module DDS { module XTypes { case EK_MINIMAL: EquivalenceHash hash; }; - + // Flags that apply to struct/union/collection/enum/bitmask/bitset // members/elements and DO affect type assignability // Depending on the flag it may not apply to members of all types @@ -119,10 +121,10 @@ module DDS { module XTypes { @position(1) TRY_CONSTRUCT2, // T2 | 10 = USE_DEFAULT, 11 = TRIM @position(2) IS_EXTERNAL, // X StructMember, UnionMember, // CollectionElement - @position(3) IS_OPTIONAL, // O StructMember + @position(3) IS_OPTIONAL, // O StructMember @position(4) IS_MUST_UNDERSTAND, // M StructMember @position(5) IS_KEY, // K StructMember, UnionDiscriminator - @position(6) IS_DEFAULT // D UnionMember, EnumerationLiteral + @position(6) IS_DEFAULT // D UnionMember, EnumerationLiteral }; //typedef unsigned short MemberFlag; @@ -138,15 +140,15 @@ module DDS { module XTypes { // Mask used to remove the flags that do no affect assignability // Selects T1, T2, O, M, K, D - const unsigned short MemberFlagMinimalMask = 0x003f; + const unsigned short MemberFlagMinimalMask = 0x003f; // Flags that apply to type declarationa and DO affect assignability // Depending on the flag it may not apply to all types // When not all, the applicable types are listed @bit_bound(16) bitmask TypeFlag { - @position(0) IS_FINAL, // F | - @position(1) IS_APPENDABLE, // A |- Struct, Union + @position(0) IS_FINAL, // F | + @position(1) IS_APPENDABLE, // A |- Struct, Union @position(2) IS_MUTABLE, // M | (exactly one flag) @position(3) IS_NESTED, // N Struct, Union @@ -185,58 +187,58 @@ module DDS { module XTypes { EquivalenceKind equiv_kind; CollectionElementFlag element_flags; }; - + @extensibility(FINAL) @nested struct PlainSequenceSElemDefn { PlainCollectionHeader header; SBound bound; - @external TypeIdentifier element_identifier; + @external TypeIdentifier element_identifier; }; @extensibility(FINAL) @nested struct PlainSequenceLElemDefn { PlainCollectionHeader header; LBound bound; - @external TypeIdentifier element_identifier; + @external TypeIdentifier element_identifier; }; @extensibility(FINAL) @nested struct PlainArraySElemDefn { PlainCollectionHeader header; SBoundSeq array_bound_seq; - @external TypeIdentifier element_identifier; + @external TypeIdentifier element_identifier; }; @extensibility(FINAL) @nested struct PlainArrayLElemDefn { PlainCollectionHeader header; LBoundSeq array_bound_seq; - @external TypeIdentifier element_identifier; + @external TypeIdentifier element_identifier; }; @extensibility(FINAL) @nested struct PlainMapSTypeDefn { PlainCollectionHeader header; SBound bound; - @external TypeIdentifier element_identifier; + @external TypeIdentifier element_identifier; CollectionElementFlag key_flags; - @external TypeIdentifier key_identifier; + @external TypeIdentifier key_identifier; }; @extensibility(FINAL) @nested struct PlainMapLTypeDefn { PlainCollectionHeader header; LBound bound; - @external TypeIdentifier element_identifier; + @external TypeIdentifier element_identifier; CollectionElementFlag key_flags; - @external TypeIdentifier key_identifier; + @external TypeIdentifier key_identifier; }; // Used for Types that have cyclic depencencies with other types @extensibility(APPENDABLE) @nested struct StronglyConnectedComponentId { TypeObjectHashId sc_component_id; // Hash StronglyConnectedComponent - long scc_length; // StronglyConnectedComponent.length + long scc_length; // StronglyConnectedComponent.length long scc_index ; // identify type in Strongly Connected Comp. }; @@ -245,13 +247,13 @@ module DDS { module XTypes { struct ExtendedTypeDefn { // Empty. Available for future extension }; - - - // The TypeIdentifier uniquely identifies a type (a set of equivalent + + + // The TypeIdentifier uniquely identifies a type (a set of equivalent // types according to an equivalence relationship: COMPLETE, MNIMAL). // - // In some cases (primitive types, strings, plain types) the identifier + // In some cases (primitive types, strings, plain types) the identifier // is a explicit description of the type. // In other cases the Identifier is a Hash of the type description // @@ -267,15 +269,15 @@ module DDS { module XTypes { // - COMMON indicates the TypeIdentifier identifies equivalent types // according to both the MINIMAL and the COMMON equivalence relation. // This means the TypeIdentifier is the same for both relationships - // + // @extensibility(FINAL) @nested - union TypeIdentifier switch (octet) { + union TypeIdentifier switch (octet) { // ============ Primitive types - use TypeKind ==================== - // All primitive types fall here. + // All primitive types fall here. // Commented-out because Unions cannot have cases with no member. /* case TK_NONE: - case TK_BOOLEAN: + case TK_BOOLEAN: case TK_BYTE_TYPE: case TK_INT16_TYPE: case TK_INT32_TYPE: @@ -285,7 +287,7 @@ module DDS { module XTypes { case TK_UINT64_TYPE: case TK_FLOAT32_TYPE: case TK_FLOAT64_TYPE: - case TK_FLOAT128_TYPE: + case TK_FLOAT128_TYPE: case TK_CHAR8_TYPE: case TK_CHAR16_TYPE: // No Value @@ -315,12 +317,12 @@ module DDS { module XTypes { PlainMapSTypeDefn map_sdefn; case TI_PLAIN_MAP_LARGE: PlainMapLTypeDefn map_ldefn; - + // ============ Types that are mutually dependent on each other === case TI_STRONGLY_CONNECTED_COMPONENT: StronglyConnectedComponentId sc_component_id; - // ============ The remaining cases - use EquivalenceKind ========= + // ============ The remaining cases - use EquivalenceKind ========= case EK_COMPLETE: case EK_MINIMAL: EquivalenceHash equivalence_hash; @@ -329,7 +331,7 @@ module DDS { module XTypes { // Future extensions /*default: ExtendedTypeDefn extended_defn;*/ - }; + }; typedef sequence TypeIdentifierSeq; @@ -344,7 +346,7 @@ module DDS { module XTypes { struct ExtendedAnnotationParameterValue { // Empty. Available for future extension }; - + /* Literal value of an annotation member: either the default value in its * definition or the value applied in its usage. */ @@ -354,6 +356,10 @@ module DDS { module XTypes { boolean boolean_value; case TK_BYTE: octet byte_value; + case TK_INT8: // XTypes 1.3 spec Annex B + int8 int8_value; + case TK_UINT8: // XTypes 1.3 spec Annex B + uint8 uint8_value; case TK_INT16: short int16_value; case TK_UINT16: @@ -375,7 +381,7 @@ module DDS { module XTypes { case TK_ENUM: long enumerated_value; case TK_STRING8: - string string8_value; + string string8_value; /*default: ExtendedAnnotationParameterValue extended_value;*/ }; @@ -383,8 +389,8 @@ module DDS { module XTypes { // The application of an annotation to some type or type member @extensibility(APPENDABLE) @nested struct AppliedAnnotationParameter { - NameHash paramname_hash; - AnnotationParameterValue value; + NameHash paramname_hash; + AnnotationParameterValue value; }; // Sorted by AppliedAnnotationParameter.paramname_hash typedef @@ -445,7 +451,7 @@ module DDS { module XTypes { }; // Ordered by the member_index typedef sequence CompleteStructMemberSeq; - + // Member of an aggregate type @extensibility(APPENDABLE) @nested struct MinimalStructMember { @@ -455,7 +461,7 @@ module DDS { module XTypes { // Ordered by common.member_id typedef sequence MinimalStructMemberSeq; - + @extensibility(APPENDABLE) @nested struct AppliedBuiltinTypeAnnotations { @optional AppliedVerbatimAnnotation verbatim; // @verbatim(...) @@ -465,11 +471,11 @@ module DDS { module XTypes { struct MinimalTypeDetail { // Empty. Available for future extension }; - + @extensibility(FINAL) @nested struct CompleteTypeDetail { - @optional AppliedBuiltinTypeAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; + @optional AppliedBuiltinTypeAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; QualifiedTypeName type_name; }; @@ -609,7 +615,7 @@ module DDS { module XTypes { struct CompleteAnnotationHeader { QualifiedTypeName annotation_name; }; - + @extensibility(APPENDABLE) @nested struct MinimalAnnotationHeader { // Empty. Available for future extension @@ -643,7 +649,7 @@ module DDS { module XTypes { @optional AppliedBuiltinMemberAnnotations ann_builtin; @optional AppliedAnnotationSeq ann_custom; }; - + @extensibility(APPENDABLE) @nested struct MinimalAliasBody { CommonAliasBody common; @@ -653,7 +659,7 @@ module DDS { module XTypes { struct CompleteAliasHeader { CompleteTypeDetail detail; }; - + @extensibility(APPENDABLE) @nested struct MinimalAliasHeader { // Empty. Available for future extension @@ -701,7 +707,7 @@ module DDS { module XTypes { struct CommonCollectionHeader { LBound bound; }; - + @extensibility(APPENDABLE) @nested struct CompleteCollectionHeader { CommonCollectionHeader common; @@ -720,7 +726,7 @@ module DDS { module XTypes { CompleteCollectionHeader header; CompleteCollectionElement element; }; - + @extensibility(FINAL) @nested struct MinimalSequenceType { CollectionTypeFlag collection_flag; @@ -733,7 +739,7 @@ module DDS { module XTypes { struct CommonArrayHeader { LBoundSeq bound_seq; }; - + @extensibility(APPENDABLE) @nested struct CompleteArrayHeader { CommonArrayHeader common; @@ -775,7 +781,7 @@ module DDS { module XTypes { MinimalCollectionElement key; MinimalCollectionElement element; }; - + // --- Enumeration: ---------------------------------------------------- typedef unsigned short BitBound; @@ -785,7 +791,7 @@ module DDS { module XTypes { long value; EnumeratedLiteralFlag flags; }; - + // Constant in an enumerated type @extensibility(APPENDABLE) @nested struct CompleteEnumeratedLiteral { @@ -819,12 +825,12 @@ module DDS { module XTypes { struct MinimalEnumeratedHeader { CommonEnumeratedHeader common; }; - + // Enumerated type @extensibility(FINAL) @nested struct CompleteEnumeratedType { EnumTypeFlag enum_flags; // unused - CompleteEnumeratedHeader header; + CompleteEnumeratedHeader header; CompleteEnumeratedLiteralSeq literal_seq; }; @@ -832,9 +838,9 @@ module DDS { module XTypes { @extensibility(FINAL) @nested struct MinimalEnumeratedType { EnumTypeFlag enum_flags; // unused - MinimalEnumeratedHeader header; + MinimalEnumeratedHeader header; MinimalEnumeratedLiteralSeq literal_seq; - }; + }; // --- Bitmask: -------------------------------------------------------- // Bit in a bit mask @@ -843,12 +849,12 @@ module DDS { module XTypes { unsigned short position; BitflagFlag flags; }; - + @extensibility(APPENDABLE) @nested struct CompleteBitflag { CommonBitflag common; CompleteMemberDetail detail; - }; + }; // Ordered by Bitflag.position typedef sequence CompleteBitflagSeq; @@ -856,7 +862,7 @@ module DDS { module XTypes { struct MinimalBitflag { CommonBitflag common; MinimalMemberDetail detail; - }; + }; // Ordered by Bitflag.position typedef sequence MinimalBitflagSeq; @@ -871,14 +877,14 @@ module DDS { module XTypes { @extensibility(APPENDABLE) @nested struct CompleteBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused + BitmaskTypeFlag bitmask_flags; // unused CompleteBitmaskHeader header; CompleteBitflagSeq flag_seq; }; @extensibility(APPENDABLE) @nested struct MinimalBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused + BitmaskTypeFlag bitmask_flags; // unused MinimalBitmaskHeader header; MinimalBitflagSeq flag_seq; }; @@ -889,14 +895,14 @@ module DDS { module XTypes { unsigned short position; BitsetMemberFlag flags; octet bitcount; - TypeKind holder_type; // Must be primitive integer type + TypeKind holder_type; // Must be primitive integer type }; - + @extensibility(APPENDABLE) @nested struct CompleteBitfield { CommonBitfield common; CompleteMemberDetail detail; - }; + }; // Ordered by Bitfield.position typedef sequence CompleteBitfieldSeq; @@ -904,7 +910,7 @@ module DDS { module XTypes { struct MinimalBitfield { CommonBitfield common; NameHash name_hash; - }; + }; // Ordered by Bitfield.position typedef sequence MinimalBitfieldSeq; @@ -920,18 +926,18 @@ module DDS { module XTypes { @extensibility(APPENDABLE) @nested struct CompleteBitsetType { - BitsetTypeFlag bitset_flags; // unused + BitsetTypeFlag bitset_flags; // unused CompleteBitsetHeader header; CompleteBitfieldSeq field_seq; }; @extensibility(APPENDABLE) @nested struct MinimalBitsetType { - BitsetTypeFlag bitset_flags; // unused - MinimalBitsetHeader header; + BitsetTypeFlag bitset_flags; // unused + MinimalBitsetHeader header; MinimalBitfieldSeq field_seq; }; - + // --- Type Object: --------------------------------------------------- // The types associated with each case selection must have extensibility // kind APPENDABLE or MUTABLE so that they can be extended in the future @@ -963,7 +969,7 @@ module DDS { module XTypes { CompleteEnumeratedType enumerated_type; case TK_BITMASK: CompleteBitmaskType bitmask_type; - + // =================== Future extensibility ============ /*default: CompleteExtendedType extended_type; */ @@ -997,7 +1003,7 @@ module DDS { module XTypes { MinimalEnumeratedType enumerated_type; case TK_BITMASK: MinimalBitmaskType bitmask_type; - + // =================== Future extensibility ============ /*default: MinimalExtendedType extended_type; */ @@ -1015,7 +1021,7 @@ module DDS { module XTypes { // Set of TypeObjects representing a strong component: Equivalence class // for the Strong Connectivity relationship (mutual reachability between // types). - // Ordered by fully qualified typename lexicographic order + // Ordered by fully qualified typename lexicographic order typedef TypeObjectSeq StronglyConnectedComponent; @extensibility(FINAL) @nested diff --git a/cyclonedds/idl/_xt_builder.py b/cyclonedds/idl/_xt_builder.py index f4243ed4..67651306 100644 --- a/cyclonedds/idl/_xt_builder.py +++ b/cyclonedds/idl/_xt_builder.py @@ -667,11 +667,12 @@ def _xt_type_identifier(cls, name: str, entity: Any, minimal: bool) -> xt.TypeId bool: xt.TypeIdentifier(discriminator=xt.TK_BOOLEAN, value=None), float: xt.TypeIdentifier(discriminator=xt.TK_FLOAT64, value=None), int: xt.TypeIdentifier(discriminator=xt.TK_INT64, value=None), - pt.int8: xt.TypeIdentifier(discriminator=xt.TK_CHAR8, value=None), + pt.int8: xt.TypeIdentifier(discriminator=xt.TK_INT8, value=None), pt.int16: xt.TypeIdentifier(discriminator=xt.TK_INT16, value=None), pt.int32: xt.TypeIdentifier(discriminator=xt.TK_INT32, value=None), pt.int64: xt.TypeIdentifier(discriminator=xt.TK_INT64, value=None), - pt.uint8: xt.TypeIdentifier(discriminator=xt.TK_BYTE, value=None), + pt.byte: xt.TypeIdentifier(discriminator=xt.TK_BYTE, value=None), + pt.uint8: xt.TypeIdentifier(discriminator=xt.TK_UINT8, value=None), pt.uint16: xt.TypeIdentifier(discriminator=xt.TK_UINT16, value=None), pt.uint32: xt.TypeIdentifier(discriminator=xt.TK_UINT32, value=None), pt.uint64: xt.TypeIdentifier(discriminator=xt.TK_UINT64, value=None), @@ -1421,10 +1422,12 @@ def __init__(self, database): class XTInterpreter: _simple_mappings = { xt.TK_BOOLEAN: bool, - xt.TK_BYTE: pt.uint8, + xt.TK_BYTE: pt.byte, + xt.TK_INT8: pt.int8, xt.TK_INT16: pt.int16, xt.TK_INT32: pt.int32, xt.TK_INT64: pt.int64, + xt.TK_UINT8: pt.uint8, xt.TK_UINT16: pt.uint16, xt.TK_UINT32: pt.uint32, xt.TK_UINT64: pt.uint64, diff --git a/cyclonedds/idl/types.py b/cyclonedds/idl/types.py index 572f036e..50ecbd1a 100644 --- a/cyclonedds/idl/types.py +++ b/cyclonedds/idl/types.py @@ -226,6 +226,9 @@ def __hash__(self) -> int: int64 = _th.Annotated[int, "int64"] """A signed 64 bit integer.""" +byte = _th.Annotated[int, "byte"] +"""An unsigned 8 bit integer.""" + uint8 = _th.Annotated[int, "uint8"] """An unsigned 8 bit integer.""" @@ -256,6 +259,7 @@ def __hash__(self) -> int: uint16: ('H', 2, 2, 0), uint32: ('I', 4, 4, 0), uint64: ('Q', 8, 8, 0), + byte: ('B', 1, 1, 0), float32: ('f', 4, 4, 0.0), float64: ('d', 8, 8, 0.0), wchar: ('h', 2, 2, 0), diff --git a/idlpy/src/naming.c b/idlpy/src/naming.c index a4256164..af612016 100644 --- a/idlpy/src/naming.c +++ b/idlpy/src/naming.c @@ -28,12 +28,12 @@ //Reserved Python keywords support (Issue 105) static const char *python_keywords[] = { #define _py_(str) "_" str - _py_("False"), _py_("None"), _py_("True"), _py_("and"), _py_("as"), _py_("assert"), - _py_("break"), _py_("class"), _py_("continue"), _py_("def"), _py_("del"), _py_("elif"), - _py_("else"), _py_("except"), _py_("finally"), _py_("for"), _py_("from"), _py_("global"), - _py_("if"), _py_("import"), _py_("in"), _py_("is"), _py_("lambda"), _py_("nonlocal"), - _py_("not"), _py_("or"), _py_("pass"), _py_("raise"), _py_("return"), _py_("try"), - _py_("while"), _py_("with"), _py_("yield"), _py_("idl"), _py_("annotate"), _py_("types"), + _py_("False"), _py_("None"), _py_("True"), _py_("and"), _py_("as"), _py_("assert"), + _py_("break"), _py_("class"), _py_("continue"), _py_("def"), _py_("del"), _py_("elif"), + _py_("else"), _py_("except"), _py_("finally"), _py_("for"), _py_("from"), _py_("global"), + _py_("if"), _py_("import"), _py_("in"), _py_("is"), _py_("lambda"), _py_("nonlocal"), + _py_("not"), _py_("or"), _py_("pass"), _py_("raise"), _py_("return"), _py_("try"), + _py_("while"), _py_("with"), _py_("yield"), _py_("idl"), _py_("annotate"), _py_("types"), _py_("auto"), _py_("TYPE_CHECKING"), _py_("Optional") #undef _py_ }; @@ -78,6 +78,7 @@ static char *typename_of_type(idlpy_ctx ctx, idl_type_t type) case IDL_INT8: return idl_strdup("types.int8"); case IDL_OCTET: + return idl_strdup("types.byte"); case IDL_UINT8: return idl_strdup("types.uint8"); case IDL_SHORT: @@ -249,7 +250,7 @@ char *absolute_name(idlpy_ctx ctx, const void *node) continue; if ((idl_mask(root) & IDL_ENUM) == IDL_ENUM && root != node) continue; - + //Reserved Python keywords support (Issue 105) ident = idlpy_identifier(root); ///////////////////// @@ -258,7 +259,7 @@ char *absolute_name(idlpy_ctx ctx, const void *node) len += strlen(sep) + strlen(ident); if (root != ((idl_node_t*) node)) parnamelen += strlen(sep) + strlen(ident); - + sep = separator; } @@ -324,7 +325,7 @@ char *idl_full_typename(const void *node) ident = idlpy_identifier(root); ///////////////////// assert(ident); - + len += strlen(sep) + strlen(ident); sep = separator; } @@ -345,7 +346,7 @@ char *idl_full_typename(const void *node) ident = idlpy_identifier(root); //////////////////////////////// assert(ident); - + cnt = strlen(ident); assert(cnt <= len); len -= cnt; @@ -357,7 +358,7 @@ char *idl_full_typename(const void *node) len -= cnt; memmove(str + len, sep, cnt); } - + assert(len == 0); return str; } diff --git a/tests/support_modules/fuzz_tools/rand_idl/value.py b/tests/support_modules/fuzz_tools/rand_idl/value.py index 3445c294..fe36658e 100644 --- a/tests/support_modules/fuzz_tools/rand_idl/value.py +++ b/tests/support_modules/fuzz_tools/rand_idl/value.py @@ -5,7 +5,7 @@ from struct import pack, unpack from cyclonedds.idl import IdlStruct, IdlUnion, IdlBitmask, IdlEnum -from cyclonedds.idl.types import int8, int16, int32, int64, uint8, uint16, uint32, uint64, char, \ +from cyclonedds.idl.types import int8, int16, int32, int64, uint8, uint16, uint32, uint64, char, byte, \ float32, float64, sequence, array, bounded_str, typedef from cyclonedds.idl._type_normalize import get_extended_type_hints, WrapOpt @@ -16,7 +16,7 @@ def _random_for_primitive_type(random: Random, _type): return random.choice([True, False]) if _type == int8: return random.randint(-128, 127) - if _type == uint8: + if _type in [uint8, byte]: return random.randint(0, 255) if _type == int16: return random.randint(-32_768, 32_767)