author | mikaruus <mika.a.ruuskanen@nokia.com> |
Wed, 17 Feb 2010 13:58:55 +0200 | |
changeset 7 | fa67e03b87df |
parent 0 | 63b37f68c1ce |
child 9 | 8486d82aef45 |
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 |
|
25 |
#include "misichannelrouterif.h" // For MISIChannelRouterIf |
|
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 |
|
30 |
class MISIRouterChannelIf; |
|
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 |
*/ |
|
39 |
NONSHARABLE_CLASS( DISIRouter ) : public DBase, public MISIChannelRouterIf |
|
40 |
{ |
|
41 |
||
42 |
public: |
|
43 |
||
44 |
/* |
|
45 |
* Default contructor |
|
46 |
*/ |
|
47 |
DISIRouter(); |
|
48 |
||
49 |
/* |
|
50 |
* Destructor |
|
51 |
*/ |
|
52 |
~DISIRouter(); |
|
53 |
||
54 |
/* |
|
55 |
* See comments from MISILinkRouterIf |
|
56 |
*/ |
|
57 |
//void Receive( TDes8& aMessage ); |
|
58 |
||
59 |
//From CLTransceiver |
|
60 |
TBool Receive( TDes8& aMessage, const TUint8 aObjId ); |
|
61 |
||
62 |
/* |
|
63 |
* See comments from MISIChannelRouterIf |
|
64 |
*/ |
|
65 |
TInt Send( TDes8& aMessage, const TUint8 aObjId ); |
|
66 |
||
67 |
/* |
|
68 |
* See comments from MISIChannelRouterIf |
|
69 |
*/ |
|
70 |
void Disconnect( const TUint8 aObjId ); |
|
71 |
||
72 |
/* |
|
73 |
* See comments from MISIChannelRouterIf |
|
74 |
*/ |
|
75 |
TDfcQue* GetDfcThread( const TISIDfcQThreadType aType ); |
|
76 |
||
77 |
void FreeDfcThread( TDfcQue* aThread ); |
|
78 |
||
79 |
/* |
|
80 |
* See comments from MISIChannelRouterIf |
|
81 |
*/ |
|
82 |
void Connect( const TInt32 aUID, TUint8& aObjId, MISIRouterChannelIf* aCallback ); |
|
83 |
||
84 |
/* |
|
85 |
* Returns pointer to router it self, called only from MISIChannelRouterIf::GetIf |
|
86 |
* @return pointer to router. |
|
87 |
*/ |
|
88 |
static DISIRouter* GetRouter(){ return iSelfPtr; }; |
|
89 |
||
90 |
||
91 |
private: |
|
92 |
||
93 |
NONSHARABLE_CLASS( TISIClient ) |
|
94 |
{ |
|
95 |
public: |
|
96 |
||
97 |
TInt32 iUID; |
|
98 |
TUint8 iObjId; |
|
99 |
MISIRouterChannelIf* iChannel; |
|
100 |
}; |
|
101 |
//private: |
|
102 |
NONSHARABLE_CLASS( TStaticId ) |
|
103 |
{ |
|
104 |
public: |
|
105 |
||
106 |
TStaticId( const TInt32 aUID, TUint8 aObjId ){iUID = aUID; iObjId = aObjId;}; |
|
107 |
||
108 |
TInt32 iUID; |
|
109 |
TUint8 iObjId; |
|
110 |
}; |
|
111 |
||
112 |
private: |
|
113 |
||
114 |
/* |
|
115 |
* Handles initialization of this class. |
|
116 |
* Called in own thread context not supervisors |
|
117 |
*/ |
|
118 |
void Initialize(); |
|
119 |
||
120 |
void CheckUIDUniqueness( const TInt32 aUID ); |
|
121 |
||
122 |
TUint8 ReceiveStaticObjId( const TInt32 aUID ); |
|
123 |
||
124 |
TUint8 ReserveNewDynamicObjId(); |
|
125 |
||
126 |
static void InitializeDfc( TAny* aPtr ); |
|
127 |
||
128 |
||
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
129 |
public: |
0 | 130 |
// Written only once no need to synch. |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
131 |
static DISIRouter* iSelfPtr; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
132 |
MISIRouterObjectIf* iNameService; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
133 |
MISIRouterObjectIf* iCommunicationManager; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
134 |
|
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
135 |
private: |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
136 |
|
0 | 137 |
// Owned, synchronized internally with fastmutexes. |
138 |
RArray< TStaticId* > iStaticObjIdTable; |
|
139 |
// Owned, synchronized internally with fastmutexes. |
|
140 |
TISIClient* iClientTable[ KMaxAmountOfObjId ]; |
|
141 |
// Guards class shared array, owned |
|
142 |
NFastMutex* iClientTableFastMutex; |
|
143 |
// Owned |
|
144 |
TDfc* iInitializeDfc; |
|
145 |
TDfcQue* iInitThread; |
|
146 |
DISICLTransceiver* iCLTransceiver; |
|
147 |
DISIThreadContainer* iClientThreadContainer; |
|
148 |
||
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
149 |
|
0 | 150 |
}; |
151 |
||
152 |
#endif /* __ISIROUTER_H__ */ |
|
153 |