MeshMachine::AActivitySemaphore Class Reference

class MeshMachine::AActivitySemaphore : public MeshMachine::AContextStore

Aggregate class for activities which wish to use mutexes.

After a serialised state or transition has been unblocked, signalled and invoked, AActivitySemaphore clears all of the synchronisation related information (e.g stored context), assuming that the job has been done. Sometimes however the serialised state, upon more careful inspection of the environment (context), may decide that it still does not want to be executed and it wishes to sleep again.

In such case it would call Wait() and return EIgnore from its TransitionTag() . The same applies to a serialised transition. It may want to call Wait() instead of, for example sending a request message.

After calling Wait() the serialised state will be woken up when the policy matches, which allows the serialised state to finish its job.

Inherits from

Public Member Functions
TBool IsWaiting ()
IMPORT_C TInt ParkState (const TNodeContextBase &)
IMPORT_C void ParkTransitionL (const TNodeContextBase &)
IMPORT_C TBool Signal ( TNodeContextBase &)
IMPORT_C TInt UnparkState (const TNodeContextBase &)
IMPORT_C void Wait ()
Protected Member Functions
AActivitySemaphore ()
~AActivitySemaphore ()
void ClearIsWaiting ()
void ClearWillWait ()
void SetIsWaiting ()
void SetWillWait ()
TBool WillWait ()
Private Member Functions
void ClearIsTransition ()
TBool IsTransition ()
void SetIsTransition ()
Private Member Enumerations
enum anonymous { KIsWaiting  = 0x1, KWillWait  = 0x2, KIsTransition  = 0x4 }
Public Attributes
const TInt KInterfaceId
Private Attributes
TUint8 iFlags

Constructor & Destructor Documentation

AActivitySemaphore()

AActivitySemaphore ( ) [protected, inline, explicit]

Constructor for AActivitySemaphore

~AActivitySemaphore()

~AActivitySemaphore ( ) [protected, inline]

Destructor for AActivitySemaphore

Member Functions Documentation

ClearIsTransition()

void ClearIsTransition ( ) [private, inline]

ClearIsWaiting()

void ClearIsWaiting ( ) [protected, inline]

Clear the isWaiting flag

ClearWillWait()

void ClearWillWait ( ) [protected, inline]

Clear the willWait flag

IsTransition()

TBool IsTransition ( ) const [private, inline]

IsWaiting()

TBool IsWaiting ( ) const [inline]

Check if the activity is waiting

ParkState(const TNodeContextBase &)

IMPORT_C TInt ParkState ( const TNodeContextBase & aContext ) [static]

Park a state.

Parameters

const TNodeContextBase & aContext The context which the state is to run in. This will be stored

ParkTransitionL(const TNodeContextBase &)

IMPORT_C void ParkTransitionL ( const TNodeContextBase & aContext ) [static]

Park a transition

Parameters

const TNodeContextBase & aContext The context which the transition is to run in.

SetIsTransition()

void SetIsTransition ( ) [private, inline]

SetIsWaiting()

void SetIsWaiting ( ) [protected, inline]

Set the isWaiting flag

SetWillWait()

void SetWillWait ( ) [protected, inline]

Set the willWait flag

Signal(TNodeContextBase &)

IMPORT_C TBool Signal ( TNodeContextBase & aContext )

Signals to the activity that an event has occurred. Used for waking up sleeping activities which use mutexes. The activity is expected to check if the mutex has now cleared.

Parameters

TNodeContextBase & aContext Current context in the state machine.

UnparkState(const TNodeContextBase &)

IMPORT_C TInt UnparkState ( const TNodeContextBase & aContext ) [static]

Unpark a state.

Parameters

const TNodeContextBase & aContext The context which the state is to run in.

Wait()

IMPORT_C void Wait ( )

Tell the activity to wait. The activity will wait until Signal() is called.

WillWait()

TBool WillWait ( ) const [protected, inline]

Check if the WillWait flag is set. The WillWait flag indicates whether the activity will be in a waiting state at the end of the signal function. This is distinct from "is waiting" which indicates whether the activity was waiting on entry to the Signal() function.

Member Enumerations Documentation

Enum anonymous

Enumerators

KIsWaiting = 0x1
KWillWait = 0x2
KIsTransition = 0x4

Member Data Documentation

const TInt KInterfaceId

const TInt KInterfaceId [static]

Interface id

TUint8 iFlags

TUint8 iFlags [private]