Next: bpipe_dpktf_valn, Previous: bpipe_dpktf, Up: Data Packet Field Manipulations
Retrieve the value of a data packet field's data.
#include <bpipe.h>type bpipe_dpktf_val( DpktField *dpktf, void *core_image, C type type );
DpktField *dpktf
- A data packet field handle obtained from either
bpipe_dpktf
orbpipe_dpktf_next
.void *core_image
- A pointer to memory which holds the core image of the data packet.
- C-type
type
- The
C
type of the field (i.e.,double
,IVector2
, etc.) as listed in Intrinsic Data Types.
This C
preprocessor macro will be replaced by either the value of
the data field, if it is a scalar, or the value of the field's first
element, if it is an array. core_image
should point to the
memory buffer containing the core image of the data packet from which
the field data is to be extracted. The type
argument is the
actual C
type of the data, which is used to correctly
de-reference the pointer to the data.
Each of the arguments to the macro is used only once, so complex expressions with side effects will not result in unsavory results. All arguments are assumed to be legal.
It returns the value of the data field if it is a scalar, or the value of the field's first element, if it is an array.