Expand description
The DDS-PSM-Cxx 1.0 §8.1 mapping of topic types, as a layer over the native one.
CppMapping::Psm keeps the wire codec, the
TypeObject and the endpoint gates where they are and gives the application the types
the PSM names:
| IDL | native (zd_native::…) | PSM (the IDL’s own namespaces) |
|---|---|---|
struct | struct with public fields | class: private state, accessors of §7.4.6, all-members constructor, swap (§7.12) |
wchar | std::uint16_t | wchar_t |
wstring | std::string (UTF-8) | std::wstring |
long double | zerodds::wire::Float128 | long double |
T a[2][3] | std::array<std::array<T, 3>, 2> | dds::core::array<dds::core::array<T, 3>, 2> |
map<K,V> | std::vector<std::pair<K, V>> | std::map<K, V> |
@optional T m | T *, NULL when absent | dds::core::optional<T> |
@external T m | std::shared_ptr<T> | dds::core::external<T> (XTypes 1.3 §7.5.1.2.3.3) |
union | _d and one field per case | class: _d(), one accessor per case |
enum, bitmask, bitset | the native type | a using of the native type, which already has the IDL’s name and constants (§8.1.3) |
The classes carry no codec. zerodds::psm::Conv<P> (zerodds/psm/convert.hpp) names the
native type of each PSM class and converts both ways; the topic_type_support of a PSM
class calls the native one’s encode and decode through it. So a PSM sample takes the
same bytes, the same TypeObject and the same type name as the native one, and costs one
conversion in each direction.
Not remapped, and left to the native types by name: exceptions, value types, constants.
@Optional and @Shared in the spelling of the PSM text are not recognised: IDL 4.2
§8.2 makes annotation names case-sensitive, and the wire carries @optional.
Functions§
- native_
path ::zd_native::a::b::Foo— the native type behind it.- psm_
layer - The text of the PSM layer for
ast: forward declarations, the types in dependency order, and thezerodds::psm::Convspecialisations. - psm_
path ::a::b::Foo— the C++ name of the declared typeidin the PSM namespaces.- psm_
type - The PSM spelling of the type
id(Table 7.1).