usbmgmt/usbmgr/device/classcontroller/SRC/CUsbClassControllerIterator.cpp
branchRCL_3
changeset 15 f92a4f87e424
parent 0 c9bc50fca66e
child 16 012cc2ee6408
equal deleted inserted replaced
14:d3e8e7d462dd 15:f92a4f87e424
     1 /*
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    22 */
    22 */
    23 
    23 
    24 
    24 
    25 #include <cusbclasscontrolleriterator.h>
    25 #include <cusbclasscontrolleriterator.h>
    26 #include <usb/usblogger.h>
    26 #include <usb/usblogger.h>
       
    27 #include "OstTraceDefinitions.h"
       
    28 #ifdef OST_TRACE_COMPILER_IN_USE
       
    29 #include "CUsbClassControllerIteratorTraces.h"
       
    30 #endif
    27 
    31 
    28 #ifdef __FLOG_ACTIVE
    32 
    29 _LIT8(KLogComponent, "USBSVR");
       
    30 #endif
       
    31 
    33 
    32 // Panic category only used in debug builds
    34 // Panic category only used in debug builds
    33 #ifdef _DEBUG
    35 #ifdef _DEBUG
    34 _LIT( KUsbCcIteratorPanicCategory, "UsbCcIterator" );
    36 _LIT( KUsbCcIteratorPanicCategory, "UsbCcIterator" );
    35 #endif
    37 #endif
   128  *
   130  *
   129  * @return The current class the iterator refers to
   131  * @return The current class the iterator refers to
   130  */
   132  */
   131 EXPORT_C CUsbClassControllerBase* CUsbClassControllerIterator::Current()
   133 EXPORT_C CUsbClassControllerBase* CUsbClassControllerIterator::Current()
   132 	{
   134 	{
   133 	__ASSERT_DEBUG((iClassControllerIndex >= 0) &&
   135 #ifdef _DEBUG
   134 		(iClassControllerIndex < iClassControllerArray.Count()),
   136     if(!((iClassControllerIndex >= 0) && (iClassControllerIndex < iClassControllerArray.Count())))
   135 		_USB_PANIC(KUsbCcIteratorPanicCategory, EIndexOutOfRange));
   137         {
   136 
   138         OstTrace1( TRACE_FATAL, CUSBCLASSCONTROLLERITERATOR_CURRENT, "CUsbClassControllerIterator::Current;panic reason=%d", EIndexOutOfRange );
       
   139         User::Panic(KUsbCcIteratorPanicCategory, EIndexOutOfRange );
       
   140         }
       
   141 #endif
   137 	return iClassControllerArray[iClassControllerIndex];
   142 	return iClassControllerArray[iClassControllerIndex];
   138 	}
   143 	}
   139 
   144