Statistics


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)

Detailed Description

Statistics are variables that evolve in time. They can be viewed in real-time by ALOE or another higher-level application (CMDMAN), captured and dumped to a file or modified.

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.


Function Documentation

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.

Returns:
1 ok

0 error

int GetStatsValue ( int  StatId,
void *  Buffer,
int  BuffElemSize 
)

Get stat value.

Obtains a variable value. Value is saved in User buffer.

Parameters:
StatId Id of the variable
Buffer Pointer to buffer where data must be saved.
BuffElemSize Size (in elems) of the user-buffer
Returns:
1 ok

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.

Parameters:
StatName Name of the variable
StatType Variable Type
StatSize Size in elements (depends on type) of the variable
Returns:
> 0 Stat_id

-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.

Parameters:
StatId Id of the variable
Value Pointer to user data
Size In elements, depending on type.
Returns:
1 ok

0 error


Generated on Thu Jul 29 19:37:21 2010 for ALOESoftwareAPI(SWAPI) by  doxygen 1.5.5