Skip to main content

Module cpp_psm

Module cpp_psm 

Source
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:

IDLnative (zd_native::…)PSM (the IDL’s own namespaces)
structstruct with public fieldsclass: private state, accessors of §7.4.6, all-members constructor, swap (§7.12)
wcharstd::uint16_twchar_t
wstringstd::string (UTF-8)std::wstring
long doublezerodds::wire::Float128long 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 mT *, NULL when absentdds::core::optional<T>
@external T mstd::shared_ptr<T>dds::core::external<T> (XTypes 1.3 §7.5.1.2.3.3)
union_d and one field per caseclass: _d(), one accessor per case
enum, bitmask, bitsetthe native typea 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 the zerodds::psm::Conv specialisations.
psm_path
::a::b::Foo — the C++ name of the declared type id in the PSM namespaces.
psm_type
The PSM spelling of the type id (Table 7.1).