First public contribution.
2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #include "ct/logger.h"
23 // As it's easier for the implementer to initialise the ref
24 // count to 0 than 1, reference count values are 1 less than you
25 // might expect. The object should be deleted when the count reaches -1
26 EXPORT_C void MCTToken::Release()
30 LOG2(_L("MCTToken::Release: token released, ref count == %d: %-32S"), ReferenceCount(), &Label());
33 if (ReferenceCount() < 0)
35 MCTTokenType& tokenType = TokenType();
37 // FROM THIS POINT ON, THE OBJECT MAY BE DELETED
44 EXPORT_C void MCTToken::DoRelease()
46 LOG1(_L("MCTToken::DoRelease: destroying token: %-32S"), &Label());
54 // Dummy removal notification for use on non-removable tokens
55 EXPORT_C void MCTToken::NotifyOnRemoval(TRequestStatus& /*aStatus*/)
59 EXPORT_C void MCTToken::CancelNotify()
63 // Base implementation of GetInterface. This just does the reference counting
64 EXPORT_C void MCTToken::GetInterface(TUid aRequiredInterface,
65 MCTTokenInterface*& aReturnedInterface,
66 TRequestStatus& aStatus)
69 LOG2(_L("MCTToken::GetInterface: getting interface, ref count == %d: %-32S"), ReferenceCount(), &Label());
72 DoGetInterface(aRequiredInterface, aReturnedInterface, aStatus);
77 /** Cancel a GetInterface operation */
78 EXPORT_C void MCTToken::CancelGetInterface()
80 if (DoCancelGetInterface())
86 void MCTToken::ObjectCreated()
89 LOG2(_L("MCTToken::ObjectCreated: token object created, ref count == %d: %-32S"), ReferenceCount(), &Label());