equal
deleted
inserted
replaced
|
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 // |
|
15 |
|
16 #include <stddef.h> |
|
17 |
|
18 #include "messagedefparser\statemachinebase.h" |
|
19 #include "messagedefparser\statebase.h" |
|
20 |
|
21 CStateMachineBase::CStateMachineBase() |
|
22 { |
|
23 iCurrentState = NULL; |
|
24 iLastState = NULL; |
|
25 } |
|
26 |
|
27 CStateMachineBase::~CStateMachineBase() |
|
28 { |
|
29 delete iCurrentState; |
|
30 delete iLastState; |
|
31 } |
|
32 |
|
33 void CStateMachineBase::SetState(CStateBase* aNewState) |
|
34 { |
|
35 delete iLastState; |
|
36 iLastState = iCurrentState; |
|
37 iCurrentState = aNewState; |
|
38 iCurrentState->EnterState(); |
|
39 } |
|
40 |