author | William Roberts <williamr@symbian.org> |
Wed, 16 Jun 2010 15:41:52 +0100 | |
branch | GCC_SURGE |
changeset 161 | d5bf4ee37cad |
parent 33 | 0173bcd7697c |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1998-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 the License "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 |
// f32\sfat32\inc\fat_table32.inl |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
/** |
|
19 |
@file |
|
20 |
*/ |
|
21 |
||
22 |
#ifndef FAT_TABLE_32_INL |
|
23 |
#define FAT_TABLE_32_INL |
|
24 |
||
25 |
||
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
26 |
|
0 | 27 |
//--------------------------------------------------------------------------------------------------------------------------------------- |
28 |
||
29 |
/** @return interface to the FAT drive */ |
|
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
30 |
TDriveInterface& CAtaFatTable::DriveInterface() const |
0 | 31 |
{ |
32 |
return iDriveInteface; |
|
33 |
} |
|
34 |
||
35 |
/** @return pointer to the owning mount. */ |
|
36 |
CFatMountCB* CAtaFatTable::OwnerMount() const |
|
37 |
{ |
|
38 |
return iOwner; |
|
39 |
} |
|
40 |
||
41 |
||
42 |
/** @return state of this object. */ |
|
43 |
CAtaFatTable::TState CAtaFatTable::State() const |
|
44 |
{ |
|
45 |
return iState; |
|
46 |
} |
|
47 |
||
48 |
/** sets the state of this object. */ |
|
49 |
void CAtaFatTable::SetState(CAtaFatTable::TState aState) |
|
50 |
{ |
|
51 |
//__PRINT3(_L("#=-= CAtaFatTable::SetState() drv:%d, %d->%d\n"), iOwner->DriveNumber(),iState,aState); |
|
52 |
iState = aState; |
|
53 |
} |
|
54 |
||
55 |
CAtaFatTable::TFatScanParam::TFatScanParam() |
|
56 |
:iEntriesScanned(0), iFirstFree(0), iCurrFreeEntries(0), iCurrOccupiedEntries(0) |
|
57 |
{ |
|
58 |
} |
|
59 |
||
60 |
//--------------------------------------------------------------------------------------------------------------------------------------- |
|
61 |
||
62 |
/** @return object internal state */ |
|
63 |
CFatHelperThreadBase::TState CFatHelperThreadBase::State() const |
|
64 |
{ |
|
65 |
return iState; |
|
66 |
} |
|
67 |
||
68 |
/** sustend the worker thread */ |
|
69 |
void CFatHelperThreadBase::Suspend() const |
|
70 |
{ |
|
71 |
iThread.Suspend(); |
|
72 |
} |
|
73 |
||
74 |
/** resumes the worker thread */ |
|
75 |
void CFatHelperThreadBase::Resume() const |
|
76 |
{ |
|
77 |
iThread.Resume(); |
|
78 |
} |
|
79 |
||
80 |
/** @return worker thread completion code (logon status) */ |
|
81 |
TInt CFatHelperThreadBase::ThreadCompletionCode() const |
|
82 |
{ |
|
83 |
return iThreadStatus.Int(); |
|
84 |
} |
|
85 |
||
86 |
/** @return ETrue if the thread is working, i.e. its logon status is KRequestPending*/ |
|
87 |
TBool CFatHelperThreadBase::ThreadWorking() const |
|
88 |
{ |
|
89 |
return ThreadCompletionCode() == KRequestPending; |
|
90 |
} |
|
91 |
||
92 |
/** |
|
93 |
boost the priority of the worker thread or return it back to normal |
|
94 |
@param aBoost ETrue to boss the priority, EFalse to "unboost" |
|
95 |
*/ |
|
96 |
void CFatHelperThreadBase::BoostPriority(TBool aBoost) const |
|
97 |
{ |
|
98 |
TThreadPriority priority; |
|
99 |
if(aBoost) |
|
100 |
{ |
|
101 |
priority = (TThreadPriority)EHelperPriorityBoosted; |
|
102 |
iPriorityBoosted = ETrue; |
|
103 |
} |
|
104 |
else |
|
105 |
{ |
|
106 |
priority = (TThreadPriority)EHelperPriorityNormal; |
|
107 |
iPriorityBoosted = EFalse; |
|
108 |
} |
|
109 |
||
110 |
iThread.SetPriority(priority); |
|
111 |
||
112 |
} |
|
113 |
||
114 |
/** @return ETrue if the thread's priority is boosted. */ |
|
115 |
TBool CFatHelperThreadBase::IsPriorityBoosted() const |
|
116 |
{ |
|
117 |
return iPriorityBoosted; |
|
118 |
} |
|
119 |
||
120 |
||
121 |
/** @return worker thread id. */ |
|
122 |
TThreadId CFatHelperThreadBase::ThreadId() const |
|
123 |
{ |
|
124 |
return iThread.Id(); |
|
125 |
} |
|
126 |
||
127 |
/** set the state of the object. See CFatHelperThreadBase::TState enum */ |
|
128 |
void CFatHelperThreadBase::SetState(CFatHelperThreadBase::TState aState) |
|
129 |
{ |
|
130 |
iState = aState; |
|
131 |
} |
|
132 |
||
133 |
/** @return ETrue if the worker thread is allowed to live.*/ |
|
134 |
TBool CFatHelperThreadBase::AllowedToLive() const |
|
135 |
{ |
|
136 |
return iAllowedToLive; |
|
137 |
} |
|
138 |
||
139 |
/** |
|
140 |
Set a flag that indicates if the thread shall be alive or shall finish ASAP |
|
141 |
@param aAllow controls the thread life and death |
|
142 |
*/ |
|
143 |
void CFatHelperThreadBase::AllowToLive(TBool aAllow) |
|
144 |
{ |
|
145 |
iAllowedToLive = aAllow; |
|
146 |
} |
|
147 |
||
148 |
//--------------------------------------------------------------------------------------------------------------------------------------- |
|
149 |
||
150 |
/** @return object type */ |
|
151 |
CFatHelperThreadBase::TFatHelperThreadType CFat32FreeSpaceScanner::Type() const |
|
152 |
{ |
|
153 |
return EFreeSpaceScanner; |
|
154 |
} |
|
155 |
||
156 |
||
157 |
//--------------------------------------------------------------------------------------------------------------------------------------- |
|
158 |
||
159 |
/** @return object type */ |
|
160 |
CFatHelperThreadBase::TFatHelperThreadType CFat32BitCachePopulator::Type() const |
|
161 |
{ |
|
162 |
return EBitCachePopulator; |
|
163 |
} |
|
164 |
||
165 |
||
166 |
#endif //FAT_TABLE_32_INL |
|
167 |
||
168 |
||
169 |
||
170 |
||
171 |
||
172 |
||
173 |
||
174 |
||
175 |
||
176 |
||
177 |
||
178 |
||
179 |
||
180 |
||
181 |
||
182 |
||
183 |
||
184 |
||
185 |
||
186 |
||
187 |
||
188 |
||
189 |