connectivity/com.nokia.tcf/native/TCFNative/TCFServer/Registry.h
changeset 60 9d2210c8eed2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/connectivity/com.nokia.tcf/native/TCFNative/TCFServer/Registry.h	Mon Apr 06 15:18:48 2009 -0500
@@ -0,0 +1,61 @@
+/*
+* 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_)