fixed<P,S> decimal on the wire
IDL's exact decimal type, carried across ZeroDDS bindings in the CORBA/GIOP §9.3.2.7 packed-BCD form.
- Example:
idl-fixed-decimal - Repository: zero-dds-snippets
What it shows
- A
fixed<P,S>value is(P+2)/2octets of BCD: thePdigit nibbles most-significant first, then a sign nibble (0xCpositive,0xDnegative), with a leading0x0pad whenP+1is odd. The byte count is static, so there is no length prefix and the octets read the same in either byte order. 123.45asfixed<5,2>is12 34 5c;1234asfixed<4,0>is01 23 4c;-1.50asfixed<6,2>is00 00 15 0d.- The codec is byte-validated against JacORB 3.9 and omniORB 4.3 — these are not bytes ZeroDDS invented.
fixedis a CORBA type absent from DDS-XTypes 1.3: there is noTK_FIXED, so the member has noTypeIdentifier/TypeObject. CycloneDDSidlcreports a syntax error on it andfastddsgenraises a NullPointerException.
The wire
# Order{ id=7, qty=1234 } — @appendable, XCDR2-LE
07 00 00 00 DHEADER = 7 (body length)
07 00 00 00 id = 7
01 23 4c qty = 1234 (BCD)
# Price{ sku=7, amount=123.45 } — @final, no DHEADER
07 00 00 00 12 34 5c
See also
fixed<P,S>-Dezimal auf der Leitung
Der exakte Dezimaltyp der IDL, über die ZeroDDS-Bindings hinweg in der Packed-BCD-Form nach CORBA/GIOP §9.3.2.7 getragen.
- Beispiel:
idl-fixed-decimal - Repository: zero-dds-snippets
Was es zeigt
- Ein
fixed<P,S>-Wert sind(P+2)/2Oktette BCD: diePZiffern-Nibbles höchstwertig zuerst, dann ein Vorzeichen-Nibble (0xCpositiv,0xDnegativ), mit führendem0x0-Pad, wennP+1ungerade ist. Die Byte-Zahl ist statisch, also gibt es kein Längenpräfix, und die Oktette lesen sich in beiden Byte-Reihenfolgen gleich. 123.45alsfixed<5,2>ist12 34 5c;1234alsfixed<4,0>ist01 23 4c;-1.50alsfixed<6,2>ist00 00 15 0d.- Der Codec ist byte-validiert gegen JacORB 3.9 und omniORB 4.3 — das sind keine von ZeroDDS erfundenen Bytes.
fixedist ein CORBA-Typ und fehlt in DDS-XTypes 1.3: Es gibt keinTK_FIXED, also hat der Member keinenTypeIdentifier/TypeObject. CycloneDDSidlcmeldet darauf einen Syntaxfehler,fastddsgeneine NullPointerException.
Die Leitung
# Order{ id=7, qty=1234 } — @appendable, XCDR2-LE
07 00 00 00 DHEADER = 7 (Body-Länge)
07 00 00 00 id = 7
01 23 4c qty = 1234 (BCD)
# Price{ sku=7, amount=123.45 } — @final, kein DHEADER
07 00 00 00 12 34 5c