Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-.NET | API-Java | Examples | Downloads
page generated on 31.05.2023 - 04:45
Public Member Functions | List of all members
de.desy.tine.structUtils.TTaggedStructure Class Reference

Tagged Structure The transfer of 'user-defined' data structures is allowed in TINE. More...

Inheritance diagram for de.desy.tine.structUtils.TTaggedStructure:
de.desy.tine.server.TFilterStruct

Public Member Functions

 TTaggedStructure (String name)
 Creates a tagged structure with the given name. More...
 
 TTaggedStructure ()
 Creates a tagged structure using the class name as the structure tag. More...
 
String getName ()
 Returns the structure's assigned tag name. More...
 
int getSizeInBytes ()
 Returns the structure's data size in bytes. More...
 
void fixExtendedBytes ()
 scan thru the extended space and fix the reference and the total size
 
void initDone ()
 Terminates the tagged structure definition and signals that the tagged structure is ready for use. More...
 
void addField (byte[] field, String fieldName)
 
void addField (char[] field, String fieldName)
 
void addField (short[] field, String fieldName)
 
void addField (int[] field, String fieldName)
 
void addField (float[] field, String fieldName)
 
void addField (double[] field, String fieldName)
 
void addField (long[] field, String fieldName)
 
void addField (TString field, String fieldName)
 
void addField (StringBuffer field, String fieldName)
 
void addField (TCompoundDataObject field, String fieldName)
 
void addField (TCompoundDataObject[] field, String fieldName)
 
void addField (TTaggedStructure field, String fieldName)
 
void addField (TTaggedStructure[] field, String fieldName)
 

Detailed Description

Tagged Structure The transfer of 'user-defined' data structures is allowed in TINE.

In order to avoid nasty problems concerning alignment and byte swapping it is strongly suggested to extend the TTaggedStructure class when creating a data structure.

Constructor & Destructor Documentation

◆ TTaggedStructure() [1/2]

de.desy.tine.structUtils.TTaggedStructure.TTaggedStructure ( String  name)

Creates a tagged structure with the given name.

Parameters
nameis the name to be used as the structure tag. Note that only the first 16 characters of the given name will be used as the tag name!
Note
The addField() method must be called for each element of the structure data element.
Properties using tagged structures should register themselves correctly, either by passing the structure name when creating the TExportProperty() or if using a configuration file such as exports.csv or fec.xml, then by supplying the structure name there (as in FORMAT -> struct.MYTAG, where "MYTAG" is the tagged structure name).

◆ TTaggedStructure() [2/2]

de.desy.tine.structUtils.TTaggedStructure.TTaggedStructure ( )

Creates a tagged structure using the class name as the structure tag.

Note that only the first 16 characters of the class name will be used as the tag name!

Note
The addField() method must be called for each element of the structure data element.

Example:

//
// create a class which extends TTaggedStructure ...
//
class TEST1 extends TTaggedStructure
{
float[] fval = new float[3];
int[] ival = new int[2];
short[] sval1 = new short[1];
short[] sval2 = new short[1];
char[] s = new char[32];
TEST1()
{
super();
addField(fval,"fval");
addField(ival,"ival");
addField(sval1,"sval1");
addField(sval2,"sval2");
addField(s,"text");
}
}
//
// snippet ...
TEST1 t1 = new TEST1();
TDataType struct_dout = new TDataType(t1);
TDataType struct_din = new TDataType();
TLink st = new TLink("/TEST/SINE/SINEDEV_0","STRUCTTEST",struct_dout,struct_din,TAccess.CA_READ);
if (st.execute(500,true) == 0)
{
System.out.print(t1.toString());
}
else
{
System.out.print(st.getLastError());
}
st.cancel();
// ...
Note
Properties using tagged structures should register themselves correctly, either by passing the structure name when creating the TExportProperty() or if using a configuration file such as exports.csv or fec.xml, then by supplying the structure name there (as in FORMAT -> struct.MYTAG, where "MYTAG" is the tagged structure name).

Referenced by de.desy.tine.structUtils.TTaggedStructure.addField().

Member Function Documentation

◆ addField() [1/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( byte[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

Referenced by de.desy.tine.structUtils.TTaggedStructure.addField().

◆ addField() [2/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( char[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

◆ addField() [3/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( double[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

References de.desy.tine.definitions.TFormat.formatSizeOf().

◆ addField() [4/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( float[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

References de.desy.tine.definitions.TFormat.formatSizeOf().

◆ addField() [5/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( int[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

References de.desy.tine.structUtils.TTaggedStructure.addField().

◆ addField() [6/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( long[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

References de.desy.tine.definitions.TFormat.formatSizeOf().

◆ addField() [7/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( short[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

References de.desy.tine.definitions.TFormat.formatSizeOf().

◆ addField() [8/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( StringBuffer  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

◆ addField() [9/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( TCompoundDataObject  field,
String  fieldName 
)

◆ addField() [10/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( TCompoundDataObject[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

References de.desy.tine.types.TCompoundDataObject.getSizeInBytes().

◆ addField() [11/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( TString  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

◆ addField() [12/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( TTaggedStructure  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

References de.desy.tine.structUtils.TTaggedStructure.getName(), and de.desy.tine.structUtils.TTaggedStructure.TTaggedStructure().

◆ addField() [13/13]

void de.desy.tine.structUtils.TTaggedStructure.addField ( TTaggedStructure[]  field,
String  fieldName 
)
Parameters
fieldis the structure field to add to the tagged structure
fieldNameis the name of the structure field

References de.desy.tine.structUtils.TTaggedStructure.getName(), and de.desy.tine.structUtils.TTaggedStructure.TTaggedStructure().

◆ getName()

String de.desy.tine.structUtils.TTaggedStructure.getName ( )

Returns the structure's assigned tag name.

Returns
The structure's assigned tag name as a string.

Referenced by de.desy.tine.structUtils.TTaggedStructure.addField(), de.desy.tine.dataUtils.TDataType.getData(), de.desy.tine.dataUtils.TDataType.putData(), and de.desy.tine.dataUtils.TDataType.TDataType().

◆ getSizeInBytes()

int de.desy.tine.structUtils.TTaggedStructure.getSizeInBytes ( )

Returns the structure's data size in bytes.

Returns
The structure's data size in bytes.

Referenced by de.desy.tine.dataUtils.TDataType.getData(), de.desy.tine.dataUtils.TDataType.putData(), and de.desy.tine.dataUtils.TDataType.TDataType().

◆ initDone()

void de.desy.tine.structUtils.TTaggedStructure.initDone ( )

Terminates the tagged structure definition and signals that the tagged structure is ready for use.

This method plays an integral role in defining the tagged structure. It should be called following all calls to addField().


The documentation for this class was generated from the following file:
de.desy.tine.structUtils.TTaggedStructure.addField
void addField(byte[] field, String fieldName)
Definition: TTaggedStructure.java:611
de.desy.tine.structUtils.TTaggedStructure.TTaggedStructure
TTaggedStructure()
Creates a tagged structure using the class name as the structure tag.
Definition: TTaggedStructure.java:373
de.desy.tine.structUtils.TTaggedStructure.initDone
void initDone()
Terminates the tagged structure definition and signals that the tagged structure is ready for use.
Definition: TTaggedStructure.java:581