williamr@2: /* williamr@2: * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: #ifndef __MCTTOKENINTERFACE_H__ williamr@2: #define __MCTTOKENINTERFACE_H__ williamr@2: williamr@2: class MCTToken; williamr@2: williamr@2: /** williamr@2: * The base class for all token interfaces. williamr@2: * williamr@2: * This class provides functionality to interact with the token's reference counting williamr@2: * framework. (Interfaces themselves are not reference counted, but the token williamr@2: * must remain open while it has open interfaces.) williamr@2: * williamr@2: * @since v7.0 williamr@2: */ williamr@2: class MCTTokenInterface williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Gets the associated token. williamr@2: * williamr@2: * @return The associated token. williamr@2: */ williamr@2: virtual MCTToken& Token() = 0; williamr@2: williamr@2: /** williamr@2: * Destroys the object. williamr@2: * williamr@2: * The interface should be destroyed via this method as the destructor is protected. williamr@2: * williamr@2: * Also takes care of reference counting the token. williamr@2: */ williamr@2: IMPORT_C void Release(); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * This function should release the interface and all its owned resources. williamr@2: * williamr@2: * It is called by Release(). The default implementation simply does a 'delete williamr@2: * this'. If other behaviour is required (for instance to implement a reference williamr@2: * counting system for the interfaces themselves, the interfaces can override williamr@2: * this function.) williamr@2: */ williamr@2: IMPORT_C virtual void DoRelease(); williamr@2: williamr@2: /** williamr@2: * The interface should be destroyed via the Release() williamr@2: * function. Hence, this destructor is protected. williamr@2: */ williamr@2: inline virtual ~MCTTokenInterface() = 0; williamr@2: }; williamr@2: williamr@2: /** Destructor */ williamr@2: inline MCTTokenInterface::~MCTTokenInterface() williamr@2: { williamr@2: } williamr@2: williamr@2: #endif // __MCTTOKENINTERFACE_H__