Namespace astutedds::xtypes
Namespace List > astutedds > xtypes
Namespaces
| Type | Name |
|---|---|
| namespace | TypeLookupSerialization Serialization for TypeLookup messages. |
| namespace | TypeLookupTopics Topic names for TypeLookup service. |
| namespace | builtin |
Classes
Public Types
| Type | Name |
|---|---|
| typedef std::array< uint8_t, 14 > | EquivalenceHash |
| typedef int64_t | RequestSequenceNumber Sequence number for request correlation. |
| enum uint8_t | TypeIdKind |
| typedef std::string | TypeIdentifierKey Type identifier key for maps (hash-based string key) |
| typedef std::vector< TypeIdentifier > | TypeIdentifierSeq Type identifier sequence for batch requests. |
| enum uint8_t | TypeKind |
| typedef std::function< void(const TypeLookupReply &)> | TypeLookupCallback Callback for receiving type lookup replies. |
| enum uint8_t | TypeLookupReplyStatus TypeLookup reply status. |
| typedef std::function< TypeLookupReply(const TypeLookupRequest &)> | TypeLookupRequestHandler Callback for handling type lookup requests (for server mode) |
| enum uint8_t | TypeLookupRequestKind TypeLookup request types. |
| typedef std::vector< int32_t > | UnionCaseLabelSeq |
Public Functions
Public Types Documentation
typedef EquivalenceHash
using astutedds::xtypes::EquivalenceHash = typedef std::array<uint8_t, 14>;
typedef RequestSequenceNumber
Sequence number for request correlation.
using astutedds::xtypes::RequestSequenceNumber = typedef int64_t;
enum TypeIdKind
enum astutedds::xtypes::TypeIdKind {
TI_STRING8_SMALL = 0x70,
TI_STRING8_LARGE = 0x71,
TI_STRING16_SMALL = 0x72,
TI_STRING16_LARGE = 0x73,
TI_PLAIN_SEQUENCE_SMALL = 0x74,
TI_PLAIN_SEQUENCE_LARGE = 0x75,
TI_PLAIN_ARRAY_SMALL = 0x76,
TI_PLAIN_ARRAY_LARGE = 0x77,
TI_PLAIN_MAP_SMALL = 0x78,
TI_PLAIN_MAP_LARGE = 0x79,
TI_STRONGLY_CONNECTED_COMPONENT = 0x7a,
EK_COMPLETE = 0x7b,
EK_MINIMAL = 0x7c
};
typedef TypeIdentifierKey
Type identifier key for maps (hash-based string key)
using astutedds::xtypes::TypeIdentifierKey = typedef std::string;
typedef TypeIdentifierSeq
Type identifier sequence for batch requests.
using astutedds::xtypes::TypeIdentifierSeq = typedef std::vector<TypeIdentifier>;
enum TypeKind
enum astutedds::xtypes::TypeKind {
TK_NONE = 0x00,
TK_BOOLEAN = 0x01,
TK_BYTE = 0x02,
TK_INT16 = 0x03,
TK_INT32 = 0x04,
TK_INT64 = 0x05,
TK_UINT16 = 0x06,
TK_UINT32 = 0x07,
TK_UINT64 = 0x08,
TK_FLOAT32 = 0x09,
TK_FLOAT64 = 0x0a,
TK_FLOAT128 = 0x0b,
TK_INT8 = 0x0c,
TK_UINT8 = 0x0d,
TK_CHAR8 = 0x10,
TK_CHAR16 = 0x11,
TK_STRING8 = 0x20,
TK_STRING16 = 0x21,
TK_ALIAS = 0x30,
TK_ENUM = 0x31,
TK_BITMASK = 0x32,
TK_ANNOTATION = 0x33,
TK_STRUCTURE = 0x34,
TK_UNION = 0x35,
TK_BITSET = 0x36,
TK_SEQUENCE = 0x40,
TK_ARRAY = 0x41,
TK_MAP = 0x42
};
typedef TypeLookupCallback
Callback for receiving type lookup replies.
using astutedds::xtypes::TypeLookupCallback = typedef std::function<void(const TypeLookupReply&)>;
enum TypeLookupReplyStatus
TypeLookup reply status.
enum astutedds::xtypes::TypeLookupReplyStatus {
OK = 0,
ERROR = 1,
UNKNOWN_TYPE = 2,
UNSUPPORTED_OPERATION = 3
};
typedef TypeLookupRequestHandler
Callback for handling type lookup requests (for server mode)
using astutedds::xtypes::TypeLookupRequestHandler = typedef std::function<TypeLookupReply(const TypeLookupRequest&)>;
enum TypeLookupRequestKind
TypeLookup request types.
enum astutedds::xtypes::TypeLookupRequestKind {
GET_TYPES = 0,
GET_TYPE_DEPENDENCIES
};
typedef UnionCaseLabelSeq
using astutedds::xtypes::UnionCaseLabelSeq = typedef std::vector<int32_t>;
Public Functions Documentation
function are_struct_members_assignable
bool astutedds::xtypes::are_struct_members_assignable (
const CommonStructMember & source,
const CommonStructMember & target
)
Check if struct members are assignable
function clone_type_identifier
TypeIdentifier astutedds::xtypes::clone_type_identifier (
const TypeIdentifier & source
)
Clone a TypeIdentifier (deep copy)
function create_array_type_identifier
TypeIdentifier astutedds::xtypes::create_array_type_identifier (
const TypeIdentifier & element_type,
const std::vector< uint32_t > & bounds
)
Create TypeIdentifier for array types
function create_complete_alias_type_object
CompleteTypeObject astutedds::xtypes::create_complete_alias_type_object (
const std::string & name,
const TypeIdentifier & related_type
)
Create a complete alias TypeObject (7.2.2.4.2)
function create_complete_bitmask_type_object
CompleteTypeObject astutedds::xtypes::create_complete_bitmask_type_object (
const std::string & name,
const std::vector< CompleteBitflag > & flags,
uint16_t bit_bound=32
)
Create a complete bitmask TypeObject (7.3.1.4.4)
function create_complete_enum_type_object
CompleteTypeObject astutedds::xtypes::create_complete_enum_type_object (
const std::string & name,
const std::vector< CompleteEnumeratedLiteral > & literals,
uint16_t bit_bound=32
)
Create a complete enum TypeObject
function create_complete_struct_type_object
CompleteTypeObject astutedds::xtypes::create_complete_struct_type_object (
const std::string & name,
const std::vector< CompleteStructMember > & members,
cdr::ExtensibilityKind extensibility=cdr::ExtensibilityKind::FINAL,
const std::optional< TypeIdentifier > & base_type=std::nullopt
)
Create a complete struct TypeObject
function create_complete_union_type_object
CompleteTypeObject astutedds::xtypes::create_complete_union_type_object (
const std::string & name,
const TypeIdentifier & discriminator_type,
const std::vector< CompleteUnionMember > & members,
cdr::ExtensibilityKind extensibility=cdr::ExtensibilityKind::FINAL,
uint16_t discriminator_flags=0
)
Create a complete union TypeObject (7.3.1.2.4)
function create_map_type_identifier
TypeIdentifier astutedds::xtypes::create_map_type_identifier (
const TypeIdentifier & key_type,
const TypeIdentifier & element_type,
uint32_t bound=0
)
Create TypeIdentifier for map types (7.3.4.5.5). bound is the maximum number of entries (0 = unbounded).
function create_minimal_alias_type_object
MinimalTypeObject astutedds::xtypes::create_minimal_alias_type_object (
const TypeIdentifier & related_type
)
Create a minimal alias TypeObject
function create_minimal_bitmask_type_object
MinimalTypeObject astutedds::xtypes::create_minimal_bitmask_type_object (
const std::vector< MinimalBitflag > & flags,
uint16_t bit_bound=32
)
Create a minimal bitmask TypeObject
function create_minimal_enum_type_object
MinimalTypeObject astutedds::xtypes::create_minimal_enum_type_object (
const std::vector< MinimalEnumeratedLiteral > & literals,
uint16_t bit_bound=32
)
Create a minimal enum TypeObject
function create_minimal_struct_type_object
MinimalTypeObject astutedds::xtypes::create_minimal_struct_type_object (
const std::vector< MinimalStructMember > & members,
cdr::ExtensibilityKind extensibility=cdr::ExtensibilityKind::FINAL,
const std::optional< TypeIdentifier > & base_type=std::nullopt
)
Create a minimal struct TypeObject
function create_minimal_union_type_object
MinimalTypeObject astutedds::xtypes::create_minimal_union_type_object (
const TypeIdentifier & discriminator_type,
const std::vector< MinimalUnionMember > & members,
cdr::ExtensibilityKind extensibility=cdr::ExtensibilityKind::FINAL,
uint16_t discriminator_flags=0
)
Create a minimal union TypeObject
function create_primitive_type_identifier
TypeIdentifier astutedds::xtypes::create_primitive_type_identifier (
TypeKind kind
)
Create TypeIdentifier for primitive types
function create_scc_type_identifier
TypeIdentifier astutedds::xtypes::create_scc_type_identifier (
const StronglyConnectedComponentId & component_id,
uint32_t scc_index
)
Create a TypeIdentifier referencing one type within a strongly-connected component (7.3.4.6.4, 7.3.4.9.3). scc_index is 1-based; use 0 to obtain the abstract SCCIdentifier for the component itself rather than a specific member type.
function create_sequence_type_identifier
TypeIdentifier astutedds::xtypes::create_sequence_type_identifier (
const TypeIdentifier & element_type,
uint32_t bound=0
)
Create TypeIdentifier for sequence types
function create_string_type_identifier
TypeIdentifier astutedds::xtypes::create_string_type_identifier (
uint32_t bound=0
)
Create TypeIdentifier for string types
function create_type_identifier_from_hash
TypeIdentifier astutedds::xtypes::create_type_identifier_from_hash (
const EquivalenceHash & hash,
bool use_minimal=true
)
Create TypeIdentifier from equivalence hash
function generate_equivalence_hash
EquivalenceHash astutedds::xtypes::generate_equivalence_hash (
const TypeObject & type_obj
)
Generate equivalence hash for a TypeObject
function is_alias_assignable
bool astutedds::xtypes::is_alias_assignable (
const CompleteAliasType & source,
const CompleteAliasType & target
)
Check if alias types are assignable (DDS-XTypes 1.3 Section 7.2.4.4.3) — delegates to related_type identity, or (opt-in via TypeConsistencyOptions) primitive widening when both aliases wrap primitive types.
function is_alias_assignable
bool astutedds::xtypes::is_alias_assignable (
const CompleteAliasType & source,
const CompleteAliasType & target,
const TypeConsistencyOptions & options
)
function is_array_assignable
bool astutedds::xtypes::is_array_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target
)
Check if array TypeIdentifiers are assignable (DDS-XTypes 1.3 Section 7.2.4.4.6, Table 17): dimensions (array_bound_seq) must be identical — per the spec's design rationale, array bounds cannot change regardless of TypeConsistencyOptions — and the element type must be (recursively) assignable.
function is_array_assignable
bool astutedds::xtypes::is_array_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target,
const TypeConsistencyOptions & options
)
function is_assignable
bool astutedds::xtypes::is_assignable (
const TypeObject & source,
const TypeObject & target
)
Main assignability check - returns true if source type can be assigned to target type, using the strict, exact-match default (no primitive widening).
function is_assignable
bool astutedds::xtypes::is_assignable (
const TypeObject & source,
const TypeObject & target,
const TypeConsistencyOptions & options
)
function is_bitmask_assignable
bool astutedds::xtypes::is_bitmask_assignable (
const CompleteBitmaskType & source,
const CompleteBitmaskType & target
)
Check if bitmask types are assignable (DDS-XTypes 1.3 Section 7.2.4.4.5 / 7.2.4.4.3)
function is_collection_type_identifier
bool astutedds::xtypes::is_collection_type_identifier (
const TypeIdentifier & ti
)
Check if TypeIdentifier represents a collection type
function is_enum_assignable
bool astutedds::xtypes::is_enum_assignable (
const CompleteEnumeratedType & source,
const CompleteEnumeratedType & target
)
Check if enum types are assignable
function is_map_assignable
bool astutedds::xtypes::is_map_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target
)
Check if map TypeIdentifiers are assignable (DDS-XTypes 1.3 Section 7.2.4.4.6, Table 17): the key type must be (recursively) assignable, the element (value) type must be (recursively) assignable, and — under the default strict options — the target's bound must be >= the source's bound (or the target unbounded).
function is_map_assignable
bool astutedds::xtypes::is_map_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target,
const TypeConsistencyOptions & options
)
function is_primitive_assignable
bool astutedds::xtypes::is_primitive_assignable (
TypeKind source,
TypeKind target
)
Check if two primitive types are assignable using the strict, exact-match default (TypeConsistencyOptions {} — no widening). Use the TypeConsistencyOptions overload to opt into integer/float widening.
function is_primitive_assignable
bool astutedds::xtypes::is_primitive_assignable (
TypeKind source,
TypeKind target,
const TypeConsistencyOptions & options
)
Check if two primitive types are assignable under the given TypeConsistencyOptions. When options.allow_type_widening is true, integer/float widening and CHAR8<->UINT8 aliasing are permitted (the historical AstuteDDS behaviour); otherwise only an exact TypeKind match is accepted.
function is_primitive_type_identifier
bool astutedds::xtypes::is_primitive_type_identifier (
const TypeIdentifier & ti
)
Check if TypeIdentifier represents a primitive type
function is_scc_type_identifier_assignable
bool astutedds::xtypes::is_scc_type_identifier_assignable (
const SCCTypeIdentifierDefn & source,
const SCCTypeIdentifierDefn & target
)
Check if two strongly-connected-component TypeIdentifiers are assignable (7.3.4.6.4, 7.3.4.9.3): they must belong to the same component (identical sc_component_id hash and scc_length), and either reference the same member (scc_index) or the target reference the whole component abstractly (scc_index == 0).
function is_sequence_assignable
bool astutedds::xtypes::is_sequence_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target
)
Check if sequence TypeIdentifiers are assignable (DDS-XTypes 1.3 Section 7.2.4.4.6, Table 17): the element type must be (recursively) assignable, and — under the default strict options — the target's bound must be >= the source's bound (or the target unbounded).
function is_sequence_assignable
bool astutedds::xtypes::is_sequence_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target,
const TypeConsistencyOptions & options
)
function is_string_assignable
bool astutedds::xtypes::is_string_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target
)
Check if string types are assignable (bound-checked: the target's bound must be >= the source's, or the target must be unbounded).
function is_string_assignable
bool astutedds::xtypes::is_string_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target,
const TypeConsistencyOptions & options
)
Check if string types are assignable under the given TypeConsistencyOptions. When options.ignore_string_bounds is true, bound compatibility is not checked (any bounded/unbounded combination is assignable as long as both sides are string types).
function is_string_type_identifier
bool astutedds::xtypes::is_string_type_identifier (
const TypeIdentifier & ti
)
Check if TypeIdentifier represents a string type
function is_struct_assignable
bool astutedds::xtypes::is_struct_assignable (
const CompleteStructType & source,
const CompleteStructType & target
)
Check if struct types are assignable
function is_type_identifier_assignable
bool astutedds::xtypes::is_type_identifier_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target
)
Generic TypeIdentifier assignability dispatcher: routes to is_primitive_assignable() / is_string_assignable() / is_sequence_assignable() / is_array_assignable() / is_map_assignable() / is_scc_type_identifier_assignable() based on the discriminator of source and target, or falls back to TypeIdentifier equality for hash-based references (structs/enums/unions/bitmasks/aliases identified by EquivalenceHash). Used internally to check element/key-type assignability for collections, and usable directly wherever two arbitrary TypeIdentifiers need to be compared for assignability.
function is_type_identifier_assignable
bool astutedds::xtypes::is_type_identifier_assignable (
const TypeIdentifier & source,
const TypeIdentifier & target,
const TypeConsistencyOptions & options
)
function is_union_assignable
bool astutedds::xtypes::is_union_assignable (
const CompleteUnionType & source,
const CompleteUnionType & target
)
Check if union types are assignable (DDS-XTypes 1.3 Section 7.2.4.4.8). Discriminator comparison uses the strict, exact-match default; pass TypeConsistencyOptions to opt into discriminator widening.
function is_union_assignable
bool astutedds::xtypes::is_union_assignable (
const CompleteUnionType & source,
const CompleteUnionType & target,
const TypeConsistencyOptions & options
)
function operator!=
bool astutedds::xtypes::operator!= (
const TypeIdentifier & lhs,
const TypeIdentifier & rhs
)
function operator==
bool astutedds::xtypes::operator== (
const TypeIdentifier & lhs,
const TypeIdentifier & rhs
)
Compare two TypeIdentifiers for equality
function serialize_type_object
std::vector< uint8_t > astutedds::xtypes::serialize_type_object (
const TypeObject & type_obj
)
Serialize a TypeObject to bytes (for hashing)
function to_minimal_bitflag
MinimalBitflag astutedds::xtypes::to_minimal_bitflag (
const CompleteBitflag & complete
)
Convert complete bitflag to minimal
function to_minimal_enum_literal
MinimalEnumeratedLiteral astutedds::xtypes::to_minimal_enum_literal (
const CompleteEnumeratedLiteral & complete
)
Convert complete enum literal to minimal
function to_minimal_struct_member
MinimalStructMember astutedds::xtypes::to_minimal_struct_member (
const CompleteStructMember & complete
)
Convert complete struct member to minimal
function to_minimal_union_member
MinimalUnionMember astutedds::xtypes::to_minimal_union_member (
const CompleteUnionMember & complete
)
Convert complete union member to minimal
function to_string
std::string astutedds::xtypes::to_string (
const TypeIdentifier & ti
)
Get string representation of TypeIdentifier
function type_id_to_key
Convert TypeIdentifier to string key for map storage.
inline TypeIdentifierKey astutedds::xtypes::type_id_to_key (
const TypeIdentifier & id
)
The documentation for this class was generated from the following file include/astutedds/xtypes/builtin_types/builtin_types.hpp