33
|
1 |
/*
|
|
2 |
* Copyright (c) 2003 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: This file contains the header file of the CCbsScheduler class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CCBSSCHEDULER_H
|
|
20 |
#define CCBSSCHEDULER_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
|
|
25 |
// FORWARD DECLARATIONS
|
|
26 |
class CCbsServer;
|
|
27 |
|
|
28 |
// CLASS DECLARATION
|
|
29 |
|
|
30 |
/**
|
|
31 |
* CbsServer includes a scheduler of it's own to simplify
|
|
32 |
* client request handling code. All active object leaves are
|
|
33 |
* handled in function Error(). The behaviour of Error()
|
|
34 |
* depends on whether there is an outstanding client request
|
|
35 |
* or not: it will tell the client the reason for inability
|
|
36 |
* to handle the client request. It will also panic the
|
|
37 |
* client if the descriptor passed to the server was malformed.
|
|
38 |
* Finally, a panic is raised if the error does not originate
|
|
39 |
* from the server itself.
|
|
40 |
*
|
|
41 |
* See Tasker: Professional Symbian Programming, Chapter 20
|
|
42 |
* for details.
|
|
43 |
*/
|
|
44 |
class CCbsScheduler : public CActiveScheduler
|
|
45 |
{
|
|
46 |
public: // new
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Default constructor
|
|
50 |
*/
|
|
51 |
CCbsScheduler();
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Gives a pointer of the current CCbsServer instance
|
|
55 |
* to the scheduler.
|
|
56 |
*
|
|
57 |
* @param aServer The current server pointer
|
|
58 |
*/
|
|
59 |
void SetServer( CCbsServer* aServer );
|
|
60 |
|
|
61 |
public: // from CActiveScheduler
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Overridden to handle leaves in request functions and
|
|
65 |
* unexpected situations.
|
|
66 |
*
|
|
67 |
* @param aError Error code,
|
|
68 |
* see Symbian OS system documentation.
|
|
69 |
*/
|
|
70 |
void Error( TInt aError ) const;
|
|
71 |
|
|
72 |
private: // prohibited operators and functions
|
|
73 |
|
|
74 |
// Copy constructor
|
|
75 |
CCbsScheduler( const CCbsScheduler& );
|
|
76 |
|
|
77 |
// Assignment operator
|
|
78 |
CCbsScheduler& operator=( const CCbsScheduler& );
|
|
79 |
|
|
80 |
private: // data
|
|
81 |
|
|
82 |
// Ref: server instance
|
|
83 |
CCbsServer* iServer;
|
|
84 |
};
|
|
85 |
|
|
86 |
#endif // CCBSSCHEDULER_H
|
|
87 |
|
|
88 |
// End of File
|
|
89 |
|
|
90 |
|