Class: |
DimInfo |
Library: |
DIM |
|
Author: |
C. Gaspar |
|
Version: |
v1.0 |
Update :Thu Feb 11 15:52:46
1999 |
Descrition :
To be used by DIM clients - implements DIM service
subscription and reception
DimInfo constructors subscribe to DIM services.
DimInfo Services can be requested to be updated
when the contents change and/or at regular time intervals.
The services are received at startup, when the server updates
them or after a timeout limit if the parameter "time" is specified.
This gives the following possibilities:
- Receive the service at startup and then
- Receive the service only
when the server updates it
- no "time" parameter
- Receive the service
when the server updates it, but also after a timeout (to make sure the
server is alive)
- longish "time" parameter
Note: The parameter "time" is sent to the server.
It is the server that updates the services even on the time basis
Please refer to Usage for
examples.
Constructors :
Constructors for Services updated only by the
server
-
public DimInfo ( char * name, int nolink)
; Integer (or Integer Array) Service
-
public DimInfo ( char * name, float
nolink) ; Float (or Float Array) Service
-
public DimInfo ( char * name, double
nolink) ; Double (or Double Array) Service
-
public DimInfo ( char * name, String nolink) ; Character String Service
Constructors for Services updated (also) on a time
basis
-
public DimInfo ( char * name, int time,
int nolink) ; Integer (or Integer Array) Service
-
public DimInfo ( char * name, int time,
float nolink) ; Float (or Float Array) Service
-
public DimInfo ( char * name, int time,
double nolink) ; Double (or Double Array) Service
-
public DimInfo ( char * name, int time, String
nolink) ; Character String Service
Destructors :
-
public releaseService ( ) ;
Public Functions :
Generic
-
void infoHandler
( ) ; To be overloaded for service reception. The methods
in "Access to the Service Data" can be used inside the Handler in order
to retrieve the data:
Access to the Service Data
-
int getInt ( ) ; Get Integer Service
Contents
-
float getFloat ( ) ; Get Float Service
Contents
-
double getDouble ( ) ; Get Double Service
Contents
-
String getString ( ) ; Get String Service
Contents
-
int[] getIntArray ( ) ; Get Integer Array Service
Contents
-
float[] getFloatArray ( ) ; Get Float Array Service
Contents
-
double[] getDoubleArray ( ) ; Get Double Array Service
Contents
Quality & Timestamping (The information
retrieved by the following methods is set by the sever
by using the class DimService):
-
int getQuality ( ) ; Get the Quality flag received
with the service (set by the server)
-
Date getTimestamp ( ) ; Get the time stamp
Usage :
DIM Client Services (DimInfo) can be used as follows:
public static void main(String[] args)
{
DimInfo srv = new DimInfo("TEST_IT_INT", -1)
{
public void infoHandler()
{
System.out.println("Received: "+getInt());
System.out.println("Quality: "+getQuality());
System.out.println("Timestamp: "+getTimestamp());
}
};
...
}
Last update : 02/11/99 15:53:02 by MkHelp
1.1.0