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 TIntParkState(const TNodeContextBase &)
IMPORT_C voidParkTransitionL(const TNodeContextBase &)
IMPORT_C TBoolSignal(TNodeContextBase &)
IMPORT_C TIntUnparkState(const TNodeContextBase &)
IMPORT_C voidWait()
Protected Member Functions
AActivitySemaphore()
~AActivitySemaphore()
voidClearIsWaiting()
voidClearWillWait()
voidSetIsWaiting()
voidSetWillWait()
TBool WillWait()
Private Member Functions
voidClearIsTransition()
TBool IsTransition()
voidSetIsTransition()
Private Member Enumerations
enumanonymous { KIsWaiting = 0x1, KWillWait = 0x2, KIsTransition = 0x4 }
Public Attributes
const TIntKInterfaceId
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()

voidClearIsTransition()[private, inline]

ClearIsWaiting()

voidClearIsWaiting()[protected, inline]

Clear the isWaiting flag

ClearWillWait()

voidClearWillWait()[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 TIntParkState(const TNodeContextBase &aContext)[static]

Park a state.

Parameters

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

ParkTransitionL(const TNodeContextBase &)

IMPORT_C voidParkTransitionL(const TNodeContextBase &aContext)[static]

Park a transition

Parameters

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

SetIsTransition()

voidSetIsTransition()[private, inline]

SetIsWaiting()

voidSetIsWaiting()[protected, inline]

Set the isWaiting flag

SetWillWait()

voidSetWillWait()[protected, inline]

Set the willWait flag

Signal(TNodeContextBase &)

IMPORT_C TBoolSignal(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 & aContextCurrent context in the state machine.

UnparkState(const TNodeContextBase &)

IMPORT_C TIntUnparkState(const TNodeContextBase &aContext)[static]

Unpark a state.

Parameters

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

Wait()

IMPORT_C voidWait()

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 TIntKInterfaceId[static]

Interface id

TUint8 iFlags

TUint8 iFlags[private]