|
1 /* |
|
2 * Copyright (c) 2001-2009 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 the License "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @publishedAll |
|
24 @released |
|
25 */ |
|
26 |
|
27 #ifndef __MCTTOKENINTERFACE_H__ |
|
28 #define __MCTTOKENINTERFACE_H__ |
|
29 |
|
30 class MCTToken; |
|
31 |
|
32 /** |
|
33 * The base class for all token interfaces. |
|
34 * |
|
35 * This class provides functionality to interact with the token's reference counting |
|
36 * framework. (Interfaces themselves are not reference counted, but the token |
|
37 * must remain open while it has open interfaces.) |
|
38 * |
|
39 * @publishedPartner |
|
40 * @released |
|
41 * @since v7.0 |
|
42 */ |
|
43 class MCTTokenInterface |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Gets the associated token. |
|
48 * |
|
49 * @return The associated token. |
|
50 */ |
|
51 virtual MCTToken& Token() = 0; |
|
52 |
|
53 /** |
|
54 * Destroys the object. |
|
55 * |
|
56 * The interface should be destroyed via this method as the destructor is protected. |
|
57 * |
|
58 * Also takes care of reference counting the token. |
|
59 */ |
|
60 IMPORT_C void Release(); |
|
61 |
|
62 protected: |
|
63 /** |
|
64 * This function should release the interface and all its owned resources. |
|
65 * |
|
66 * It is called by Release(). The default implementation simply does a 'delete |
|
67 * this'. If other behaviour is required (for instance to implement a reference |
|
68 * counting system for the interfaces themselves, the interfaces can override |
|
69 * this function.) |
|
70 */ |
|
71 IMPORT_C virtual void DoRelease(); |
|
72 |
|
73 /** |
|
74 * The interface should be destroyed via the Release() |
|
75 * function. Hence, this destructor is protected. |
|
76 */ |
|
77 inline virtual ~MCTTokenInterface() = 0; |
|
78 }; |
|
79 |
|
80 /** Destructor */ |
|
81 inline MCTTokenInterface::~MCTTokenInterface() |
|
82 { |
|
83 } |
|
84 |
|
85 #endif // __MCTTOKENINTERFACE_H__ |