00001 /* 00002 * Copyright 2003,2004 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 /* 00018 * $Id: MemoryManager.hpp 191054 2005-06-17 02:56:35Z jberry $ 00019 */ 00020 00021 00022 #if !defined(MEMORYMANAGER_HPP) 00023 #define MEMORYMANAGER_HPP 00024 00025 #include <xercesc/util/XercesDefs.hpp> 00026 #include <stdlib.h> 00027 00028 00029 XERCES_CPP_NAMESPACE_BEGIN 00030 00031 00038 class XMLPARSER_EXPORT MemoryManager 00039 { 00040 public: 00041 // ----------------------------------------------------------------------- 00042 // Constructors are hidden, only the virtual destructor is exposed 00043 // ----------------------------------------------------------------------- 00044 00047 00051 virtual ~MemoryManager() 00052 { 00053 } 00055 00056 00057 // ----------------------------------------------------------------------- 00058 // The virtual memory manager interface 00059 // ----------------------------------------------------------------------- 00062 00070 virtual void* allocate(size_t size) = 0; 00071 00077 virtual void deallocate(void* p) = 0; 00078 00080 00081 00082 protected : 00083 // ----------------------------------------------------------------------- 00084 // Hidden Constructors 00085 // ----------------------------------------------------------------------- 00088 00092 MemoryManager() 00093 { 00094 } 00096 00097 00098 00099 private: 00100 // ----------------------------------------------------------------------- 00101 // Unimplemented constructors and operators 00102 // ----------------------------------------------------------------------- 00103 MemoryManager(const MemoryManager&); 00104 MemoryManager& operator=(const MemoryManager&); 00105 }; 00106 00107 XERCES_CPP_NAMESPACE_END 00108 00109 #endif