60
|
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 |
// Registry.h: interface for the CRegistry class.
|
|
18 |
//
|
|
19 |
// one of these per connection
|
|
20 |
//
|
|
21 |
//////////////////////////////////////////////////////////////////////
|
|
22 |
|
|
23 |
#if !defined(AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_)
|
|
24 |
#define AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_
|
|
25 |
|
|
26 |
#if _MSC_VER > 1000
|
|
27 |
#pragma once
|
|
28 |
#endif // _MSC_VER > 1000
|
|
29 |
|
|
30 |
#include "Client.h"
|
|
31 |
#include "mutex.h"
|
|
32 |
#include <vector>
|
|
33 |
|
|
34 |
#define REGISTRY_MUTEX_BASENAME "TCFRegistry"
|
|
35 |
#define REGISTRY_MUTEX_TIMEOUT (60000L)
|
|
36 |
|
|
37 |
typedef std::vector<CClient*> IdClientList;
|
|
38 |
|
|
39 |
#define MAX_MESSAGE_IDS (256)
|
|
40 |
typedef struct tagMessageIdRegistry
|
|
41 |
{
|
|
42 |
IdClientList* clist;
|
|
43 |
} *pMessageIdRegistry, MessageIdRegistry;
|
|
44 |
|
|
45 |
class CRegistry
|
|
46 |
{
|
|
47 |
public:
|
|
48 |
CRegistry();
|
|
49 |
CRegistry(DWORD connectionId);
|
|
50 |
virtual ~CRegistry();
|
|
51 |
|
|
52 |
virtual BOOL AddClient(CClient* newClient, long numberIds, BYTE* ids)=0;
|
|
53 |
virtual BOOL RemoveClient(CClient* client)=0;
|
|
54 |
virtual void DumpRegistry()=0;
|
|
55 |
virtual long RouteMessage(BYTE msgId, BYTE* fullMessage, DWORD fullLen, BYTE* realMessage, DWORD realMessageLen)=0;
|
|
56 |
|
|
57 |
MessageIdRegistry m_Registry[MAX_MESSAGE_IDS];
|
|
58 |
Mutex m_Mutex;
|
|
59 |
};
|
|
60 |
|
|
61 |
#endif // !defined(AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_)
|