commsfwsupport/commselements/meshmachine/inc/mm_activities_internal.h
changeset 0 dfb7c4ff071f
child 18 9644881fedd0
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // generic framework node state machine states
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalAll
       
    21 */
       
    22 
       
    23 #ifndef SYMBIAN_MM_ACTIVITIES_INTERNAL_H
       
    24 #define SYMBIAN_MM_ACTIVITIES_INTERNAL_H
       
    25 
       
    26 namespace MeshMachine
       
    27 {
       
    28 
       
    29 static const TUint16 KActivityNull                 = 0;
       
    30 static const TUint16 KActivityCustom               = 0x007f;
       
    31 //the range is used for activities that can run more than one instance in parallel
       
    32 //such activities must be type of or derived from CNodeParallerActivityBase (e_mm_activity.h)
       
    33 static const TUint16 KActivityParallelRangeMin     = 0x0100;
       
    34 static const TUint16 KActivityParallelRangeMax     = 0xFF00;
       
    35 
       
    36 class AMMNodeBase;
       
    37 class CNodeActivityBase;
       
    38 class TNodeContextBase;
       
    39 
       
    40 //-=========================================================
       
    41 //
       
    42 // TNodeActivity
       
    43 //
       
    44 //-=========================================================
       
    45 struct TNodeActivity
       
    46 /**
       
    47 */
       
    48 	{
       
    49 	typedef CNodeActivityBase* (*TStaticActivityCtor)(const TNodeActivity& aActivitySig, AMMNodeBase& aNode);
       
    50 	const TUint8 iId;
       
    51 	//Message starting the activity (state in iFirstTriple is waiting for),
       
    52 	//used by error handling, could be NULL for "single triple" activities because
       
    53 	//than the current message associated with context is used.
       
    54     const TUint16 iKickOffMessageId;
       
    55     const TUint32 iKickOffMessageRealm;
       
    56 	const NetStateMachine::TStateTriple& iFirstTriple;
       
    57 	const TStaticActivityCtor iCtor;
       
    58 	const TText8* iName;
       
    59 	};
       
    60 
       
    61 //-=========================================================
       
    62 //
       
    63 // TNodeActivityMap
       
    64 //
       
    65 //-=========================================================
       
    66 struct TNodeActivityMap
       
    67 /**
       
    68 */
       
    69 	{
       
    70 	typedef const TNodeActivityMap& (*TStaticNodeActivityMap)();
       
    71 	typedef const TNodeActivity& (*TStaticNodeActivity)();
       
    72 	const TStaticNodeActivity& iFirstActivity;
       
    73 	};
       
    74 
       
    75 //-=========================================================
       
    76 //
       
    77 // TNodeActivityIter
       
    78 //
       
    79 //-=========================================================
       
    80 class TNodeActivityIter
       
    81 /**
       
    82 */
       
    83 	{
       
    84 public:
       
    85 	TNodeActivityIter(const TNodeActivityMap& aActivityMap)
       
    86 	:	iCurrentEntry(&aActivityMap.iFirstActivity)
       
    87 		{
       
    88 		}
       
    89 	const TNodeActivity* operator++(TInt /*aInd*/)
       
    90 		{
       
    91 		return FetchActivity(); //recursive
       
    92 		}
       
    93 
       
    94 private:
       
    95 	const TNodeActivity* FetchActivity();
       
    96 
       
    97 private:
       
    98 	const TNodeActivityMap::TStaticNodeActivity* iCurrentEntry;
       
    99 	};
       
   100 
       
   101 } // namespace MeshMachine
       
   102 
       
   103 #endif // SYMBIAN_MM_ACTIVITIES_INTERNAL_H
       
   104