Public Member Functions | |
virtual const rdaClientInfo * | getClientInfo ()=0 |
Returns information on the listening client. | |
virtual bool | isOnChange ()=0 |
Returns true if the listener is onChange. | |
Immediate notification methods | |
virtual void | valueUpdated (const rdaData &oldValue, const rdaData &newValue, bool hasChanged)=0 |
Gets called when the value at the associated I/O point is updated. | |
virtual void | ioFailed (const rdaIOError &error)=0 |
Gets called when an attempt to update the associated value fails due to an I/O error. | |
Store and flush methods | |
virtual void | valueUpdated (bool value, bool hasChanged)=0 |
Gets called when the boolean value at the associated I/O point is updated. | |
virtual void | valueUpdated (signed char value, bool hasChanged)=0 |
Gets called when the byte value at the associated I/O point is updated. | |
virtual void | valueUpdated (short value, bool hasChanged)=0 |
Gets called when the short value at the associated I/O point is updated. | |
virtual void | valueUpdated (long value, bool hasChanged)=0 |
Gets called when the long value at the associated I/O point is updated. | |
virtual void | valueUpdated (longlong value, bool hasChanged)=0 |
Gets called when the longlong value at the associated I/O point is updated. | |
virtual void | valueUpdated (float value, bool hasChanged)=0 |
Gets called when the float value at the associated I/O point is updated. | |
virtual void | valueUpdated (double value, bool hasChanged)=0 |
Gets called when the double value at the associated I/O point is updated. | |
virtual void | valueUpdated (const char *value, bool hasChanged)=0 |
Gets called when the string value at the associated I/O point is updated. | |
virtual void | valueUpdated (const bool *value, unsigned long size, bool hasChanged)=0 |
Gets called when the boolean array value at the associated I/O point is updated. | |
virtual void | valueUpdated (const signed char *value, unsigned long size, bool hasChanged)=0 |
Gets called when the byte array value at the associated I/O point is updated. | |
virtual void | valueUpdated (const short *value, unsigned long size, bool hasChanged)=0 |
Gets called when the short array value at the associated I/O point is updated. | |
virtual void | valueUpdated (const long *value, unsigned long size, bool hasChanged)=0 |
Gets called when the long array value at the associated I/O point is updated. | |
virtual void | valueUpdated (const longlong *value, unsigned long size, bool hasChanged)=0 |
Gets called when the longlong array value at the associated I/O point is updated. | |
virtual void | valueUpdated (const float *value, unsigned long size, bool hasChanged)=0 |
Gets called when the float array value at the associated I/O point is updated. | |
virtual void | valueUpdated (const double *value, unsigned long size, bool hasChanged)=0 |
Gets called when the double array value at the associated I/O point is updated. | |
virtual void | valueUpdated (const char **value, unsigned long size, bool hasChanged)=0 |
Gets called when the string array value at the associated I/O point is updated. | |
virtual void | valueUpdated (const rdaData &value, bool hasChanged)=0 |
Gets called when the composite rdaData value at the associated I/O point is updated. | |
virtual void | ioFailed (const char *cat, int code, const char *msg, bool newError)=0 |
Gets called when an attempt to update value at the associated I/O point fails due to an I/O error. | |
Static Public Member Functions | |
void | flush (const rdaData &stamp) |
Sends all reports stored in the subscription buffers to clients. |
Each rdaValueChangeListener is attached to exactly one I/O point in a device server; this association is established when the rdaDeviceServerBase::monitorOn() method is invoked on the server with this listener as an argument. The listener is then notified whenever the associated value is updated or an attempt to update the value fails due to an I/O error.
Each rdaValueChangeListener has an associated rdaReplyHandler object on the client side. When notification methods are called on rdaValueChangeListener objects, they generate subscription reports containing specified values or errors; the RDA delivers these reports to clients and invokes corresponding methods on the associated reply handlers. The RDA supports two report delivery modes:
Immediate notification calls allow to report arbitrary complex I/O values and provide any supplementary information (see rdaIOError::getDetails) in the reported errors: the rdaData objects that are used to pass values and error details can contain any number of entries.
The "store and flush" methods allow to report only simple I/O values - such values that can be stored in a single data entry. The notification methods of this group are strongly typed and overloaded for each data type supported in the rdaDataEntry class. Whatever is passed as the value
argument to this methods will be delivered to the client's reply handler in the "value" entry of the reported data. In addition, the reported data will contain copies of all entries passed in the stamp
argument to the rdaValueChangeListener::flush method. The stamp
data will also be available as details in each reported error - no other information can be passed as error details in this mode.
The choice of the report delivery mode depends on specific requirements to performance and value types in a concrete device server implementation. The immediate notification mode should be considered as a default option: it does not impose any limitations on the report format and value types and is sufficiently fast for most uses. The "store and flush" methods can be used when a large number of simple values sharing a common stamp data has to be reported to clients as quickly as possible.
Both report delivery modes can be simultaneously used in the same device server, and different notification calls can be freely mixed in the same or different threads. For example, one thread in a server can perform regular data acquisition synchronized with accelerator timing events and report results in the "store and flush" mode, while another thread in the same server can continously poll status properties and immediately notify clients on faults in the connected equipment - even when the data acquisition is in progress.
Device.h, DeviceServer.h, and Property.h.
|
Sends all reports stored in the subscription buffers to clients.
Contents of the
|
|
Gets called when an attempt to update value at the associated I/O point fails due to an I/O error.
Constructs an rdaIOError object from the specified parameters, generates a subscription report containing the error, and adds it to the subscription buffer. The error
|
|
Gets called when an attempt to update the associated value fails due to an I/O error. Generates a subscription report containing the specified error and sends it to the client.
|
|
Gets called when the composite rdaData value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the string array value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the double array value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the float array value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the longlong array value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the long array value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the short array value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the byte array value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the boolean array value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the string value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the double value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the float value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the longlong value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the long value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the short value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the byte value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the boolean value at the associated I/O point is updated. Generates a subscription report containing the specified value and adds it to the subscription buffer.
|
|
Gets called when the value at the associated I/O point is updated.
Generates a subscription report containing
|