pub struct Java;Expand description
The Java backend.
Trait Implementations§
Source§impl CodecTarget for Java
impl CodecTarget for Java
Source§fn scalar(kind: Scalar) -> Self::Type
fn scalar(kind: Scalar) -> Self::Type
An unsigned local goes in the next signed type up, and that is not a stylistic choice.
Java has no unsigned types. A uint8 local declared byte holds
200 as −56, and Writer.writeU8 takes an int because it means
a number in [0, 255] — a caller handing it −56 has already lost
the value, before any octet is written. So uint8 and uint16
are int and uint32 is long.
uint64 is the exception: a long holding a pattern rather
than a number, because there is no wider type.
writeU64(-1L) writes ffffffffffffffff, which is
18446744073709551615.
The same decision adapter/java.rs makes for a member’s type and
runtime/java/Writer.java for its parameters. Three places have
to agree, and they are named here because a fourth reading is the
one that would quietly disagree.
Source§fn handle(kind: Handle) -> Self::Type
fn handle(kind: Handle) -> Self::Type
runtime/java publishes each handle as a public static final
class nested in Writer, so the name a generated file writes is
qualified. Unqualified would compile only where the file happened
to import the nested class by name.
Source§fn code_point(value: Self::Expr, _narrow: bool) -> Self::Expr
fn code_point(value: Self::Expr, _narrow: bool) -> Self::Expr
A Java char is already one code unit and widens to the int
the runtime takes. The narrowing a char needs is the runtime’s,
which keeps the low byte — the same octet C reaches by
truncating one step earlier.
No cast: every holder a code point lives in here — char,
byte, short — widens to the runtime’s int parameter
implicitly (JLS 5.1.2), and the explicit (int) this used to
write is the one thing -Xlint:cast -Werror rejects on a javac
that flags redundant casts — 68 tao/rti cells stopped compiling
on the Linux test host the day its JDK started to.
Source§fn unsigned_less(octets: u8, left: Self::Expr, right: Self::Expr) -> Self::Expr
fn unsigned_less(octets: u8, left: Self::Expr, right: Self::Expr) -> Self::Expr
Long.compareUnsigned for the eight-octet width, whose value
lives in a long as its bit pattern and whose own < is
signed. The narrower widths live zero-extended in a wider
signed type, where the inherited < is already the unsigned
order.
Source§fn bool_less(left: Self::Expr, right: Self::Expr) -> Self::Expr
fn bool_less(left: Self::Expr, right: Self::Expr) -> Self::Expr
false before true, spelled as the conjunction — Java’s <
does not take two booleans. In the house style of unary’s !:
the left key is out as == false.
Source§fn bit_pattern(source: BitPatternSource, value: Self::Expr) -> Self::Expr
fn bit_pattern(source: BitPatternSource, value: Self::Expr) -> Self::Expr
Four statics on the runtime’s writer, because none of the forms
has a Java expression: a long cast of a negative int
sign-extends where the pattern needs a mask, a boolean has no
conversion to an integer at all, and a float’s bits are
Float.floatToRawIntBits’s to read. The walk hands the integer
form a long already — its Int64 cast — so bitPatternInt
only masks.
Source§fn constant(which: Constant) -> Self::Expr
fn constant(which: Constant) -> Self::Expr
runtime/java publishes these as enum constants, one type per
policy, so each name carries its own.
Source§fn unsigned_holder(bits: u16) -> Self::Type
fn unsigned_holder(bits: u16) -> Self::Type
The materialiser’s answer, not a second reading of it.
adapter/java.rs::unsigned_holder decides what a @bit_bound
set’s field is declared as, and a codec that assembled the value
in a different width would either narrow it or need a cast the
generated source does not have.
Source§fn runtime_static(method: &str, args: Vec<Self::Expr>) -> Self::Expr
fn runtime_static(method: &str, args: Vec<Self::Expr>) -> Self::Expr
Java has no free functions; the runtime class’s own static method stands in.
Which class is not a guess: C exports one namespace and Java has
two, so the operation says which side of the wire it belongs to.
A name this table does not know is written on Reader and
javac names it — a compile error that stops the probe, rather
than a call that goes to the wrong class and cannot.
Source§fn call(callee: &str, args: Vec<Self::Expr>) -> Self::Expr
fn call(callee: &str, args: Vec<Self::Expr>) -> Self::Expr
A free function is a static method on the generated class, so
an unqualified call reaches it from another method of the same
class without naming the class.
strcmp is the walk’s name for a three-way code-unit
comparison; here it is a.compareTo(b), which compares UTF-16
code units. For the corpus’s keys — all inside the BMP — that
is the same order as UTF-8 octets; a supplementary code point
mixed with U+E000..U+FFFF would part the two, and no corpus
case declares such a key.
Source§fn runtime(receiver: &str, method: &str, args: Vec<Self::Expr>) -> Self::Expr
fn runtime(receiver: &str, method: &str, args: Vec<Self::Expr>) -> Self::Expr
A fixed<P,S> is a java.math.BigDecimal (CORBA 3.3 part 3 §1.5.6) and the runtime
writes and reads its decimal text: the value goes in as toPlainString() and comes
back through new BigDecimal(text).
Source§fn carries_hdds_axes() -> bool
fn carries_hdds_axes() -> bool
runtime/java carries the three HDDS axes: beginPackedElement
and finishPackedElement on the writer and the reader, the
DHEADER pair for a sequence element’s own length, and
writeWstringUtf8Octets / readWstringUtf8Octets.
Source§fn member(base: &str, field: &str) -> Self::Expr
fn member(base: &str, field: &str) -> Self::Expr
v.x, or under JavaMapping::Psm v.getX(), which
crate::adapter::java::assign turns into v.setX(value) where
the walk writes the member.
Source§fn wide_int(value: i128) -> Self::Expr
fn wide_int(value: i128) -> Self::Expr
L on anything that will not fit an int, and the pattern on
anything that will not fit a long.
A case 16045690984833335998: over an unsigned long long is
past Long.MAX_VALUE and Java has no wider integer, so the label
is written as the signed decimal with the same sixty-four bits —
which is how adapter/java.rs holds the value it is compared
against and how Writer.writeU64 takes it. Anything else does
not compile, which is the better failure but still a failure.
Source§fn unsigned_int(value: i128) -> Self::Expr
fn unsigned_int(value: i128) -> Self::Expr
A count, with no suffix: Java has no unsigned literal, and 5u
is not a token it has at all.
Wide enough to hold itself, through CodecTarget::wide_int: a
sequence<long, 3000000000> bound is past int and the L is
what keeps the comparison against a long count honest.
Source§fn wide_unsigned(value: u64) -> Self::Expr
fn wide_unsigned(value: u64) -> Self::Expr
A 64-bit pattern in a long, which is where Java keeps one.
writeU64(-1L) writes ffffffffffffffff; the same reading in
reverse is what a mask above Long.MAX_VALUE is here.
Source§fn wide_signed(value: i128) -> Self::Expr
fn wide_signed(value: i128) -> Self::Expr
A signed 64-bit constant. Always suffixed: an enumerator’s
pattern is compared against a long and an int literal there
would be widened after the comparison’s type was chosen.
Source§fn count_of(base: &str, fixed: Option<u64>) -> Self::Expr
fn count_of(base: &str, fixed: Option<u64>) -> Self::Expr
.length, or the bound itself where the materialiser fixed one.
Both a sequence<T> and an IDL array are a Java T[] here —
adapter/java.rs says so, and docs/language-limits.md gives
the reason a map is an array of a generated pair rather than a
java.util.Map. So the length is a field and never .size();
a backend that asked a list for its size would generate source
against a type the materialiser does not emit.
Source§fn unary(op: &'static str, value: Self::Expr) -> Self::Expr
fn unary(op: &'static str, value: Self::Expr) -> Self::Expr
Java has no Unary node, and the three operators the walk uses
— !, ~ and - — are written as a binary against the
identity that leaves them alone.
~x is -1L ^ x and not 0 - x: the complement is what a
bitmask’s undeclared-bit mask is built with, and it is taken in
sixty-four bits because that is the width the mask has.
Source§fn paren(value: Self::Expr) -> Self::Expr
fn paren(value: Self::Expr) -> Self::Expr
A bracket, written because the walk asked for one.
The renderer adds none of its own, and Java’s precedence is not
C’s where it matters most here: & binds looser than !=, so
bits & mask != 0 is a type error rather than the comparison
the walk built, and looser than ^, where it is a different
number with nothing to say so.
Source§fn cast(type_: Self::Type, value: Self::Expr) -> Self::Expr
fn cast(type_: Self::Type, value: Self::Expr) -> Self::Expr
A widening to long is written by the walk and not needed here.
C casts a bit set’s accumulator to uint64_t because its holder
may be narrower; Java widens an integer to long on its own, and
the cast is a [cast] warning — which -Werror turns into a
probe that does not compile. Every cast the walk asks for with
long as its target has an integer source, so dropping it is
safe; a narrowing to int is not, and is kept.
Source§fn handoff(value: Self::Expr, _form: Handoff) -> Self::Expr
fn handoff(value: Self::Expr, _form: Handoff) -> Self::Expr
Nothing to take an address of and no array to decay: both forms hand the value.
Source§fn perform(value: Self::Expr) -> Self::Stmt
fn perform(value: Self::Expr) -> Self::Stmt
An expression statement; an assignment to a member or to an
element of a sequence goes through assign.
Source§fn give_back(value: Option<Self::Expr>) -> Self::Stmt
fn give_back(value: Option<Self::Expr>) -> Self::Stmt
return v; where the walk asked for a bare return.
Only the reader leaves a routine early — the encoder emits no
return at all — and a Java decoder answers with the sample it
has built rather than writing through a parameter it cannot
have. See CodecTarget::read_call for why. A bare return;
here would leave the caller with whatever it had before, which
is the silent-wrong-value shape.
If the encoder ever does emit one, javac refuses return v;
in a void method and names the file — loud, and at build time.
Source§fn mark_used(_name: &str) -> Vec<Self::Stmt>
fn mark_used(_name: &str) -> Vec<Self::Stmt>
Nothing. javac has no unread-parameter warning, and zd_tc;
is not a Java statement.
Source§fn drop_value(value: Self::Expr) -> Self::Stmt
fn drop_value(value: Self::Expr) -> Self::Stmt
The call on its own. A method call is already a Java statement,
and (void) expr; is not one at all.
Source§fn read_call(
callee: &str,
place: Self::Expr,
_form: Handoff,
behaviour: Self::Expr,
) -> Self::Stmt
fn read_call( callee: &str, place: Self::Expr, _form: Handoff, behaviour: Self::Expr, ) -> Self::Stmt
place = zd_dec_T(r, behaviour);
Java has no address to pass and no out-parameter to pass one in,
so a decoder answers with its value. CodecTarget::routine
and CodecTarget::give_back are the other two halves of that
decision.
Source§fn read_forward(callee: &str) -> Self::Stmt
fn read_forward(callee: &str) -> Self::Stmt
v = zd_dec_T(r, zd_tc); — a typedef, handed straight on.
Source§fn keep_first(base: &str, count: Self::Expr) -> Vec<Self::Stmt>
fn keep_first(base: &str, count: Self::Expr) -> Vec<Self::Stmt>
A shorter array, because a Java array is its own length.
C leaves the elements past the bound in the buffer and moves the count; there is no count here to move.
Source§fn count_up(counter: &str, bound: Self::Expr, body: Self::Block) -> Self::Stmt
fn count_up(counter: &str, bound: Self::Expr, body: Self::Block) -> Self::Stmt
for (int i = 0; i < bound; i = i + 1).
The step is written out rather than i++ for the same reason C’s
is: the tree has no increment node, and one spelling in both
backends keeps the two columns’ generated source comparable by
eye when their octets disagree.
Source§fn make_room(
base: &str,
element: Self::Type,
count: Self::Expr,
assigned_whole: bool,
fill: Vec<Self::Stmt>,
) -> Vec<Self::Stmt>
fn make_room( base: &str, element: Self::Type, count: Self::Expr, assigned_whole: bool, fill: Vec<Self::Stmt>, ) -> Vec<Self::Stmt>
The array, sized — and its slots given something to be where the fill writes into them rather than assigning them.
new T[n] throws rather than returning null when it cannot be
served, so there is no guard and the fill follows
unconditionally. An array and not a list, because that is what
the materialiser declares the member as; a new ArrayList<>(n)
here would compile against nothing.
new T[n] of a class type is n nulls. A sequence’s element
decoder answers with a value and the slot is assigned outright,
so nothing is needed; a map’s two halves are written into the
entry at v[i], and an entry that was never made is a null
dereference at the first key. That is what assigned_whole
separates — not a guess from the element’s type, which cannot
tell the two apart.
Source§fn store(place: Self::Expr, type_: Self::Type, value: Self::Expr) -> Self::Stmt
fn store(place: Self::Expr, type_: Self::Type, value: Self::Expr) -> Self::Stmt
The cast the three narrow holders need, and no other.
readI8 answers an int, because a number in [-128, 127] is an
int once Java has widened it, and a byte field does not take
one without being told to. The same for short and for the
char an IDL char and wchar both map to. Everything else is
already the field’s type, and a cast there is what
-Xlint:cast -Werror fails the build over.
One narrowing and not two: where the walk has already asked for
a width — the element form of a wchar under TAO’s framing —
that cast is folded into this one rather than written inside it.
Source§fn storage(type_: Self::Type, name: &str) -> Self::Stmt
fn storage(type_: Self::Type, name: &str) -> Self::Stmt
<T> name = new <T>(); — a Java local of a class type is a
reference to nothing until one is made.
Source§fn header_field(value: Self::Expr, field: &str) -> Self::Expr
fn header_field(value: Self::Expr, field: &str) -> Self::Expr
runtime/java publishes a header’s parts behind accessors, so
the field the walk names is a call here.
A match and not a re-casing of the name: end is isEnd()
and extent is computed from the length code, so a rule that
only camel-cased would name two methods that are not there.
Source§fn present(base: &str, field: &str) -> Self::Expr
fn present(base: &str, field: &str) -> Self::Expr
Absence is the value, so presence is a comparison and not a second field.
Source§fn set_present(base: &str, field: &str, present: bool) -> Vec<Self::Stmt>
fn set_present(base: &str, field: &str, present: bool) -> Vec<Self::Stmt>
Nothing on the way in — assigning the member is what makes it
present — and null on the way out.
Source§fn case_member(base: &str, field: &str) -> Self::Expr
fn case_member(base: &str, field: &str) -> Self::Expr
One field per case, directly on the class.
Source§fn sequence_element(
base: &str,
index: Self::Expr,
_element: Self::Type,
) -> (Vec<Self::Stmt>, Self::Expr, Vec<Self::Stmt>)
fn sequence_element( base: &str, index: Self::Expr, _element: Self::Type, ) -> (Vec<Self::Stmt>, Self::Expr, Vec<Self::Stmt>)
v[i], and nothing around it: adapter/java.rs gives a sequence
an array, whose elements are real slots at every element type.
Source§fn optional_destination(
base: &str,
field: &str,
) -> (Vec<Self::Stmt>, Self::Expr)
fn optional_destination( base: &str, field: &str, ) -> (Vec<Self::Stmt>, Self::Expr)
The boxed field itself. Assigning to it is what makes the member present, so there is nothing to do first.
Source§fn materialised(value: Self::Expr) -> Option<Self::Expr>
fn materialised(value: Self::Expr) -> Option<Self::Expr>
null, because a String reference can be one.
Source§fn routine(spec: Routine<Self>) -> Option<Self::Decl>
fn routine(spec: Routine<Self>) -> Option<Self::Decl>
private static void encodeT(Writer w, T v).
A prototype gets None: a Java method may call one declared
below it, so there is nothing to declare ahead. tolerate_unused
is dropped for the same kind of reason — javac does not warn on
an uncalled private method, so there is no warning to suppress.
Source§fn value_type(ast: &Ast, id: Id<TypeNode>) -> Self::Type
fn value_type(ast: &Ast, id: Id<TypeNode>) -> Self::Type
The materialiser’s spelling, which for an aggregate is the
nested path: ZdTypes.common.First, not common_First.
type_name is the other one and is a name — what the codec
method is called after. A codec that took common_First would
name a class the materialiser never declares; every declaration
nests inside ZdTypes, because Java allows one public top-level
type per file and one file is what a probe compiles.
Source§fn type_name(ast: &Ast, id: Id<TypeNode>) -> String
fn type_name(ast: &Ast, id: Id<TypeNode>) -> String
The Java materialiser’s name for a type.
type_tag refuses a type whose name nests past its depth cap and
this signature cannot; the walk asking for a name has already
planned the type’s layout, so a refusal here would be the second
opinion of two.
The fallback carries the arena slot, and that is the whole point
of it. type_tag’s own answer for an unresolvable type is the
bare word unknown, and two of those in one model would be two
types sharing one codec — a member written by the wrong encoder,
with nothing red anywhere. Slotted, two failures cannot collide,
and zd_enc_unresolved_type_41 is a name a reader can trace back
to the node that produced it.
Source§fn map_entry_name(ast: &Ast, id: Id<TypeNode>) -> String
fn map_entry_name(ast: &Ast, id: Id<TypeNode>) -> String
ZdTypes.ZdEntry_<key>_<value>, qualified.
The entry class is declared at the outer level and a codec that
wrote the bare name would reach a class only a file that
imported it by name would find. adapter/java.rs writes the
same path for a map member’s element type.
Source§fn module_prefix(_ast: &Ast, _id: Id<TypeNode>) -> String
fn module_prefix(_ast: &Ast, _id: Id<TypeNode>) -> String
Java has packages, so a module needs no prefix in a name.
Source§fn member_default(
ast: &Ast,
node: &MemberNode,
type_: Id<TypeNode>,
place: Self::Expr,
) -> Result<Vec<Self::Stmt>, EncodeError>
fn member_default( ast: &Ast, node: &MemberNode, type_: Id<TypeNode>, place: Self::Expr, ) -> Result<Vec<Self::Stmt>, EncodeError>
The member’s own @default, or Table 9’s value for its type.
§Errors
As crate::default_java::member_default: a @default this
column cannot spell is reported rather than quietly replaced by
Table 9’s zero.
Source§fn default_into(
ast: &Ast,
id: Id<TypeNode>,
place: Self::Expr,
) -> Result<Self::Stmt, EncodeError>
fn default_into( ast: &Ast, id: Id<TypeNode>, place: Self::Expr, ) -> Result<Self::Stmt, EncodeError>
place = zd_def_<T>(); — Table 9, through the generated
defaulter.
A method and not a literal, for the reason default_java.rs
gives: a literal cannot carry an aggregate, and two columns with
two answers to Table 9 is a divergence no test turns red.
§Errors
Never here. Whether the type has a Java default is decided where the defaulter is built, and refused there by name.
Source§fn enumerator_constant(
ast: &Ast,
id: Id<TypeNode>,
enumerator: &str,
) -> Self::Expr
fn enumerator_constant( ast: &Ast, id: Id<TypeNode>, enumerator: &str, ) -> Self::Expr
ZdTypes.<modules>.<Enum>.<LITERAL>.
The materialiser declares a class of public static final int
per enumeration and every reference is written from the outer
class down; an unqualified BLUE names nothing.
Source§fn enumerator_ordinal(
_ast: &Ast,
_id: Id<TypeNode>,
value: Self::Expr,
) -> Self::Expr
fn enumerator_ordinal( _ast: &Ast, _id: Id<TypeNode>, value: Self::Expr, ) -> Self::Expr
An enumeration is a class (CORBA 3.3 part 3 §1.5.9) and its integer is value().
Source§fn case_label(ast: &Ast, discriminator: Id<TypeNode>, value: i128) -> Self::Expr
fn case_label(ast: &Ast, discriminator: Id<TypeNode>, value: i128) -> Self::Expr
The label of a union whose discriminator is an enumeration is the instance of that
value (Color.from_int(1)); any other discriminator takes the cast integer.
Source§fn binary(op: &'static str, lhs: Self::Expr, rhs: Self::Expr) -> Self::Expr
fn binary(op: &'static str, lhs: Self::Expr, rhs: Self::Expr) -> Self::Expr
a op b, written as given.Source§fn declare(
type_: Self::Type,
name: &str,
value: Option<Self::Expr>,
) -> Self::Stmt
fn declare( type_: Self::Type, name: &str, value: Option<Self::Expr>, ) -> Self::Stmt
Source§fn when(
condition: Self::Expr,
then: Self::Block,
otherwise: Option<Self::Block>,
) -> Self::Stmt
fn when( condition: Self::Expr, then: Self::Block, otherwise: Option<Self::Block>, ) -> Self::Stmt
if (cond) { .. } else { .. }Source§fn until(condition: Self::Expr, body: Self::Block) -> Self::Stmt
fn until(condition: Self::Expr, body: Self::Block) -> Self::Stmt
Source§fn optional_value(
_ast: &Ast,
_id: Id<TypeNode>,
base: &str,
field: &str,
) -> Self::Expr
fn optional_value( _ast: &Ast, _id: Id<TypeNode>, base: &str, field: &str, ) -> Self::Expr
@optional member holds, given that it holds one. Read moreSource§fn elements(base: &str) -> Self::Expr
fn elements(base: &str) -> Self::Expr
Source§fn escape(name: &str) -> String
fn escape(name: &str) -> String
Source§fn bulk_octets_write(base: &str, count: Self::Expr) -> Option<Self::Stmt>
fn bulk_octets_write(base: &str, count: Self::Expr) -> Option<Self::Stmt>
count octet elements of base at once, in place of the
element loop of a sequence<octet> or a one-dimensional
octet[N] (and the same over uint8); None, the default, keeps
the loop. The octets are the loop’s: an octet has alignment 1 and
no byte order (XTypes 1.3 §7.4.3.4.1), so a run of them is the same
bytes however it is copied. What a target gains is the per-element
call — measured in the C++ column: sequence<octet, 8192> element
by element cost ~100 µs per roundtrip of four codec passes.Source§fn bulk_octets_read(base: &str, count: Self::Expr) -> Option<Self::Stmt>
fn bulk_octets_read(base: &str, count: Self::Expr) -> Option<Self::Stmt>
Self::bulk_octets_write: count octets into
base, which already holds room for them.Source§fn make_room_of(
_ast: &Ast,
_element_id: Id<TypeNode>,
base: &str,
element: Self::Type,
count: Self::Expr,
assigned_whole: bool,
fill: Vec<Self::Stmt>,
) -> Vec<Self::Stmt>
fn make_room_of( _ast: &Ast, _element_id: Id<TypeNode>, base: &str, element: Self::Type, count: Self::Expr, assigned_whole: bool, fill: Vec<Self::Stmt>, ) -> Vec<Self::Stmt>
CodecTarget::make_room for a sequence whose element is
element_id. A target that cannot spell a slot’s start value from
element alone overrides it: Kotlin’s Array(n) { T() } has no
constructor to call where T is a typealias of Int.Source§fn clear_union_cases(base: &str, fields: &[String]) -> Vec<Self::Stmt>
fn clear_union_cases(base: &str, fields: &[String]) -> Vec<Self::Stmt>
Source§fn open_array(base: &str, lengths: &[i128]) -> Vec<Self::Stmt>
fn open_array(base: &str, lengths: &[i128]) -> Vec<Self::Stmt>
lengths are its dimensions,
outermost first. Read moreSource§fn close_array(base: &str, lengths: &[i128]) -> Vec<Self::Stmt>
fn close_array(base: &str, lengths: &[i128]) -> Vec<Self::Stmt>
CodecTarget::open_array.Source§fn behind_indirection(
ast: &Ast,
id: Id<TypeNode>,
place: Self::Expr,
) -> Self::Expr
fn behind_indirection( ast: &Ast, id: Id<TypeNode>, place: Self::Expr, ) -> Self::Expr
Source§fn make_indirection(
ast: &Ast,
id: Id<TypeNode>,
place: Self::Expr,
) -> (Vec<Self::Stmt>, Self::Expr)
fn make_indirection( ast: &Ast, id: Id<TypeNode>, place: Self::Expr, ) -> (Vec<Self::Stmt>, Self::Expr)
CodecTarget::behind_indirection:
the same place, and what has to happen before a reader can write
through it. Read moreSource§fn holds_by_reference(
ast: &Ast,
aggregate: Id<TypeNode>,
member_type: Id<TypeNode>,
optional: bool,
external: bool,
) -> bool
fn holds_by_reference( ast: &Ast, aggregate: Id<TypeNode>, member_type: Id<TypeNode>, optional: bool, external: bool, ) -> bool
@optional or @external member of
aggregate, of type member_type, behind a reference of its own
— where the shared walk would reach it through
CodecTarget::present, CodecTarget::optional_value and
their external_ counterparts. A member this answers for goes
through CodecTarget::reference_present,
CodecTarget::reference_value,
CodecTarget::reference_destination and
CodecTarget::reference_absent instead. Read moreSource§fn reference_present(base: &str, field: &str) -> Self::Expr
fn reference_present(base: &str, field: &str) -> Self::Expr
CodecTarget::holds_by_reference answers for
is present. Reached only where that answered true.Source§fn reference_value(
ast: &Ast,
id: Id<TypeNode>,
base: &str,
field: &str,
) -> Self::Expr
fn reference_value( ast: &Ast, id: Id<TypeNode>, base: &str, field: &str, ) -> Self::Expr
Source§fn reference_destination(
ast: &Ast,
id: Id<TypeNode>,
base: &str,
field: &str,
) -> (Vec<Self::Stmt>, Self::Expr)
fn reference_destination( ast: &Ast, id: Id<TypeNode>, base: &str, field: &str, ) -> (Vec<Self::Stmt>, Self::Expr)
id is the member’s type.Source§fn reference_absent(base: &str, field: &str) -> Vec<Self::Stmt>
fn reference_absent(base: &str, field: &str) -> Vec<Self::Stmt>
Source§fn holds_a_cycle_externally() -> bool
fn holds_a_cycle_externally() -> bool
@external one — through the external_ seams
below, whether or not the member carries the annotation. Read moreSource§fn externals_are_pointers() -> bool
fn externals_are_pointers() -> bool
@external member behind a pointer
of its own, where the member’s value is not a pointer already. Read moreSource§fn optionals_are_pointers() -> bool
fn optionals_are_pointers() -> bool
@optional member behind a pointer
of its own, where the member’s value is not a pointer already. Read moreSource§fn value_is_pointer(ast: &Ast, id: Id<TypeNode>) -> bool
fn value_is_pointer(ast: &Ast, id: Id<TypeNode>) -> bool
id is a pointer already, so that
an @external or @optional member of that type needs no pointer
of its own. C’s string, wstring and fixed are
const char * (XTypes 1.3 §7.5.1.2.3.1); a C++ std::string is
a value.Source§fn refuse_unset_external(present: Self::Expr) -> Vec<Self::Stmt>
fn refuse_unset_external(present: Self::Expr) -> Vec<Self::Stmt>
@external
member that is not @optional has no value at the time of the
write. Read moreSource§fn external_value(
ast: &Ast,
id: Id<TypeNode>,
base: &str,
field: &str,
optional: bool,
) -> Self::Expr
fn external_value( ast: &Ast, id: Id<TypeNode>, base: &str, field: &str, optional: bool, ) -> Self::Expr
@external member, as the member’s codec takes
it. Read moreSource§fn external_destination(
base: &str,
field: &str,
optional: bool,
) -> (Vec<Self::Stmt>, Self::Expr)
fn external_destination( base: &str, field: &str, optional: bool, ) -> (Vec<Self::Stmt>, Self::Expr)
@external member’s value, and what it
takes to have somewhere to put it. The reading counterpart of
CodecTarget::external_value, shaped like
CodecTarget::optional_destination and for the same reason: a
column whose member is an indirection has to make storage before
there is a value to write into. The default is the walk’s old
answer for both combinations.Source§fn external_present(base: &str, field: &str) -> Self::Expr
fn external_present(base: &str, field: &str) -> Self::Expr
@optional @external member is present. Read moreSource§fn external_set_present(
base: &str,
field: &str,
present: bool,
) -> Vec<Self::Stmt>
fn external_set_present( base: &str, field: &str, present: bool, ) -> Vec<Self::Stmt>
@optional @external member is present, or is not.
The counterpart of CodecTarget::set_present, split for the
reason CodecTarget::external_present gives.Source§fn external_case_value(
ast: &Ast,
id: Id<TypeNode>,
base: &str,
field: &str,
) -> Self::Expr
fn external_case_value( ast: &Ast, id: Id<TypeNode>, base: &str, field: &str, ) -> Self::Expr
@external union branch, as the branch’s codec
takes it. The union counterpart of
CodecTarget::external_value, reached through
CodecTarget::case_member because that is the accessor a
branch has; there is no optional parameter because no union
member is @optional (DDS-XTypes 1.3 §7.2.2.4.4.4.7). The
default is the accessor itself — the columns that keep the value
inline — and a column that keeps an indirection answers with the
dereference, exactly as it does for a structure member.Source§fn external_case_destination(
base: &str,
field: &str,
) -> (Vec<Self::Stmt>, Self::Expr)
fn external_case_destination( base: &str, field: &str, ) -> (Vec<Self::Stmt>, Self::Expr)
@external union branch’s value, and
what it takes to have somewhere to put it. The union counterpart
of CodecTarget::external_destination, shaped the same way
and defaulted the same way.Source§fn published_name(name: String) -> String
fn published_name(name: String) -> String
Source§fn initialized_reader(
_spec: Routine<Self>,
_initializer: Self::Stmt,
) -> Option<Self::Decl>
fn initialized_reader( _spec: Routine<Self>, _initializer: Self::Stmt, ) -> Option<Self::Decl>
Source§fn bitmask_value(ast: &Ast, id: Id<TypeNode>, value: Self::Expr) -> Self::Expr
fn bitmask_value(ast: &Ast, id: Id<TypeNode>, value: Self::Expr) -> Self::Expr
Source§fn inherited_path(depth: usize) -> Option<String>
fn inherited_path(depth: usize) -> Option<String>
depth levels up,
for a column that binds inheritance as a first member parent
(XTypes 1.3 §7.5.1.4.1.3), ending in the separator: parent. for the
base, parent.parent. for its base. None, the default, is a column
that declares the base’s members in the derived structure.