os/security/cryptomgmtlibs/cryptotokenfw/inc/ct/MCTTokenInterface.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptomgmtlibs/cryptotokenfw/inc/ct/MCTTokenInterface.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,81 @@
     1.4 +/*
     1.5 +* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +/**
    1.23 + @file
    1.24 + @publishedAll
    1.25 + @released
    1.26 +*/
    1.27 +
    1.28 +#ifndef __MCTTOKENINTERFACE_H__
    1.29 +#define __MCTTOKENINTERFACE_H__
    1.30 +
    1.31 +class MCTToken;
    1.32 +
    1.33 +/** 
    1.34 + * The base class for all token interfaces.
    1.35 + *
    1.36 + * This class provides functionality to interact with the token's reference counting 
    1.37 + * framework. (Interfaces themselves are not reference counted, but the token 
    1.38 + * must remain open while it has open interfaces.) 
    1.39 + *
    1.40 + * @since v7.0 
    1.41 + */
    1.42 +class MCTTokenInterface
    1.43 +	{
    1.44 +public:
    1.45 +	/** 
    1.46 +	 * Gets the associated token.
    1.47 +	 * 
    1.48 +	 * @return The associated token. 
    1.49 +	 */
    1.50 +	virtual MCTToken& Token() = 0;
    1.51 +
    1.52 +	/** 
    1.53 +	 * Destroys the object.
    1.54 +	 *	
    1.55 +	 * The interface should be destroyed via this method as the destructor is protected.
    1.56 +	 *
    1.57 +	 * Also takes care of reference counting the token. 
    1.58 +	 */
    1.59 +	IMPORT_C void Release();
    1.60 +
    1.61 +protected:
    1.62 +	/** 
    1.63 +	 * This function should release the interface and all its owned resources.
    1.64 +	 *
    1.65 +	 * It is called by Release(). The default implementation simply does a 'delete 
    1.66 +	 * this'. If other behaviour is required (for instance to implement a reference 
    1.67 +	 * counting system for the interfaces themselves, the interfaces can override 
    1.68 +	 * this function.) 
    1.69 +	 */
    1.70 +	IMPORT_C virtual void DoRelease();
    1.71 +
    1.72 +	/** 
    1.73 +	 * The interface should be destroyed via the Release()
    1.74 +	 * function. Hence, this destructor is protected. 
    1.75 +	 */
    1.76 +	inline virtual ~MCTTokenInterface() = 0;
    1.77 +	};
    1.78 +
    1.79 +/** Destructor */
    1.80 +inline MCTTokenInterface::~MCTTokenInterface()
    1.81 +	{
    1.82 +	}
    1.83 +
    1.84 +#endif // __MCTTOKENINTERFACE_H__