DH_PointAdd, DH_PointDivide, DH_PointMultiply

DH_PointAdd, DH_PointDivide, DH_PointMultiply — modify a point in place, with one message.

Syntax

#include <cogent.h>
ST_STATUS DH_PointAdd(IP_Task*  myself,
 PT_pCPOINT  ppoint,
 double  value,
 IP_Msg*  hmsg,
 ER_hLIST  elist);
ST_STATUS DH_PointDivide(IP_Task*  myself,
 PT_pCPOINT  ppoint,
 double  value,
 IP_Msg*  hmsg,
 ER_hLIST  elist);
ST_STATUS DH_PointMultiply(IP_Task*  myself,
 PT_pCPOINT  ppoint,
 double  value,
 IP_Msg*  hmsg,
 ER_hLIST  elist);

Arguments

myself

The task handle associated with this task. This should always be the return value from IP_NserveInit.

ppoint

A pointer to a Cascade DataHub point structure. All fields are valid, and will be treated by the write, but in the first call on a point the address field must be zero. It will be filled in automatically. This address will be valid so long as the point exists in the DataHub, and if, in subsequent DH_* functions, the address is provided for this point, the function will run slightly faster.

value

The value to be used to modify the value of the point.

hmsg

A handle to a previously allocated message structure (using IP_MsgCreate) providing enough buffer space to handle the inter-process communication associated with the DataHub transaction.

elist

A return value containing error information. This is unimplemented in this version, and should be NULL.

Returns

ST_OK on success, ST_ERROR on failure, or some other value of ST_STATUS.

Description

These functions give an atomic way to modify a value in the DataHub in place, using a single message. Normally a value is modified in three steps: read, modify, and write. This functions offers a way to modify a value without interference or serialization problems.

The operations provided are as follows:

DH_PointAddAdds the value to the point.
DH_PointDivideDivides the point by the value.
DH_PointMultiplyMultiplies the point by the value.

See Also

DH_AppendString