Objective Systems, Inc.  

ooTimer.h File Reference

Timer structures and functions. More...

#include "ooasn1.h"
#include "ooSocket.h"

Go to the source code of this file.

Data Structures

struct  _OOTimer

Typedefs

typedef int(*) OOTimerCbFunc (void *data)
typedef _OOTimer OOTimer

Functions

EXTERN void ooTimerComputeExpireTime (OOTimer *pTimer)
 This function computes the relative expiration time from the current time for the given timer object.
EXTERN OOTimerooTimerCreate (OOCTXT *pctxt, DList *pList, OOTimerCbFunc cb, OOUINT32 deltaSecs, void *data, OOBOOL reRegister)
 This function creates and initializes a new timer object.
EXTERN void ooTimerDelete (OOCTXT *pctxt, DList *pList, OOTimer *pTimer)
 This function deletes the given timer object.
EXTERN OOBOOL ooTimerExpired (OOTimer *pTimer)
 This function checks a timer to determine if it is expired.
EXTERN void ooTimerFireExpired (OOCTXT *pctxt, DList *pList)
 This function loops through the global timer list and fires all expired timers by calling the registered callback functions.
EXTERN int ooTimerInsertEntry (OOCTXT *pctxt, DList *pList, OOTimer *pTimer)
 This function inserts the given timer object into the correct chronological position in the global timer list.
EXTERN struct timeval * ooTimerNextTimeout (DList *pList, struct timeval *ptimeout)
 This function calculates the relative time from the current time that the first timer in global timer list will expire.
EXTERN void ooTimerReset (OOCTXT *pctxt, DList *pList, OOTimer *pTimer)
 This function resets the given timer object if its reregister flag is set.
int ooCompareTimeouts (struct timeval *to1, struct timeval *to2)
 This function is used to compare two timeout values.


Detailed Description

Timer structures and functions.

Definition in file ooTimer.h.


Function Documentation

EXTERN void ooTimerComputeExpireTime ( OOTimer pTimer  ) 

This function computes the relative expiration time from the current time for the given timer object.

Parameters:
pTimer Pointer to timer object.

EXTERN OOTimer* ooTimerCreate ( OOCTXT pctxt,
DList *  pList,
OOTimerCbFunc  cb,
OOUINT32  deltaSecs,
void *  data,
OOBOOL  reRegister 
)

This function creates and initializes a new timer object.

Parameters:
pctxt OOCTXT structure used for timer memory allocation.
pList Pointer to timer list in which newly created timer will be inserted.
cb Timer callback function.
deltaSecs Time in seconds to timer expiration.
data Callback user data argument.
reRegister Should timer be re-registered after it expires?
Returns:
Pointer to created timer object.

EXTERN void ooTimerDelete ( OOCTXT pctxt,
DList *  pList,
OOTimer pTimer 
)

This function deletes the given timer object.

Parameters:
pctxt Handle to OOCTXT structure used for timer memory.
pList timer list to operate on
pTimer Pointer to timer object.

EXTERN OOBOOL ooTimerExpired ( OOTimer pTimer  ) 

This function checks a timer to determine if it is expired.

Parameters:
pTimer Pointer to timer object.
Returns:
True if timer expired, false if not.

EXTERN int ooTimerInsertEntry ( OOCTXT pctxt,
DList *  pList,
OOTimer pTimer 
)

This function inserts the given timer object into the correct chronological position in the global timer list.

Parameters:
pctxt Pointer to OOCTXT structure used for memory allocation.
pList List in which timer has to be inserted.
pTimer Pointer to timer object.
Returns:
Index to position where inserted in list.

EXTERN struct timeval* ooTimerNextTimeout ( DList *  pList,
struct timeval *  ptimeout 
)

This function calculates the relative time from the current time that the first timer in global timer list will expire.

Parameters:
pList Handle to timer list
ptimeout timeval structure to receive timeout value.
Returns:
ptimeout

EXTERN void ooTimerReset ( OOCTXT pctxt,
DList *  pList,
OOTimer pTimer 
)

This function resets the given timer object if its reregister flag is set.

Otherwise, it is deleted.

Parameters:
pctxt Pointer to OOCTXT structre used for memory allocation.
pList Pointer to timer list.
pTimer Pointer to timer object.

int ooCompareTimeouts ( struct timeval *  to1,
struct timeval *  to2 
)

This function is used to compare two timeout values.

Parameters:
to1 First timeout value.
to2 Second timeout value.
Returns:
1, if to1 > to2; 0, if to1 == to2; -1, if to1 < to2


This file was last modified on 28 May 2010.
Objective Open H.323 Stack, 0.9.1