connectivity/com.nokia.tcf/native/TCFNative/TCFServer/Registry.h
author stechong
Wed, 20 Oct 2010 11:19:31 -0500
changeset 2165 2a7b5eccb0bc
parent 60 9d2210c8eed2
permissions -rw-r--r--
Keeping PlatSim internal only.

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/
// Registry.h: interface for the CRegistry class.
//
// one of these per connection
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_)
#define AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Client.h"
#include "mutex.h"
#include <vector>

#define REGISTRY_MUTEX_BASENAME		"TCFRegistry"
#define REGISTRY_MUTEX_TIMEOUT		(60000L)

typedef std::vector<CClient*> IdClientList;

#define MAX_MESSAGE_IDS	(256)
typedef struct tagMessageIdRegistry
{
	IdClientList* clist;
} *pMessageIdRegistry, MessageIdRegistry;

class CRegistry  
{
public:
	CRegistry();
	CRegistry(DWORD connectionId);
	virtual ~CRegistry();

	virtual BOOL AddClient(CClient* newClient, long numberIds, BYTE* ids)=0;
	virtual BOOL RemoveClient(CClient* client)=0;
	virtual void DumpRegistry()=0;
	virtual long RouteMessage(BYTE msgId, BYTE* fullMessage, DWORD fullLen, BYTE* realMessage, DWORD realMessageLen)=0;

	MessageIdRegistry m_Registry[MAX_MESSAGE_IDS];
	Mutex m_Mutex;
};

#endif // !defined(AFX_REGISTRY_H__BB7103A0_5492_472D_86B4_C9BF4C25CD20__INCLUDED_)