Functions | |
int | InitStat (char *StatName, int StatType, int StatSize) |
int | InitObjectStat (char *ObjectName, char *StatName, int StatType, int StatSize) |
int | CloseStat (int StatId) |
int | CloseObjectStat (int StatId) |
int | SetStatsValue (int StatId, void *Value, int Size) |
int | GetStatsValue (int StatId, void *Buffer, int BuffElemSize) |
int | SetObjectStatsValue (int StatId, void *Value, int Size) |
In order to be viewed/modified, the object must announce its presence (initialize) and give it a name. Then, it must update its contents at every execution cycle (or whenever it desires) using the SetStatsValue function.
Conversely, using the GetStatsValue function it can obtain it last value.
int CloseObjectStat | ( | int | StatId | ) |
int CloseStat | ( | int | StatId | ) |
Close an statistic.
Closes an stat variable so it can not be used neither anymore by the object or other entities. Resources are also de-allocated.
0 error
int GetStatsValue | ( | int | StatId, | |
void * | Buffer, | |||
int | BuffElemSize | |||
) |
Get stat value.
Obtains a variable value. Value is saved in User buffer.
StatId | Id of the variable | |
Buffer | Pointer to buffer where data must be saved. | |
BuffElemSize | Size (in elems) of the user-buffer |
0 error
int InitObjectStat | ( | char * | ObjectName, | |
char * | StatName, | |||
int | StatType, | |||
int | StatSize | |||
) |
todo: during initialization phase, check if a remote object statistics is available. the problem is that it might not be initialized yet.
int InitStat | ( | char * | StatName, | |
int | StatType, | |||
int | StatSize | |||
) |
Initializes an statistics variable.
Initializes a variable given a name, type and size. Once the variable has been initialized, it can be accessed (to view or modify) by higher layers (CMDMAN, user, etc.).
The function returns an statistic identifier which is the one to be used later when viewing/modifying its value.
StatName | Name of the variable | |
StatType | Variable Type | |
StatSize | Size in elements (depends on type) of the variable |
-1 if error
int SetObjectStatsValue | ( | int | StatId, | |
void * | Value, | |||
int | Size | |||
) |
int SetStatsValue | ( | int | StatId, | |
void * | Value, | |||
int | Size | |||
) |
Set stat value.
Modifies a variable value.
StatId | Id of the variable | |
Value | Pointer to user data | |
Size | In elements, depending on type. |
0 error