diff -r 000000000000 -r ba25891c3a9e secureswitools/swisistools/source/sisxlibrary/actualcounterbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/secureswitools/swisistools/source/sisxlibrary/actualcounterbase.h Thu Dec 17 08:51:10 2009 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Note: This file may contain code to generate corrupt files for test purposes. +* Such code is excluded from production builds by use of compiler defines; +* it is recommended that such code should be removed if this code is ever published publicly. +* used for smart pointers. See CElement. +* +*/ + + +/** + @file + @internalComponent + @released +*/ + +#ifndef __ACTUALCOUNTERBASE_H__ +#define __ACTUALCOUNTERBASE_H__ + + +#include + +#include "counterbase.h" + + + + +template class CActualCounterBase: public CCounterBase + { +private: + P iPtr; // copy constructor must not throw + + CActualCounterBase (CActualCounterBase const&); + CActualCounterBase & operator= (CActualCounterBase const&); + typedef CActualCounterBase

this_type; + +public: + CActualCounterBase (P p); + virtual void Dispose (); + void* operator new (size_t); + void operator delete (void* ap); + }; + + + + +template inline + CActualCounterBase

::CActualCounterBase (P p) : + iPtr (p) + { + } + +template void CActualCounterBase

::Dispose () + { + delete iPtr; + } + +template void* CActualCounterBase

::operator new (size_t) + { + return std::allocator ().allocate (1, static_cast (0)); + } + +template void CActualCounterBase

::operator delete (void* ap) + { + std::allocator ().deallocate (static_cast (ap), 1); + } + +#endif // __ACTUALCOUNTERBASE_H__