connectivity/com.nokia.tcf/native/TCFNative/TCFServer/Registry.h
author fturovic <frank.turovich@nokia.com>
Mon, 29 Jun 2009 16:17:23 -0500
changeset 326 ab7c9b8bd24f
parent 60 9d2210c8eed2
permissions -rw-r--r--
bug 9343 fixed broken link
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     1
/*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     3
* All rights reserved.
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     4
* This component and the accompanying materials are made available
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     6
* which accompanies this distribution, and is available
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     8
*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     9
* Initial Contributors:
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    11
*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    12
* Contributors:
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    13
*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    14
* Description: 
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    15
*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    16
*/
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    17
// Registry.h: interface for the CRegistry class.
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    18
//
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    19
// one of these per connection
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    20
//
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    21
//////////////////////////////////////////////////////////////////////
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    22
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    23
#if !defined(AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_)
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    24
#define AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    25
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    26
#if _MSC_VER > 1000
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    27
#pragma once
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    28
#endif // _MSC_VER > 1000
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    29
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    30
#include "Client.h"
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    31
#include "mutex.h"
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    32
#include <vector>
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    33
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    34
#define REGISTRY_MUTEX_BASENAME		"TCFRegistry"
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    35
#define REGISTRY_MUTEX_TIMEOUT		(60000L)
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    36
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    37
typedef std::vector<CClient*> IdClientList;
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    38
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    39
#define MAX_MESSAGE_IDS	(256)
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    40
typedef struct tagMessageIdRegistry
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    41
{
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    42
	IdClientList* clist;
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    43
} *pMessageIdRegistry, MessageIdRegistry;
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    44
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    45
class CRegistry  
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    46
{
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    47
public:
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    48
	CRegistry();
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    49
	CRegistry(DWORD connectionId);
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    50
	virtual ~CRegistry();
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    51
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    52
	virtual BOOL AddClient(CClient* newClient, long numberIds, BYTE* ids)=0;
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    53
	virtual BOOL RemoveClient(CClient* client)=0;
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    54
	virtual void DumpRegistry()=0;
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    55
	virtual long RouteMessage(BYTE msgId, BYTE* fullMessage, DWORD fullLen, BYTE* realMessage, DWORD realMessageLen)=0;
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    56
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    57
	MessageIdRegistry m_Registry[MAX_MESSAGE_IDS];
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    58
	Mutex m_Mutex;
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    59
};
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    60
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    61
#endif // !defined(AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_)