networkcontrol/commsuserpromptmgr/state/src/netupsstatemachine.cpp
changeset 51 78fceed50f62
parent 0 af10295192d8
equal deleted inserted replaced
42:88121cf79045 51:78fceed50f62
    69 	__FLOG_2(_L("CUpsStateMachine %08x:\t ConstructL()"), this, iNetUpsImpl.LifeTimeMode());		
    69 	__FLOG_2(_L("CUpsStateMachine %08x:\t ConstructL()"), this, iNetUpsImpl.LifeTimeMode());		
    70 
    70 
    71 	// Note the order in which the states are instantiated must match the 
    71 	// Note the order in which the states are instantiated must match the 
    72 	// order in which they are defined in the enumeration TNetUpsState - or a panic will occur.
    72 	// order in which they are defined in the enumeration TNetUpsState - or a panic will occur.
    73 
    73 
    74 	iState.Append(CState::NewL(ENull, *this));	
    74 	CState* state=CState::NewL(ENull, *this);
       
    75 		
       
    76 	CleanupStack::PushL(state);
       
    77 	iState.AppendL(state);
       
    78 	CleanupStack::Pop(state);
       
    79 		
    75 	switch(iNetUpsImpl.LifeTimeMode())
    80 	switch(iNetUpsImpl.LifeTimeMode())
    76 		{
    81 		{
       
    82 			
    77 		case CNetUpsImpl::EProcessLifeTimeMode:
    83 		case CNetUpsImpl::EProcessLifeTimeMode:
    78 			{
    84 			{
    79 			iState.Append(CState::NewL(EProcLife_NonSession, *this));			
    85 			CState* stateone= CState::NewL(EProcLife_NonSession, *this);
    80 			iState.Append(CState::NewL(EProcLife_Transit_SessionYes, *this)); // a transient state is entered when the UPS Server responds with either SessionYes or SessionNo and there are 1 or more UPS requests outstanding to other subsessions which are associated with the same process.			
    86 			CleanupStack::PushL(stateone);
    81 			iState.Append(CState::NewL(EProcLife_SessionYes, *this));
    87 			iState.AppendL(stateone);	
    82 			iState.Append(CState::NewL(EProcLife_Transit_SessionNo, *this));
    88 			
    83 			iState.Append(CState::NewL(EProcLife_SessionNo, *this));
    89 			CState* statetwo = CState::NewL(EProcLife_Transit_SessionYes, *this);
       
    90 			CleanupStack::PushL(statetwo);
       
    91 			iState.AppendL(statetwo); // a transient state is entered when the UPS Server responds with either SessionYes or SessionNo and there are 1 or more UPS requests outstanding to other subsessions which are associated with the same process.			
       
    92 			
       
    93 			CState* statethree = CState::NewL(EProcLife_SessionYes, *this);
       
    94 			CleanupStack::PushL(statethree);
       
    95 			iState.AppendL(statethree);
       
    96 			
       
    97 			CState* statefour = CState::NewL(EProcLife_Transit_SessionNo, *this);
       
    98 			CleanupStack::PushL(statefour);
       
    99 			iState.AppendL(statefour);
       
   100 			
       
   101 			CState* statefive = CState::NewL(EProcLife_SessionNo, *this);
       
   102 			CleanupStack::PushL(statefive);
       
   103 			iState.AppendL(statefive);
       
   104 			
       
   105 			CleanupStack::Pop(5);
    84 			break;
   106 			break;
    85 			}
   107 			}
    86 		case CNetUpsImpl::ENetworkLifeTimeMode:
   108 		case CNetUpsImpl::ENetworkLifeTimeMode:
    87 			{
   109 			{
    88 			iState.Append(CState::NewL(ENetLife_NonSession, *this));			
   110 			CState* stateone = CState::NewL(EProcLife_NonSession, *this);
    89 			iState.Append(CState::NewL(ENetLife_SessionNo_Transit_WithoutConnections, *this));			
   111 			CleanupStack::PushL(stateone);
    90 			iState.Append(CState::NewL(ENetLife_SessionNo_WithOutConnections, *this));
   112 			iState.AppendL(stateone);
    91 			iState.Append(CState::NewL(ENetLife_SessionNo_Transit_WithConnections, *this));
   113 			
    92 			iState.Append(CState::NewL(ENetLife_SessionNo_WithConnections, *this));
   114 			CState* statetwo = CState::NewL(ENetLife_SessionNo_Transit_WithoutConnections, *this);
    93 			iState.Append(CState::NewL(ENetLife_Transit_SessionYes, *this));
   115 			CleanupStack::PushL(statetwo);
    94 			iState.Append(CState::NewL(ENetLife_SessionYes, *this));
   116 			iState.AppendL(statetwo);		
       
   117 			
       
   118 			CState* statethree = CState::NewL(ENetLife_SessionNo_WithOutConnections, *this);
       
   119 			CleanupStack::PushL(statethree);
       
   120 			iState.AppendL(statethree);
       
   121 			
       
   122 			CState* statefour = CState::NewL(ENetLife_SessionNo_Transit_WithConnections, *this);
       
   123 			CleanupStack::PushL(statefour);
       
   124 			iState.AppendL(statefour);
       
   125 			
       
   126 			CState* statefive = CState::NewL(ENetLife_SessionNo_WithConnections, *this);
       
   127 			CleanupStack::PushL(statefive);
       
   128 			iState.AppendL(statefive);
       
   129 			
       
   130 			CState* statesix = CState::NewL(ENetLife_Transit_SessionYes, *this);
       
   131 			CleanupStack::PushL(statesix);
       
   132 			iState.AppendL(statesix);
       
   133 								
       
   134 			CState* stateseven = CState::NewL(ENetLife_SessionYes, *this);
       
   135 			CleanupStack::PushL(stateseven);
       
   136 			iState.AppendL(stateseven);
       
   137 			
       
   138 			CleanupStack::Pop(7);
    95 			break;				
   139 			break;				
    96 			}
   140 			}
    97 		default:
   141 		default:
    98 			{
   142 			{
    99 			User::Leave(KErrNotSupported);			
   143 			User::Leave(KErrNotSupported);