sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: #ifndef ISBASEOF_H sl@0: #define ISBASEOF_H sl@0: sl@0: sl@0: // Provisional implementation of a construct that allows to determine sl@0: // at compile time whether a class type is derived from another class sl@0: // type sl@0: sl@0: // To be redefined using std::tr1:is_base_of when a TR1 implementation sl@0: // becomes available for use with Symbian OS. sl@0: sl@0: sl@0: // Implementation construct - do not use sl@0: template sl@0: class TIsBaseOf sl@0: { sl@0: private: sl@0: typedef TUint8 TIsDerived; sl@0: sl@0: class TIsNotDerived sl@0: { sl@0: TUint8 iPadding[2]; sl@0: }; sl@0: sl@0: sl@0: static TIsDerived ReturnType(B*); sl@0: static TIsNotDerived ReturnType(...); sl@0: sl@0: public: sl@0: sl@0: enum sl@0: { sl@0: EValue = sizeof(ReturnType(static_cast(0))) == sizeof(TIsDerived) ? 1 : 0 sl@0: }; sl@0: }; sl@0: sl@0: sl@0: #define IS_BASE_OF(BaseType, DerivedType) TIsBaseOf::EValue sl@0: sl@0: sl@0: #endif //! ISBASEOF_H sl@0: