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.client.TCallback Interface Reference

Interface to a TLink callback class for use in asynchronous links. More...

Public Member Functions

void callback (int LinkIndex, int LinkStatus)
 The method which will be called when new data arrive. More...
 

Detailed Description

Interface to a TLink callback class for use in asynchronous links.

This class provides an inteface to a TCallback object whose callback method will be called which the link state of an asynchronous link has changed, either due to incoming data or non-zero status code.

Example:

public class OrbitCallback implements TCallback
{
public void callback(int id, int cc)
{
if (cc != 0)
{
System.out.println("Orbit Link Error : " + TErrorList.getErrorString(cc));
return;
}
orbitChart.update();
}
}
public int MonitorOrbit()
{
int cc = 0;
float[] xorbit = new float[141];
TDataType dout = new TDataType(xorbit);
OrbitCallback xorbCb = new OrbitCallback(); // create a callback instance ...
TLink xorb = new TLink("/HERA/HEPBPM/WL197 MX/ORBIT.X",dout,null,TAccess.CA_READ);
if ((id=xorb.attach(TMode.CM_POLL,xorbCb)) < 0) // asynchronous access ...
{
String msg = "err: " + xorb.linkStatus;
System.out.println(msg);
xorb.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine xorbCb ...
...
}

Member Function Documentation

◆ callback()

void de.desy.tine.client.TCallback.callback ( int  LinkIndex,
int  LinkStatus 
)

The method which will be called when new data arrive.

Parameters
LinkIndexis either the index returned when calling the TLink.attach(short mode,TCallback f) or TLink.attach(short mode,TCallback f,int pollrate) methods, or the index supplied when calling the TLink.attach(short mode,TCallback f,int pollrate,int notificationId) method.
LinkStatusis the current link status code. The caller should always inspect this value to determine the validity of the data.
See also
de.desy.tine.client.TLink::attach

The documentation for this interface was generated from the following file:
de.desy.tine.client.TCallback.callback
void callback(int LinkIndex, int LinkStatus)
The method which will be called when new data arrive.