|
1 // Copyright (c) 2006-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 // @file policies.h |
|
15 // This header file contain the classes that handle qos policies |
|
16 // @internalTechnology |
|
17 // @released |
|
18 // |
|
19 |
|
20 #ifndef __POLICIES_H__ |
|
21 #define __POLICIES_H__ |
|
22 |
|
23 #include "pfqosparser.h" |
|
24 |
|
25 /** |
|
26 * Modulespec |
|
27 * |
|
28 * @internalTechnology |
|
29 */ |
|
30 class CModuleSpec : public CBase |
|
31 { |
|
32 public: |
|
33 static CModuleSpec* NewL(const TDesC& aFileName, const TDesC& aModuleName); |
|
34 static CModuleSpec* NewL(const TPfqosModule& aModule); |
|
35 ~CModuleSpec(); |
|
36 |
|
37 inline TUint ProtocolId() const; |
|
38 inline void SetProtocolId(TUint aProtocolId); |
|
39 inline TUint32 Flags() const; |
|
40 inline void SetFlags(TUint32 aFlags); |
|
41 inline const TDesC& FileName() const; |
|
42 inline const TDesC& Name() const; |
|
43 inline CExtension* PolicyData(); |
|
44 |
|
45 TDblQueLink iDLink; |
|
46 |
|
47 private: |
|
48 CModuleSpec(); |
|
49 void ContructL(const TPfqosModule& aModule); |
|
50 void ContructL(const TDesC& aFileName, const TDesC& aModuleName); |
|
51 |
|
52 private: |
|
53 TName iName; // Module name |
|
54 TFileName iFileName; // Filename of DLL module |
|
55 TUint32 iFlags; // Module flags |
|
56 TUint iProtocolId; // Needed for NewProtocolL() |
|
57 CExtension* iExtension; // Config data |
|
58 }; |
|
59 |
|
60 // Inline methods |
|
61 /** @internalTechnology */ |
|
62 inline TUint CModuleSpec::ProtocolId() const |
|
63 { return iProtocolId; }; |
|
64 |
|
65 /** @internalTechnology */ |
|
66 inline void CModuleSpec::SetProtocolId(TUint aProtocolId) |
|
67 { iProtocolId = aProtocolId; } |
|
68 |
|
69 /** @internalTechnology */ |
|
70 inline TUint32 CModuleSpec::Flags() const |
|
71 { return iFlags; }; |
|
72 |
|
73 /** @internalTechnology */ |
|
74 inline void CModuleSpec::SetFlags(TUint32 aFlags) |
|
75 { iFlags = aFlags; }; |
|
76 |
|
77 /** @internalTechnology */ |
|
78 inline const TDesC& CModuleSpec::FileName() const |
|
79 { return iFileName; }; |
|
80 |
|
81 /** @internalTechnology */ |
|
82 inline const TDesC& CModuleSpec::Name() const |
|
83 { return iName; }; |
|
84 |
|
85 /** @internalTechnology */ |
|
86 inline CExtension* CModuleSpec::PolicyData() |
|
87 { return iExtension; }; |
|
88 |
|
89 |
|
90 /** |
|
91 * Modulespec policy |
|
92 * |
|
93 * @internalTechnology |
|
94 */ |
|
95 class CModuleSelector : public CSelectorBase |
|
96 { |
|
97 public: |
|
98 CModuleSelector(TPfqosMessage& aMsg); |
|
99 CModuleSelector(CSelectorBase& aSel); |
|
100 ~CModuleSelector(); |
|
101 |
|
102 void AddModuleSpec(CModuleSpec& aModule); |
|
103 void RemoveModuleSpec(CModuleSpec* aModule); |
|
104 CModuleSpec* FindModuleSpec(TUint aProtocolId); |
|
105 inline TDblQue<CModuleSpec>& GetModuleList(); |
|
106 |
|
107 protected: |
|
108 TDblQue<CModuleSpec> iModules; |
|
109 }; |
|
110 |
|
111 // Inline methods |
|
112 /** @internalTechnology */ |
|
113 inline TDblQue<CModuleSpec>& CModuleSelector::GetModuleList() |
|
114 { return iModules; }; |
|
115 |
|
116 |
|
117 /** |
|
118 * Flowspec policy |
|
119 * |
|
120 * @internalTechnology |
|
121 */ |
|
122 class CPolicySelector : public CSelectorBase |
|
123 { |
|
124 public: |
|
125 CPolicySelector(TPfqosMessage& aMsg); |
|
126 CPolicySelector(CSelectorBase& aSel); |
|
127 ~CPolicySelector(); |
|
128 void SetQoSParameters(const TQoSParameters& aSpec) { iQoS = aSpec; }; |
|
129 void SetQoSParameters(const TPfqosFlowSpec& aSpec); |
|
130 inline const TQoSParameters& QoSParameters() const; |
|
131 |
|
132 private: |
|
133 TQoSParameters iQoS; |
|
134 }; |
|
135 |
|
136 // Inline methods |
|
137 /** @internalTechnology */ |
|
138 inline const TQoSParameters& CPolicySelector::QoSParameters() const |
|
139 { return iQoS; }; |
|
140 |
|
141 |
|
142 // Internal help function for logging only (defining this |
|
143 // always should not cause a problem in release build, becuase |
|
144 // it's neiter defined nor used). |
|
145 extern void DumpSelector(const CSelectorBase& aSelector); |
|
146 |
|
147 |
|
148 #endif |