ctf: Add a constant to get the currently selected field for variant types
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Tue, 12 Jul 2016 19:47:28 +0000 (15:47 -0400)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Fri, 22 Jul 2016 18:20:04 +0000 (14:20 -0400)
commit82e567103141ca60f78bb7250a1afb13eb55afad
treecef7350e6db9ec6d807d7ab4a889db0b938cb3c3
parent443d2429cf2e228b0a1660c7e2d4d851bfeee65d
ctf: Add a constant to get the currently selected field for variant types

Variants typically have only 1 struct fields per choice and its name is the
tag. Many possible choices may have the same fields in the struct so it should
be possible to use one lookup to check in every possible choice. This patch
adds a constant to use to get the currently selected field no matter its name.

Use case for this: network packets in LTTng traces have a network_header
variant field that contains a transport_header variant field. But the various
network_header choices have the same transport_header field. We want to be
able to query the { network_header, ANY, transport_header } field and not, as
previously { network_header, ipv4, transport_header } or { network_header,
ipv6, transport_header }.

Change-Id: I74b1e0494a43eae9a9f91dca575d5419f3907168
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/77172
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Hudson CI
ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/CtfTmfEventFieldVariantTest.java [new file with mode: 0644]
ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEventField.java
This page took 0.025732 seconds and 5 git commands to generate.