telephonyprotocols/rawipnif/src/RawIPFlowFactory.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Mar 2010 09:55:57 +0200
changeset 19 1f776524b15c
parent 0 3553901f7fa8
child 24 6638e7f4bd8f
child 42 3adadc800673
permissions -rw-r--r--
Revision: 201011 Kit: 201011

// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "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:
// Implements the factory class which is used to instantiate the RAW IP NIF.
// 
//

/**
 @file
*/

#include "RawIPFlowFactory.h"
#include "RawIPFlow.h"
#include "bttlog.h"

using namespace ESock;

// =====================================================================================
//
// RawIP Flow Factory
//

CRawIPFlowFactory* CRawIPFlowFactory::NewL(TAny* aConstructionParameters)
/**
Constructs a Default SubConnection Flow Factory

@param aConstructionParameters construction data passed by ECOM

@returns pointer to a constructed factory
*/
	{
	CRawIPFlowFactory* ptr = new (ELeave) CRawIPFlowFactory(TUid::Uid(KRawIpFlowImplUid), *(reinterpret_cast<CSubConnectionFlowFactoryContainer*>(aConstructionParameters)));
	return ptr;
	}


CRawIPFlowFactory::CRawIPFlowFactory(TUid aFactoryId, CSubConnectionFlowFactoryContainer& aParentContainer)
	: CSubConnectionFlowFactoryBase(aFactoryId, aParentContainer)
/**
Default SubConnection Flow Factory Constructor

@param aFactoryId ECOM Implementation Id
@param aParentContainer Object Owner
*/
	{
	}


CSubConnectionFlowBase* CRawIPFlowFactory::DoCreateFlowL(ESock::CProtocolIntfBase* aProtocol, ESock::TFactoryQueryBase& aQuery)
	{
#ifdef __BTT_LOGGING__
	iTheLogger = CBttLogger::NewL(KNifSubDir, KRefFile, User::FastCounter());
#endif // __BTT_LOGGING__

	_LOG_L1C1(_L8("Raw IP logging started."));
	
	const TDefaultFlowFactoryQuery& query = static_cast<const TDefaultFlowFactoryQuery&>(aQuery);
 	CRawIPFlow* s = new (ELeave) CRawIPFlow(*this, query.iSCprId, aProtocol, iTheLogger);
	CleanupStack::PushL(s);
	s->ConstructL();
	CleanupStack::Pop(s);

	return s;
	}