commsfwsupport/commselements/serverden/src/sd_objectbroker.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "sd_objectbroker.h"
       
    17 
       
    18 using namespace Messages;
       
    19 using namespace Den;
       
    20 
       
    21 #ifdef SYMBIAN_TRACE_ENABLE
       
    22 	_LIT8(KObjectBrokerTag, "ObjectBroker");
       
    23 #endif
       
    24 
       
    25 //-=========================================================
       
    26 //
       
    27 //Panics
       
    28 //
       
    29 //-=========================================================
       
    30 _LIT(KObjectBrokerPanic,"ObjectBroker");
       
    31 
       
    32 enum
       
    33 	{
       
    34 	EPanicFactoryContainerNotRegistered = 1
       
    35 	};
       
    36 
       
    37 //
       
    38 //CCommonObjectBroker
       
    39 EXPORT_C CCommonObjectBroker::~CCommonObjectBroker()
       
    40 	{
       
    41 	NM_LOG_NODE_DESTROY(KObjectBrokerTag, CCommonObjectBroker);
       
    42 	iClients.ResetAndDestroy();
       
    43 	}
       
    44 
       
    45 EXPORT_C CCommonObjectBroker::CCommonObjectBroker()
       
    46 	{
       
    47 	NM_LOG_NODE_CREATE(KObjectBrokerTag, CCommonObjectBroker);
       
    48 	}
       
    49 
       
    50 EXPORT_C void CCommonObjectBroker::ForwardMesasge(const TRuntimeCtxId& aSender, const TSignalBase& aMessage, const TClientType& aClientType)
       
    51 	{
       
    52 	this->PostToClients<TDefaultClientMatchPolicy>(aSender, aMessage, aClientType);
       
    53 
       
    54 	__ASSERT_ALWAYS(1 == PostToClients<TDefaultClientMatchPolicy>(aSender, aMessage, aClientType),
       
    55 		User::Panic(KObjectBrokerPanic, EPanicFactoryContainerNotRegistered));
       
    56 	}
       
    57 
       
    58 EXPORT_C void CCommonObjectBroker::UpdateWorkerInfo(CommsFW::TWorkerId aPlayerId,
       
    59 									 const TClientType& aClientType,
       
    60 									 const TNodeId& aFactoryId)
       
    61 	{
       
    62 
       
    63 	//TODO: This is never supposed to leave.
       
    64 	//This binding is happening during the boot sequence hence it is save to assume the
       
    65 	//allocation of RNodeInterface will succeed.
       
    66 	//What we need to do to make sure of that is to use preallocation.
       
    67 
       
    68 	//const TNodeId& aClientId, const TClientType& aClientType, TAny* aClientInfo = NULL
       
    69 	__ASSERT_ALWAYS_NO_LEAVE(AddClientL(aFactoryId, aClientType, &aPlayerId));
       
    70 	//return iFactoryContainerMap.Insert(aPlayerId, aFactoryId);
       
    71 	}
       
    72 
       
    73