MICALLBACKLIST Class Reference

Callback list. More...

#include <mi32/micallbacklist.h>

List of all members.

Classes

struct  ANYCALLBACKSTRUCT

Public Types

typedef void(* CALLBACKFUNC )(ANYCALLBACKSTRUCT *, void *)
enum  PRIORITY { PRIORITY_High = -1, PRIORITY_Normal = 0, PRIORITY_Low = 1 }

Public Member Functions

 MICALLBACKLIST ()
 ~MICALLBACKLIST ()
ERRVALUE Add (CALLBACKFUNC cbfunc, void *cbdata, UINT32 reasonmask, PRIORITY priority=PRIORITY_Normal)
void CallCallbacks (ANYCALLBACKSTRUCT *cbstruct, UINT32 reason)
bool HasCallbacks (UINT32 reason) const
void Remove (CALLBACKFUNC cbfunc, void *cbdata, UINT32 reasonmask)
void RemoveAll ()

Detailed Description

Callback list.


Member Typedef Documentation

typedef void(* MICALLBACKLIST::CALLBACKFUNC)(ANYCALLBACKSTRUCT *, void *)

Member Enumeration Documentation

Enumerator:
PRIORITY_High 
PRIORITY_Normal 
PRIORITY_Low 

Constructor & Destructor Documentation

MICALLBACKLIST::MICALLBACKLIST (  ) 
MICALLBACKLIST::~MICALLBACKLIST (  ) 

Member Function Documentation

ERRVALUE MICALLBACKLIST::Add ( CALLBACKFUNC  cbfunc,
void *  cbdata,
UINT32  reasonmask,
PRIORITY  priority = PRIORITY_Normal 
)

Add callback to callback list with position determined by priority.

If reasonmask is 0 all reasons will be selected.

Parameters:
cbfunc Callback function
cbdata "Hook" data to pass to callback function
reasonmask Programmer-defined reasons for which callback will be called
priority (PRIORITY_PriorityHigh, PRIORITY_PriorityNormal, PRIORITY_PriorityLow)
void MICALLBACKLIST::CallCallbacks ( ANYCALLBACKSTRUCT cbstruct,
UINT32  reason 
)

Call callbacks in list selected by reason.

The specified reason will be bitwise-anded with the reasonmask which was specified in Add() to determine if the callback function will actually be called. You can use McbAnyCallbackStruct for the structure type if you are only interested in specifying a callback reason and no additional information.

Parameters:
cbstruct Pointer to callback structure, first entry must be ULONG reason
reason Reason, will be ANDed with callback reasonmask
bool MICALLBACKLIST::HasCallbacks ( UINT32  reason  )  const

Check to see if callback list has a callback for a given reason.

Returns:
True if there is a callback in the callback list which matches the given reason.
Parameters:
reason Reason, will be ANDed with callback reasonmask
void MICALLBACKLIST::Remove ( CALLBACKFUNC  cbfunc,
void *  cbdata,
UINT32  reasonmask 
)

Remove callback from list.

If "cbfunc" or "cbdata" are NULL and/or the "reasonmask" is 0 they will not be used to "match" the callbacks. For example, Remove(NULL,data,0) will remove all callbacks that reference the specified "data". This can be useful if that data is about to be freed. Selected callback "reasons" can be removed without removing the entire callback as well. Callbacks can be removed from the list safely while being called.

Parameters:
cbfunc Callback function
cbdata "Hook" data specified in Add()
reasonmask Programmer-defined reasons specified in Add()
void MICALLBACKLIST::RemoveAll (  ) 

Remove all callbacks from list.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:35 2012 for TNTsdk 2012 by  doxygen 1.6.1