sl@0
|
1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@publishedPartner
|
sl@0
|
19 |
@released
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
|
sl@0
|
22 |
#ifndef MDFPROCESSINGUNIT_H
|
sl@0
|
23 |
#define MDFPROCESSINGUNIT_H
|
sl@0
|
24 |
|
sl@0
|
25 |
#include <e32base.h>
|
sl@0
|
26 |
#include <ecom/implementationinformation.h>
|
sl@0
|
27 |
#include <mdf/mdfinputport.h>
|
sl@0
|
28 |
#include <mdf/mdfoutputport.h>
|
sl@0
|
29 |
|
sl@0
|
30 |
class MMdfInputPort;
|
sl@0
|
31 |
class MMdfOutputPort;
|
sl@0
|
32 |
class CMdfProcessingUnit;
|
sl@0
|
33 |
class MMdfInputPortObserver;
|
sl@0
|
34 |
class MMdfOutputPortObserver;
|
sl@0
|
35 |
class TPuConfig;
|
sl@0
|
36 |
|
sl@0
|
37 |
/**
|
sl@0
|
38 |
Processing Unit internal state.
|
sl@0
|
39 |
*/
|
sl@0
|
40 |
enum TProcessingUnitState
|
sl@0
|
41 |
{
|
sl@0
|
42 |
/**
|
sl@0
|
43 |
Processing Unit invalid state
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
EProcessingUnitInvalid = 0,
|
sl@0
|
46 |
/**
|
sl@0
|
47 |
Processing Unit loaded state
|
sl@0
|
48 |
*/
|
sl@0
|
49 |
EProcessingUnitLoaded,
|
sl@0
|
50 |
/**
|
sl@0
|
51 |
Processing Unit idle state
|
sl@0
|
52 |
*/
|
sl@0
|
53 |
EProcessingUnitIdle,
|
sl@0
|
54 |
/**
|
sl@0
|
55 |
Processing Unit executing state
|
sl@0
|
56 |
*/
|
sl@0
|
57 |
EProcessingUnitExecuting,
|
sl@0
|
58 |
/**
|
sl@0
|
59 |
Processing Unit paused state
|
sl@0
|
60 |
*/
|
sl@0
|
61 |
EProcessingUnitPaused,
|
sl@0
|
62 |
/**
|
sl@0
|
63 |
Processing Unit waiting for resources state
|
sl@0
|
64 |
*/
|
sl@0
|
65 |
EProcessingUnitWaitingForResources,
|
sl@0
|
66 |
/**
|
sl@0
|
67 |
Processing Unit loading state
|
sl@0
|
68 |
*/
|
sl@0
|
69 |
EProcessingUnitLoading,
|
sl@0
|
70 |
/**
|
sl@0
|
71 |
Processing Unit initializing state
|
sl@0
|
72 |
*/
|
sl@0
|
73 |
EProcessingUnitInitializing
|
sl@0
|
74 |
};
|
sl@0
|
75 |
|
sl@0
|
76 |
/**
|
sl@0
|
77 |
Processing Unit observer class
|
sl@0
|
78 |
*/
|
sl@0
|
79 |
class MMdfProcessingUnitObserver
|
sl@0
|
80 |
{
|
sl@0
|
81 |
public:
|
sl@0
|
82 |
/**
|
sl@0
|
83 |
Called by a Processing Unit when Initialize() has completed.
|
sl@0
|
84 |
@param aPu
|
sl@0
|
85 |
The Processing Unit which sent the callback.
|
sl@0
|
86 |
@param aErrorCode
|
sl@0
|
87 |
An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
88 |
another of the system-wide error codes.
|
sl@0
|
89 |
*/
|
sl@0
|
90 |
virtual void InitializeComplete(const CMdfProcessingUnit* aPu, TInt aErrorCode) = 0;
|
sl@0
|
91 |
|
sl@0
|
92 |
/**
|
sl@0
|
93 |
Called by a Processing Unit when Execute() has completed.
|
sl@0
|
94 |
@param aPu
|
sl@0
|
95 |
The Processing Unit which sent the callback.
|
sl@0
|
96 |
@param aErrorCode
|
sl@0
|
97 |
An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
98 |
another of the system-wide error codes.
|
sl@0
|
99 |
*/
|
sl@0
|
100 |
virtual void ExecuteComplete(const CMdfProcessingUnit* aPu, TInt aErrorCode) = 0;
|
sl@0
|
101 |
};
|
sl@0
|
102 |
|
sl@0
|
103 |
/**
|
sl@0
|
104 |
Processing Unit interface
|
sl@0
|
105 |
*/
|
sl@0
|
106 |
class CMdfProcessingUnit : public CBase
|
sl@0
|
107 |
{
|
sl@0
|
108 |
public:
|
sl@0
|
109 |
/**
|
sl@0
|
110 |
Standard safe constructor that leaves nothing on the cleanup stack
|
sl@0
|
111 |
@param aImplementationUid
|
sl@0
|
112 |
The uid of the new created processing unit.
|
sl@0
|
113 |
@return A pointer to the newly constructed object.
|
sl@0
|
114 |
*/
|
sl@0
|
115 |
inline static CMdfProcessingUnit* NewL(TUid aImplementationUid);
|
sl@0
|
116 |
|
sl@0
|
117 |
/**
|
sl@0
|
118 |
Synchronous method which creates the Processing Unit.
|
sl@0
|
119 |
@param aProcessingUnitObserver
|
sl@0
|
120 |
The class to receive asynchronous Processing Unit events.
|
sl@0
|
121 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
122 |
another of the system-wide error codes.
|
sl@0
|
123 |
*/
|
sl@0
|
124 |
virtual TInt Create(const MMdfProcessingUnitObserver& aProcessingUnitObserver) = 0;
|
sl@0
|
125 |
|
sl@0
|
126 |
/**
|
sl@0
|
127 |
Synchronous method which returns the Input Ports that a Processing Unit holds.
|
sl@0
|
128 |
@param aComponentInputPorts
|
sl@0
|
129 |
The array to which the Input Ports will be appended.
|
sl@0
|
130 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
131 |
another of the system-wide error codes.
|
sl@0
|
132 |
*/
|
sl@0
|
133 |
virtual TInt GetInputPorts(RPointerArray<MMdfInputPort>& aComponentInputPorts) = 0;
|
sl@0
|
134 |
|
sl@0
|
135 |
/**
|
sl@0
|
136 |
Synchronous method which returns the Output Ports that a Processing Unit holds.
|
sl@0
|
137 |
@param aComponentOutputPorts
|
sl@0
|
138 |
The array to which the Output Ports will be appended.
|
sl@0
|
139 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
140 |
another of the system-wide error codes.
|
sl@0
|
141 |
*/
|
sl@0
|
142 |
virtual TInt GetOutputPorts(RPointerArray<MMdfOutputPort>& aComponentOutputPorts) = 0;
|
sl@0
|
143 |
|
sl@0
|
144 |
/**
|
sl@0
|
145 |
Synchronous method which sets the configuration for a Processing Unit.
|
sl@0
|
146 |
@param aConfigurationSetup
|
sl@0
|
147 |
The reference to the structure that contains the configuration data.
|
sl@0
|
148 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
149 |
another of the system-wide error codes.
|
sl@0
|
150 |
*/
|
sl@0
|
151 |
virtual TInt Configure(const TPuConfig& aConfigurationSetup) = 0;
|
sl@0
|
152 |
|
sl@0
|
153 |
/**
|
sl@0
|
154 |
Synchronous method which gets a configuration structure.
|
sl@0
|
155 |
@param aConfigurationSetup
|
sl@0
|
156 |
The reference to the structure that is to contain the configuration information.
|
sl@0
|
157 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
158 |
another of the system-wide error codes.
|
sl@0
|
159 |
*/
|
sl@0
|
160 |
virtual TInt GetConfig(TPuConfig& aConfigurationSetup) = 0;
|
sl@0
|
161 |
|
sl@0
|
162 |
|
sl@0
|
163 |
/**
|
sl@0
|
164 |
Asynchronous method which instructs the Processing Unit to start the initialization.
|
sl@0
|
165 |
@see MMdfProcessingUnitObserver::InitializeComplete()
|
sl@0
|
166 |
*/
|
sl@0
|
167 |
virtual void Initialize() = 0;
|
sl@0
|
168 |
|
sl@0
|
169 |
/**
|
sl@0
|
170 |
Asynchronous method which starts the execution for a Processing Unit.
|
sl@0
|
171 |
@see MMdfProcessingUnitObserver::ExecuteComplete()
|
sl@0
|
172 |
*/
|
sl@0
|
173 |
virtual void Execute () = 0;
|
sl@0
|
174 |
|
sl@0
|
175 |
/**
|
sl@0
|
176 |
Synchronous method which pauses the current on-going task.
|
sl@0
|
177 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
178 |
another of the system-wide error codes.
|
sl@0
|
179 |
*/
|
sl@0
|
180 |
virtual TInt Pause () = 0;
|
sl@0
|
181 |
|
sl@0
|
182 |
/**
|
sl@0
|
183 |
Synchronous method which stops the current on-going task.
|
sl@0
|
184 |
*/
|
sl@0
|
185 |
virtual void Stop () = 0;
|
sl@0
|
186 |
|
sl@0
|
187 |
/**
|
sl@0
|
188 |
Synchronous method which returns the current state of the Processing Unit.
|
sl@0
|
189 |
@return The current state of the Processing Unit.
|
sl@0
|
190 |
*/
|
sl@0
|
191 |
virtual TProcessingUnitState State() = 0;
|
sl@0
|
192 |
|
sl@0
|
193 |
/**
|
sl@0
|
194 |
Synchronous method which requests an extension feature.
|
sl@0
|
195 |
This is intended to provide additional features.
|
sl@0
|
196 |
@param aUid
|
sl@0
|
197 |
Used to indicate which interface is required.
|
sl@0
|
198 |
@return Standard error code. KErrNotSupported is used to indicate that the particular
|
sl@0
|
199 |
plugin is used.
|
sl@0
|
200 |
*/
|
sl@0
|
201 |
virtual TInt CreateCustomInterface(TUid aUid) = 0;
|
sl@0
|
202 |
|
sl@0
|
203 |
/**
|
sl@0
|
204 |
Synchronous method which returns a previously created extension.
|
sl@0
|
205 |
This returns a custom interface. This should only be used if CreateCustomInterface() has already
|
sl@0
|
206 |
been called for the same UID value. This means that any construction for that interface
|
sl@0
|
207 |
has already been called, and thus this call cannot fail.
|
sl@0
|
208 |
@param aUid
|
sl@0
|
209 |
Used to indicate which interface is required.
|
sl@0
|
210 |
@return The requested interface, or NULL if not known.
|
sl@0
|
211 |
@see CMdfProcessingUnit::CreateCustomInterface()
|
sl@0
|
212 |
*/
|
sl@0
|
213 |
virtual TAny* CustomInterface(TUid aUid) = 0;
|
sl@0
|
214 |
|
sl@0
|
215 |
/**
|
sl@0
|
216 |
Destructor.
|
sl@0
|
217 |
|
sl@0
|
218 |
The destructor is called by ECom framework allowing derived classes
|
sl@0
|
219 |
to clean up the implementation specific resources.
|
sl@0
|
220 |
*/
|
sl@0
|
221 |
inline virtual ~CMdfProcessingUnit();
|
sl@0
|
222 |
|
sl@0
|
223 |
private:
|
sl@0
|
224 |
TUid iDtor_ID_Key;
|
sl@0
|
225 |
};
|
sl@0
|
226 |
|
sl@0
|
227 |
#include <mdf/mdfprocessingunit.inl>
|
sl@0
|
228 |
|
sl@0
|
229 |
#endif // MDFPROCESSINGUNIT_H
|