Skip to main content

Module cpp_classic

Module cpp_classic 

Source
Expand description

The classic OMG IDL to C++ 1.3 mapping of topic types, as a layer over the native one.

CppMapping::Classic keeps the wire codec, the TypeObject and the endpoint gates where they are, as CppMapping::Psm does, and gives the application the types the classic mapping names, in C++03:

IDLnative (zd_native::…)classic (the IDL’s own namespaces)
long, unsigned long, …std::int32_t, …CORBA::Long, CORBA::ULong, …
octet, boolean, char, wcharzerodds::wire::Octet, bool, char, std::uint16_tCORBA::Octet, CORBA::Boolean, CORBA::Char, CORBA::WChar
string, wstringstd::stringCORBA::String_var, CORBA::WString_var
sequence<T>std::vector<T>zerodds::classic::Sequence<T>
T a[2][3]std::array<std::array<T, 3>, 2>T a[2][3]
map<K,V>zerodds::Map<K, V>zerodds::Map<K, V> (a string key is a std::string)
@optional T mT *, NULL when absentzerodds::classic::Optional<T>
@external T mstd::shared_ptr<T>zerodds::classic::Var<T>
structstruct, the base a public base classstruct with public members, S_var
union_d() and one accessor per caseclass: _d(), one accessor per case
enumenum classplain enum, the values written out
bitmaskan unsigned integer and constantsthe same
typedefusingtypedef

The classic declarations stand between the markers ZD-CLASSIC-BEGIN and ZD-CLASSIC-END and are C++03: they include zerodds/classic.hpp and nothing newer. The native types, the codec and zerodds::classic::Conv after them are C++17. Conv<C> (zerodds/classic/convert.hpp) names the native type of each classic type and converts both ways; the topic_type_support of a classic type calls the native one’s encode and decode through it, so a classic sample takes the same bytes, the same TypeObject and the same type name as the native one.

Not remapped, and left to the native types by name: constants, exceptions. Refused by name, because the classic mapping has no form for them: fixed, bitset, value types, any, and an array as the element of a sequence.

Constants§

BEGIN_MARKER
The marker that opens the C++03 part of a classic header.
END_MARKER
The marker that closes it.

Functions§

classic_layer
The text of the classic layer for ast: the C++03 declarations between the markers, and the zerodds::classic::Conv specialisations after them.