epoc32/include/ct/mcttokeninterface.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2001-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 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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 /**
    20  @file
    21  @publishedAll
    22  @released
    23 */
    24 
    25 #ifndef __MCTTOKENINTERFACE_H__
    26 #define __MCTTOKENINTERFACE_H__
    27 
    28 class MCTToken;
    29 
    30 /** 
    31  * The base class for all token interfaces.
    32  *
    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.) 
    36  *
    37  * @since v7.0 
    38  */
    39 class MCTTokenInterface
    40 	{
    41 public:
    42 	/** 
    43 	 * Gets the associated token.
    44 	 * 
    45 	 * @return The associated token. 
    46 	 */
    47 	virtual MCTToken& Token() = 0;
    48 
    49 	/** 
    50 	 * Destroys the object.
    51 	 *	
    52 	 * The interface should be destroyed via this method as the destructor is protected.
    53 	 *
    54 	 * Also takes care of reference counting the token. 
    55 	 */
    56 	IMPORT_C void Release();
    57 
    58 protected:
    59 	/** 
    60 	 * This function should release the interface and all its owned resources.
    61 	 *
    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 
    65 	 * this function.) 
    66 	 */
    67 	IMPORT_C virtual void DoRelease();
    68 
    69 	/** 
    70 	 * The interface should be destroyed via the Release()
    71 	 * function. Hence, this destructor is protected. 
    72 	 */
    73 	inline virtual ~MCTTokenInterface() = 0;
    74 	};
    75 
    76 /** Destructor */
    77 inline MCTTokenInterface::~MCTTokenInterface()
    78 	{
    79 	}
    80 
    81 #endif // __MCTTOKENINTERFACE_H__