author | mikaruus |
Tue, 19 Oct 2010 13:16:20 +0300 | |
changeset 9 | 8486d82aef45 |
parent 7 | fa67e03b87df |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* Copyright (c) 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 |
#ifndef __ISIROUTER_H__ |
|
21 |
#define __ISIROUTER_H__ |
|
22 |
||
23 |
||
24 |
#include "misilinkrouterif.h" // For MISILinkRouterIf |
|
9 | 25 |
#include "misiobjectrouterif.h" // For MISIObjectRouterIf |
0 | 26 |
#include "isiinternaldefs.h" // For KMaxAmountOfObjId |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
27 |
//#include "misiobjectrouterif.h" |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
28 |
|
0 | 29 |
|
9 | 30 |
class MISIRouterObjectIf; |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
31 |
class MISIRouterObjectIf; |
0 | 32 |
class MISIRouterLinkIf; |
33 |
class DISICLTransceiver; |
|
34 |
class DISIThreadContainer; |
|
35 |
||
36 |
/* |
|
37 |
* ISI router. |
|
38 |
*/ |
|
9 | 39 |
NONSHARABLE_CLASS( DISIRouter ) : public DBase, public MISIObjectRouterIf |
0 | 40 |
{ |
41 |
||
42 |
public: |
|
43 |
||
44 |
/* |
|
45 |
* Default contructor |
|
46 |
*/ |
|
47 |
DISIRouter(); |
|
48 |
||
49 |
/* |
|
50 |
* Destructor |
|
51 |
*/ |
|
52 |
~DISIRouter(); |
|
53 |
||
54 |
//From CLTransceiver |
|
55 |
TBool Receive( TDes8& aMessage, const TUint8 aObjId ); |
|
56 |
||
57 |
/* |
|
9 | 58 |
* See comments from MISIObjectRouterIf |
0 | 59 |
*/ |
60 |
TInt Send( TDes8& aMessage, const TUint8 aObjId ); |
|
61 |
||
62 |
/* |
|
9 | 63 |
* See comments from MISIObjectRouterIf |
0 | 64 |
*/ |
65 |
void Disconnect( const TUint8 aObjId ); |
|
66 |
||
67 |
/* |
|
9 | 68 |
* See comments from MISIObjectRouterIf |
0 | 69 |
*/ |
70 |
TDfcQue* GetDfcThread( const TISIDfcQThreadType aType ); |
|
71 |
||
72 |
void FreeDfcThread( TDfcQue* aThread ); |
|
73 |
||
74 |
/* |
|
9 | 75 |
* See comments from MISIObjectRouterIf |
0 | 76 |
*/ |
9 | 77 |
void Connect( const TInt32 aUID, TUint8& aObjId, MISIRouterObjectIf* aCallback ); |
0 | 78 |
|
79 |
/* |
|
9 | 80 |
* Returns pointer to router it self, called only from MISIObjectRouterIf::GetIf |
0 | 81 |
* @return pointer to router. |
82 |
*/ |
|
83 |
static DISIRouter* GetRouter(){ return iSelfPtr; }; |
|
9 | 84 |
|
0 | 85 |
private: |
86 |
||
87 |
NONSHARABLE_CLASS( TISIClient ) |
|
88 |
{ |
|
89 |
public: |
|
90 |
TInt32 iUID; |
|
91 |
TUint8 iObjId; |
|
9 | 92 |
MISIRouterObjectIf* iChannel; |
93 |
}; |
|
94 |
||
0 | 95 |
NONSHARABLE_CLASS( TStaticId ) |
96 |
{ |
|
97 |
public: |
|
98 |
TStaticId( const TInt32 aUID, TUint8 aObjId ){iUID = aUID; iObjId = aObjId;}; |
|
99 |
TInt32 iUID; |
|
100 |
TUint8 iObjId; |
|
101 |
}; |
|
9 | 102 |
|
0 | 103 |
private: |
104 |
||
105 |
/* |
|
106 |
* Handles initialization of this class. |
|
107 |
* Called in own thread context not supervisors |
|
108 |
*/ |
|
109 |
void Initialize(); |
|
9 | 110 |
|
111 |
TBool CheckUIDUniqueness( const TInt32 aUID ); |
|
112 |
||
113 |
TUint8 ReserveStaticObjId( const TInt32 aUID ); |
|
114 |
||
0 | 115 |
TUint8 ReserveNewDynamicObjId(); |
9 | 116 |
|
0 | 117 |
static void InitializeDfc( TAny* aPtr ); |
9 | 118 |
|
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
119 |
public: |
9 | 120 |
|
0 | 121 |
// Written only once no need to synch. |
9 | 122 |
static DISIRouter* iSelfPtr; |
123 |
||
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
124 |
|
9 | 125 |
DISICLTransceiver* GetDISICLTransceiver(){ return iShCLTransceiver;}; |
126 |
||
127 |
private: |
|
128 |
||
0 | 129 |
// Owned, synchronized internally with fastmutexes. |
130 |
RArray< TStaticId* > iStaticObjIdTable; |
|
131 |
// Owned, synchronized internally with fastmutexes. |
|
9 | 132 |
TISIClient* iClientTable[ KMaxAmountOfObjId ];// switch this to objects |
0 | 133 |
// Guards class shared array, owned |
134 |
NFastMutex* iClientTableFastMutex; |
|
9 | 135 |
// Owned, executed only from one thread. |
0 | 136 |
TDfc* iInitializeDfc; |
9 | 137 |
// Owned, executed only from one thread. |
0 | 138 |
TDfcQue* iInitThread; |
9 | 139 |
// Owned, synch done inside the class. |
140 |
DISICLTransceiver* iShCLTransceiver; |
|
141 |
// Owned, synch done inside the class. |
|
142 |
DISIThreadContainer* iShClientThreadContainer; |
|
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
143 |
|
0 | 144 |
}; |
145 |
||
146 |
#endif /* __ISIROUTER_H__ */ |
|
147 |