[358] | 1 | /*
|
---|
| 2 | * Copyright 2003,2004 The Apache Software Foundation.
|
---|
| 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 express or implied.
|
---|
| 13 | * See the License for the specific language governing permissions and
|
---|
| 14 | * limitations under the License.
|
---|
| 15 | */
|
---|
| 16 |
|
---|
| 17 | /*
|
---|
| 18 | * $Id: MemoryManagerImpl.hpp,v 1.2 2004/09/08 13:56:13 peiyongz Exp $
|
---|
| 19 | */
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | #if !defined(MEMORYMANAGERIMPL_HPP)
|
---|
| 23 | #define MEMORYMANAGERIMPL_HPP
|
---|
| 24 |
|
---|
| 25 | #include <xercesc/framework/MemoryManager.hpp>
|
---|
| 26 |
|
---|
| 27 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
| 28 |
|
---|
| 29 | /**
|
---|
| 30 | * Configurable memory manager
|
---|
| 31 | *
|
---|
| 32 | * <p>This is Xerces default implementation of the memory
|
---|
| 33 | * manager interface, which will be instantiated and used
|
---|
| 34 | * in the absence of an application's memory manager.
|
---|
| 35 | * </p>
|
---|
| 36 | */
|
---|
| 37 |
|
---|
| 38 | class XMLUTIL_EXPORT MemoryManagerImpl : public MemoryManager
|
---|
| 39 | {
|
---|
| 40 | public:
|
---|
| 41 |
|
---|
| 42 | /** @name Constructor */
|
---|
| 43 | //@{
|
---|
| 44 |
|
---|
| 45 | /**
|
---|
| 46 | * Default constructor
|
---|
| 47 | */
|
---|
| 48 | MemoryManagerImpl()
|
---|
| 49 | {
|
---|
| 50 | }
|
---|
| 51 | //@}
|
---|
| 52 |
|
---|
| 53 | /** @name Destructor */
|
---|
| 54 | //@{
|
---|
| 55 |
|
---|
| 56 | /**
|
---|
| 57 | * Default destructor
|
---|
| 58 | */
|
---|
| 59 | virtual ~MemoryManagerImpl()
|
---|
| 60 | {
|
---|
| 61 | }
|
---|
| 62 | //@}
|
---|
| 63 |
|
---|
| 64 | /** @name The virtual methods in MemoryManager */
|
---|
| 65 | //@{
|
---|
| 66 |
|
---|
| 67 | /**
|
---|
| 68 | * This method allocates requested memory.
|
---|
| 69 | *
|
---|
| 70 | * @param size The requested memory size
|
---|
| 71 | *
|
---|
| 72 | * @return A pointer to the allocated memory
|
---|
| 73 | */
|
---|
| 74 | virtual void* allocate(size_t size);
|
---|
| 75 |
|
---|
| 76 | /**
|
---|
| 77 | * This method deallocates memory
|
---|
| 78 | *
|
---|
| 79 | * @param p The pointer to the allocated memory to be deleted
|
---|
| 80 | */
|
---|
| 81 | virtual void deallocate(void* p);
|
---|
| 82 |
|
---|
| 83 | //@}
|
---|
| 84 |
|
---|
| 85 | private:
|
---|
| 86 | // -----------------------------------------------------------------------
|
---|
| 87 | // Unimplemented constructors and operators
|
---|
| 88 | // -----------------------------------------------------------------------
|
---|
| 89 | MemoryManagerImpl(const MemoryManagerImpl&);
|
---|
| 90 | MemoryManagerImpl& operator=(const MemoryManagerImpl&);
|
---|
| 91 |
|
---|
| 92 | };
|
---|
| 93 |
|
---|
| 94 | XERCES_CPP_NAMESPACE_END
|
---|
| 95 |
|
---|
| 96 | #endif
|
---|