|
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: Definitions for flag operations. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // ---------------------------------------------------------------------------- |
|
20 // TIpsSetUtilsFlags::SetFlag() |
|
21 // ---------------------------------------------------------------------------- |
|
22 // |
|
23 inline void TIpsSetUtilsFlags::SetFlag( const TUint64 aFlag ) |
|
24 { |
|
25 iFlags |= aFlag; |
|
26 } |
|
27 |
|
28 |
|
29 // ---------------------------------------------------------------------------- |
|
30 // TIpsSetUtilsFlags::ClearFlag() |
|
31 // ---------------------------------------------------------------------------- |
|
32 // |
|
33 inline void TIpsSetUtilsFlags::ClearFlag( const TUint64 aFlag ) |
|
34 { |
|
35 iFlags &= ~aFlag; |
|
36 } |
|
37 |
|
38 // ---------------------------------------------------------------------------- |
|
39 // TIpsSetUtilsFlags::Flag() |
|
40 // ---------------------------------------------------------------------------- |
|
41 // |
|
42 inline TBool TIpsSetUtilsFlags::Flag( const TUint64 aFlag ) const |
|
43 { |
|
44 return ( iFlags & aFlag ) > 0; |
|
45 } |
|
46 |
|
47 // ---------------------------------------------------------------------------- |
|
48 // TIpsSetUtilsFlags::SetFlag32() |
|
49 // ---------------------------------------------------------------------------- |
|
50 // |
|
51 inline void TIpsSetUtilsFlags::SetFlag32( const TUint32 aFlag ) |
|
52 { |
|
53 iFlags |= MAKE_TUINT64( aFlag, 0 ); |
|
54 } |
|
55 |
|
56 |
|
57 // ---------------------------------------------------------------------------- |
|
58 // TIpsSetUtilsFlags::ClearFlag32() |
|
59 // ---------------------------------------------------------------------------- |
|
60 // |
|
61 inline void TIpsSetUtilsFlags::ClearFlag32( const TUint32 aFlag ) |
|
62 { |
|
63 // Set the flag that are above the 32-bit space. |
|
64 iFlags &= ~MAKE_TUINT64( aFlag, 0 ); |
|
65 } |
|
66 |
|
67 // ---------------------------------------------------------------------------- |
|
68 // TIpsSetUtilsFlags::Flag32() |
|
69 // ---------------------------------------------------------------------------- |
|
70 // |
|
71 inline TBool TIpsSetUtilsFlags::Flag32( const TUint32 aFlag ) const |
|
72 { |
|
73 // Check the flag exists and return the value as boolean. |
|
74 return ( iFlags & MAKE_TUINT64( aFlag, 0 ) ) > 0; |
|
75 } |
|
76 |
|
77 // ---------------------------------------------------------------------------- |
|
78 // TIpsSetUtilsFlags::ChangeFlag() |
|
79 // ---------------------------------------------------------------------------- |
|
80 // |
|
81 inline void TIpsSetUtilsFlags::ChangeFlag( |
|
82 const TUint64 aFlag, |
|
83 const TBool aNewState ) |
|
84 { |
|
85 if ( aNewState ) |
|
86 { |
|
87 SetFlag( aFlag ); |
|
88 } |
|
89 else |
|
90 { |
|
91 ClearFlag( aFlag ); |
|
92 } |
|
93 } |
|
94 |
|
95 |
|
96 // End of File |