1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 // -*- c++ -*- 19 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 21 // O S C L _ H E A P B A S E 22 23 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 25 /*! \addtogroup osclerror OSCL Error 26 * 27 * @{ 28 */ 29 30 31 /** \file oscl_heapbase.h 32 \brief OSCL Heap Base include file 33 */ 34 #ifndef OSCL_HEAPBASE_H_INCLUDED 35 #define OSCL_HEAPBASE_H_INCLUDED 36 37 #ifndef OSCLCONFIG_ERROR_H_INCLUDED 38 #include "osclconfig_error.h" 39 #endif 40 41 #ifndef OSCL_BASE_H_INCLUDED 42 #include "oscl_base.h" 43 #endif 44 45 /** 46 //_OsclHeapBase is used as the base for cleanup stack 47 //items with virtual destructor. 48 */ 49 50 51 class _OsclHeapBase 52 { 53 public: ~_OsclHeapBase()54 virtual ~_OsclHeapBase() {} 55 56 protected: _OsclHeapBase()57 _OsclHeapBase() {} _OsclHeapBase(const _OsclHeapBase &)58 _OsclHeapBase(const _OsclHeapBase&) {} 59 private: 60 _OsclHeapBase& operator=(const _OsclHeapBase&); 61 friend class PVCleanupStack; 62 }; 63 64 /** 65 //OsclTrapItem may be used in the cleanup stack when 66 //a custom cleanup operation is needed. 67 */ 68 69 typedef void (*OsclTrapOperation)(OsclAny*); 70 71 class OsclTrapItem 72 { 73 public: 74 OSCL_INLINE OsclTrapItem(OsclTrapOperation anOperation); 75 OSCL_INLINE OsclTrapItem(OsclTrapOperation anOperation, OsclAny* aPtr); 76 private: 77 OsclTrapOperation iOperation; 78 OsclAny* iPtr; 79 friend class OsclTrapStackItem; 80 friend class OsclTrapStack; 81 }; 82 83 84 85 #if !(OSCL_DISABLE_INLINES) 86 #include "oscl_heapbase.inl" 87 #endif 88 89 #endif // 90 91 92 /*! @} */ 93