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.
25 #ifndef __MCTTOKENINTERFACE_H__
26 #define __MCTTOKENINTERFACE_H__
31 * The base class for all token interfaces.
33 * This class provides functionality to interact with the token's reference counting
34 * framework. (Interfaces themselves are not reference counted, but the token
35 * must remain open while it has open interfaces.)
39 class MCTTokenInterface
43 * Gets the associated token.
45 * @return The associated token.
47 virtual MCTToken& Token() = 0;
50 * Destroys the object.
52 * The interface should be destroyed via this method as the destructor is protected.
54 * Also takes care of reference counting the token.
56 IMPORT_C void Release();
60 * This function should release the interface and all its owned resources.
62 * It is called by Release(). The default implementation simply does a 'delete
63 * this'. If other behaviour is required (for instance to implement a reference
64 * counting system for the interfaces themselves, the interfaces can override
67 IMPORT_C virtual void DoRelease();
70 * The interface should be destroyed via the Release()
71 * function. Hence, this destructor is protected.
73 inline virtual ~MCTTokenInterface() = 0;
77 inline MCTTokenInterface::~MCTTokenInterface()
81 #endif // __MCTTOKENINTERFACE_H__