usbmgmt/usbmgr/usbman/server/SRC/CUsbScheduler.cpp
changeset 0 c9bc50fca66e
child 15 f92a4f87e424
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 /**
       
    19  @file
       
    20 */
       
    21 
       
    22 #include <usb/usblogger.h>
       
    23 #include "CUsbScheduler.h"
       
    24 #include "CUsbServer.h"
       
    25 
       
    26 #ifdef __FLOG_ACTIVE
       
    27 _LIT8(KLogComponent, "USBSVR");
       
    28 #endif
       
    29 
       
    30 /**
       
    31  * The CUsbScheduler::NewL method
       
    32  *
       
    33  * Creates a new Active scheduler
       
    34  *
       
    35  * @internalComponent
       
    36  */
       
    37 CUsbScheduler* CUsbScheduler::NewL()
       
    38 	{
       
    39 	LOG_STATIC_FUNC_ENTRY
       
    40 
       
    41 	CUsbScheduler* self = new(ELeave) CUsbScheduler;
       
    42 	return self;
       
    43 	}
       
    44 
       
    45 /**
       
    46  * The CUsbScheduler::~CUsbScheduler method
       
    47  *
       
    48  * Destructor
       
    49  *
       
    50  * @internalComponent
       
    51  */
       
    52 CUsbScheduler::~CUsbScheduler()
       
    53 	{
       
    54 	// Note that though we store a pointer to the server,
       
    55 	// we do not own it (it is owned by the cleanup stack)
       
    56 	// and our pointer is only used to error the server
       
    57 	// if we have been given a reference to it.
       
    58 	}
       
    59 
       
    60 /**
       
    61  * The CUsbScheduler::SetServer method
       
    62  *
       
    63  * Give us a reference to the server
       
    64  *
       
    65  * @internalComponent
       
    66  * @param	aServer	A reference to the server
       
    67  */
       
    68 void CUsbScheduler::SetServer(CUsbServer& aServer)
       
    69 	{
       
    70 	iServer = &aServer;	
       
    71 	}
       
    72 
       
    73 /**
       
    74  * The CUsbScheduler::Error method
       
    75  *
       
    76  * Inform the server that an error has occurred
       
    77  *
       
    78  * @internalComponent
       
    79  * @param	aError	Error that has occurred
       
    80  */
       
    81 void CUsbScheduler::Error(TInt aError) const
       
    82 	{
       
    83 	LOGTEXT2(_L8("CUsbScheduler::Error aError=%d"), aError);
       
    84 
       
    85 	if (iServer)
       
    86 		{
       
    87 		iServer->Error(aError);
       
    88 		}
       
    89 	}
       
    90