diff -r 000000000000 -r 29b1cd4cb562 irda/irdastack/irtranp/COMMANDP.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/irda/irdastack/irtranp/COMMANDP.CPP Fri Jan 15 08:13:17 2010 +0200 @@ -0,0 +1,95 @@ +// Copyright (c) 1997-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: +// + +#include "debug.h" +#include +#include "COMMANDP.H" +#include "ABSTRACT.H" +#include "GLOBAL.H" + +CommandProcessor::CommandProcessor() + { + m_iCommands = 0; + m_iMaxCommands = 20; + for(TInt i=0;i= m_iMaxCommands) + { + m_iCommands = 0; // yeah, sorry. We do leak old stuff for now. + } + } + +/* +* Method description: Called from SCEP when the application "pumps" the module for incoming/outgoing data processing +* +*/ + +void CommandProcessor::DoCommand() + { + if(m_CommandQueue[0] != NULL) + { + SCEPPRINT(_L("CommandProcessor: DoCommand\n")); + m_CommandQueue[0]->DoIt(); // we always execute the first command in the queue! + + delete m_CommandQueue[0]; + m_CommandQueue[0] = NULL; // well, it gets a new value below .. but anyway + ShiftQueue(); + } + } + + /* + * Method description: Private method called to shift new commands to the beginning of the queue + * +*/ + +void CommandProcessor::ShiftQueue() + { + for(TInt i=1;i