equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Template class for CMsvSession*& |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef MCETEMPLATE_H |
|
23 #define MCETEMPLATE_H |
|
24 |
|
25 class CMsvSession; |
|
26 |
|
27 |
|
28 template<class T> |
|
29 class TPointer |
|
30 { |
|
31 public: |
|
32 TPointer( T*& aObj ); |
|
33 TPointer& operator=( const TPointer& aObj ); |
|
34 T*& operator->() const; |
|
35 T& operator*() const; |
|
36 |
|
37 private: |
|
38 T*& iObj; |
|
39 }; |
|
40 |
|
41 //typedef to make things easier |
|
42 |
|
43 typedef TPointer<CMsvSession> CMsvSessionPtr; |
|
44 |
|
45 |
|
46 template<class T> |
|
47 TPointer<T>::TPointer( T*& aObj ) : iObj( aObj ) |
|
48 { |
|
49 } |
|
50 |
|
51 template<class T> |
|
52 T*& TPointer<T>::operator->() const |
|
53 { |
|
54 return iObj; |
|
55 } |
|
56 |
|
57 template<class T> |
|
58 T& TPointer<T>::operator*() const |
|
59 { |
|
60 return *iObj; |
|
61 } |
|
62 |
|
63 #endif |
|
64 |
|
65 // End of file |