This module allows the user to create instances which modify a data stream
by applying a function to each point produced or consumed by an underlying
driver. The number of transformer instances in the system is limited only
by the availability of memory;
For example, is "/scale" is a Transformer instance in the stream table
and "/adc" is a driver in
ti.sdo.io.DriverTable then the name
"/scale/adc" can be used to create a Stream instance.
const Transformer.Q_TERMINATING |
 |
Terminating quality
XDCscript usage |
meta-domain |
const Transformer.Q_TERMINATING = 1;
#define Transformer_Q_TERMINATING (Int)1
DETAILS
Implementations with this "quality" can be at the bottom of the IO
stack
typedef Transformer.DoneFxn |
 |
Typedef for callback function
typedef Void (*Transformer_DoneFxn)(UArg);
DETAILS
The IConverter instance lower in the stack will invoke this callback
whenever an I/O operation completes.
typedef Transformer.TransFunc |
 |
typedefs for transformer function
typedef Void (*Transformer_TransFunc)(Ptr,SizeT,UArg);
DETAILS
Functions of this type get passed the buffer, buffer size and a
function specific argument. The function should NOT act on the buffer
if buffer is NULL or buffer size is zero.
metaonly struct Transformer.BasicView |
 |
XDCscript usage |
meta-domain |
var obj = new Transformer.BasicView;
obj.label = String ...
obj.lowerConverter = Ptr ...
obj.mode = String ...
obj.callbackFxn = String[] ...
obj.callbackArg = UArg ...
obj.transformFxn = String[] ...
obj.transformArg = UArg ...
metaonly config Transformer.common$ // module-wide |
 |
Common module configuration parameters
XDCscript usage |
meta-domain |
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.
metaonly config Transformer.rovViewInfo // module-wide |
 |
XDCscript usage |
meta-domain |
Transformer.fix2flt( ) // module-wide |
 |
fix2flt converts each data point from fixed point to floating point
Void Transformer_fix2flt( Ptr addr, SizeT size, UArg scaleFactor );
DETAILS
This function ignores the scaleFactor.
Transformer.flt2fix( ) // module-wide |
 |
flt2fix converts each data point from floating point to fixed point
Void Transformer_flt2fix( Ptr addr, SizeT size, UArg scalePtr );
DETAILS
This function ignores the scaleFactor.
Transformer.multiply( ) // module-wide |
 |
multiply function mutiples each data point with a scale value
Void Transformer_multiply( Ptr addr, SizeT size, UArg scaleFactor );
DETAILS
This function casts the scaleFactor to a UInt before using it.
If arg is NULL a scaleFactor of 1 is used.
module-wide built-ins |
 |
// Get this module's unique id
Bool Transformer_Module_startupDone( );
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool Transformer_Module_hasMask( );
// Test whether this module has a diagnostics mask
Bits16 Transformer_Module_getMask( );
// Returns the diagnostics mask for this module
Void Transformer_Module_setMask( Bits16 mask );
// Set the diagnostics mask for this module
per-instance object types |
 |
typedef struct Transformer_Object Transformer_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct Transformer_Struct Transformer_Struct;
// Opaque client structure large enough to hold an instance object
// Convert this instance structure pointer into an instance handle
// Convert this instance handle into an instance structure pointer
per-instance config parameters |
 |
XDCscript usage |
meta-domain |
var params = new Transformer.Params;
// Instance config-params object
params.arg = UArg null;
// Arg to be used with transform functions
params.fxn = Void(*)(Ptr,SizeT,UArg) null;
// Function can be {@link #multiply}, {@link #fix2flt}
or {@link #flt2fix} or a user specific function
typedef struct Transformer_Params {
// Instance config-params structure
// Common per-instance configs
UArg arg;
// Arg to be used with transform functions
// Function can be {@link #multiply}, {@link #fix2flt}
or {@link #flt2fix} or a user specific function
} Transformer_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config Transformer.arg // per-instance |
 |
Arg to be used with transform functions
XDCscript usage |
meta-domain |
var params = new Transformer.Params;
...
params.arg = UArg null;
config Transformer.fxn // per-instance |
 |
Function can be multiply, fix2flt
or flt2fix or a user specific function
XDCscript usage |
meta-domain |
var params = new Transformer.Params;
...
params.fxn = Void(*)(Ptr,SizeT,UArg) null;
Transformer.close( ) // per-instance |
 |
Close an IConverter Instance
ARGUMENTS
handle
handle of a previously-created Transformer instance object
eb
error block
Transformer.control( ) // per-instance |
 |
Send a control command
ARGUMENTS
handle
handle of a previously-created Transformer instance object
cmd
control cmd
cmdArg
control cmd arg
eb
error block
DETAILS
The IConverter will respond to command meant for it and pass down all
others.
Transformer.issue( ) // per-instance |
 |
Issue a packet for IO
ARGUMENTS
handle
handle of a previously-created Transformer instance object
packet
IO packet
eb
Error Block
DETAILS
The IConverter might work on the buffer of data if the mode is
ti.sdo.io.DriverTypes.OUTPUT and call the issue function for the
IConverter lower in the stack. Some IConverters may be the last in
the IO stack. issue() always results in a callback.
Transformer.open( ) // per-instance |
 |
Opens the IConverter Instance
ARGUMENTS
handle
handle of a previously-created Transformer instance object
name
remaining name
mode
DriverTypes_INPUT/OUTPUT
chanParams
channel params for driver at the bottom of stack
cbFxn
callback function
cbArg
callback function arg
eb
error block
DETAILS
This is called at runtime after the IConverter instance has been
created. This function opens the IConverter instance lower in the
stack and gives its callback function and arg.
Transformer.query( ) // per-instance |
 |
Query for qualities supported
ARGUMENTS
handle
handle of a previously-created Transformer instance object
qual
quality to be tested
Transformer.reclaim( ) // per-instance |
 |
Reclaim a previously issued packet
ARGUMENTS
handle
handle of a previously-created Transformer instance object
packetp
pointer to returned packet
eb
Error Block
DETAILS
The IConverter will call the reclaim function for the
IConverter lower in the stack. It may work on the buffer of data
returned if the mode is
ti.sdo.io.DriverTypes.INPUT.
per-instance convertors |
 |
// unconditionally move one level up the inheritance hierarchy
// conditionally move one level down the inheritance hierarchy; NULL upon failure
per-instance built-ins |
 |
Int Transformer_Object_count( );
// The number of statically-created instance objects
// The handle of the i-th statically-created instance object (array == NULL)
// The handle of the first dynamically-created instance object, or NULL
// The handle of the next dynamically-created instance object, or NULL
// The heap used to allocate dynamically-created instance objects
// The label associated with this instance object
// The name of this instance object