commsfwsupport/commselements/meshmachine/inc/mm_activities.h
branchRCL_3
changeset 76 576874e13a2c
parent 66 cbb19216b74d
equal deleted inserted replaced
73:5ebd530e523b 76:576874e13a2c
    34 #ifdef _DEBUG
    34 #ifdef _DEBUG
    35 // Panic category for "absolutely impossible!" vanilla ASSERT()-type panics from this module
    35 // Panic category for "absolutely impossible!" vanilla ASSERT()-type panics from this module
    36 // (if it could happen through user error then you should give it an explicit, documented, category + code)
    36 // (if it could happen through user error then you should give it an explicit, documented, category + code)
    37 _LIT(KSpecAssert_ElemMeshMachActH, "ElemMeshMachActH");
    37 _LIT(KSpecAssert_ElemMeshMachActH, "ElemMeshMachActH");
    38 #endif
    38 #endif
       
    39 
       
    40 //-=========================================================
       
    41 //
       
    42 //Panics
       
    43 //
       
    44 //-=========================================================
       
    45 _LIT (KMMActivityPanic,"MMActivityPanic");
       
    46 enum
       
    47 	{
       
    48 	EPanicCorruptedContext = 1,
       
    49 	EPanicNoPreallocatedSpace = 2,
       
    50 	EPanicOutOfActivities = 3,
       
    51 	EPanicOutOfBounds
       
    52 	};
    39 
    53 
    40 //-=========================================================
    54 //-=========================================================
    41 //
    55 //
    42 // MACROS
    56 // MACROS
    43 //
    57 //
  1046 	For use by custom activity NewLs to generate the unique part of the activity id.
  1060 	For use by custom activity NewLs to generate the unique part of the activity id.
  1047 	@param aActivitySig Context information about how the activity is to be started
  1061 	@param aActivitySig Context information about how the activity is to be started
  1048 	@param aNode        The node to which this activity will belong.
  1062 	@param aNode        The node to which this activity will belong.
  1049 	@return Generated unique component of activity id
  1063 	@return Generated unique component of activity id
  1050 	*/
  1064 	*/
  1051 	static TUint GetNextActivityCountL( const TNodeActivity& aActivitySig, const AMMNodeBase& aNode );
  1065 	IMPORT_C static TUint GetNextActivityCountL( const TNodeActivity& aActivitySig, const AMMNodeBase& aNode );
  1052 	/**
  1066 	/**
  1053 	For use by custom activity News to generate the unique part of the activity id.
  1067 	For use by custom activity News to generate the unique part of the activity id.
  1054 	@param aActivitySig Context information about how the activity is to be started
  1068 	@param aActivitySig Context information about how the activity is to be started
  1055 	@param aNode        The node to which this activity will belong.
  1069 	@param aNode        The node to which this activity will belong.
  1056 	@return Generated unique component of activity id
  1070 	@return Generated unique component of activity id
  1062 	@param aActivitySig Context information about how the activity is to be started
  1076 	@param aActivitySig Context information about how the activity is to be started
  1063 	@param aNode        The node to which this activity will belong.
  1077 	@param aNode        The node to which this activity will belong.
  1064 	@param aNextActivityCount The unique part of the activity id
  1078 	@param aNextActivityCount The unique part of the activity id
  1065 	*/
  1079 	*/
  1066     IMPORT_C CNodeParallelActivityBase( const TNodeActivity& aActivitySig, AMMNodeBase& aNode, TUint aNextActivityCount );
  1080     IMPORT_C CNodeParallelActivityBase( const TNodeActivity& aActivitySig, AMMNodeBase& aNode, TUint aNextActivityCount );
       
  1081 
       
  1082 private:
       
  1083 	/**
       
  1084 	For use by custom activity NewLs to generate the unique part of the activity id.
       
  1085 	@param aActivitySig Context information about how the activity is to be started
       
  1086 	@param aNode        The node to which this activity will belong.
       
  1087 	@return Generated unique component of activity id
       
  1088 	*/
       
  1089 	static TUint DoGetNextActivityCountL( const TNodeActivity& aActivitySig, const AMMNodeBase& aNode );
  1067 
  1090 
  1068 protected:
  1091 protected:
  1069 	/**
  1092 	/**
  1070 	The activity id. The id format is [8 bit unique id|8 bit activity sig].
  1093 	The activity id. The id format is [8 bit unique id|8 bit activity sig].
  1071 	*/
  1094 	*/
  1595 	Private NewL with no implementation to hide the CNodeActivityBase::NewL
  1618 	Private NewL with no implementation to hide the CNodeActivityBase::NewL
  1596 	Creation of preallocated activities doesn't fail and hence a non-leaving ::New should be used instead*/
  1619 	Creation of preallocated activities doesn't fail and hence a non-leaving ::New should be used instead*/
  1597     static MeshMachine::CNodeActivityBase* NewL(const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode);
  1620     static MeshMachine::CNodeActivityBase* NewL(const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode);
  1598 	};
  1621 	};
  1599 
  1622 
  1600 
       
  1601 inline TUint CNodeParallelActivityBase::GetNextActivityCountL( const TNodeActivity& aActivitySig, const AMMNodeBase& aNode )
       
  1602     {
       
  1603     //Historical. Method ceased to leave, but must keep the old, L-ending overload.
       
  1604     return GetNextActivityCount(aActivitySig, aNode);
       
  1605     }
       
  1606 
       
  1607 //By default we reserve the space for preallocated activities generously, to fit even a synchronised activity preallocating space for up to 3 originators.
  1623 //By default we reserve the space for preallocated activities generously, to fit even a synchronised activity preallocating space for up to 3 originators.
  1608 //Any node, hosting specific activities that may need the preallocation mechanism can choose a more optimal amounts.
  1624 //Any node, hosting specific activities that may need the preallocation mechanism can choose a more optimal amounts.
  1609 //For efficiency reasons it is strongly recommended that any node (or family of nodes) is revisited and an optimal
  1625 //For efficiency reasons it is strongly recommended that any node (or family of nodes) is revisited and an optimal
  1610 //amount of space is specified (could be specified in the base class for those nodes or in every type of node separatelly).
  1626 //amount of space is specified (could be specified in the base class for those nodes or in every type of node separatelly).
  1611 static const TUint KDefaultMaxPreallocatedActivityCount = 3;
  1627 static const TUint KDefaultMaxPreallocatedActivityCount = 3;