|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: ICE com test states |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "natcomteststate.h" |
|
22 |
|
23 // --------------------------------------------------------------------------- |
|
24 // TNatComTestState::TNatComTestState |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 TNatComTestState::TNatComTestState() : |
|
28 iCurrentIndex( 0 ) |
|
29 { |
|
30 } |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // TNatComTestState::~TNatComTestState |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 TNatComTestState::~TNatComTestState() |
|
37 { |
|
38 iStateSequence.Close(); |
|
39 } |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // TNatComTestState::SetStateSequence |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 void TNatComTestState::SetSequence( |
|
46 const RArray<TNatComState> aStateSequence ) |
|
47 { |
|
48 iStateSequence.Reset(); |
|
49 TInt count = aStateSequence.Count(); |
|
50 |
|
51 for ( TInt i( 0 ); i < count; i++ ) |
|
52 { |
|
53 iStateSequence.Append( aStateSequence[ i ] ); |
|
54 } |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // TNatComTestState::Current |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 TNatComState TNatComTestState::Current() |
|
62 { |
|
63 return iStateSequence[ iCurrentIndex ]; |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------------------------- |
|
67 // TNatComTestState::Next |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 TNatComState TNatComTestState::Next() |
|
71 { |
|
72 if ( iCurrentIndex < iStateSequence.Count() ) |
|
73 { |
|
74 iCurrentIndex++; |
|
75 } |
|
76 return iStateSequence[ iCurrentIndex ]; |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // TNatComTestState::SetTestType |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 void TNatComTestState::SetTestType( TInt aTestType ) |
|
84 { |
|
85 iComTestType = aTestType; |
|
86 } |
|
87 |
|
88 // --------------------------------------------------------------------------- |
|
89 // TNatComTestState::TestType |
|
90 // --------------------------------------------------------------------------- |
|
91 // |
|
92 TInt TNatComTestState::TestType() |
|
93 { |
|
94 return iComTestType; |
|
95 } |