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: MemoryManagerArrayImpl.hpp,v 1.2 2004/09/08 13:56:13 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 |
|
---|
22 | #if !defined(MEMORYMANAGERARRAYIMPL_HPP)
|
---|
23 | #define MEMORYMANAGERARRAYIMPL_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 specialized version of a Xerces
|
---|
33 | * memory manager, which allocates memory using
|
---|
34 | * using new[](size) syntax. Such memory may
|
---|
35 | * legally be deleted with delete[].
|
---|
36 | * </p>
|
---|
37 | * <p>This version is used in special cases where it is desired
|
---|
38 | * that allocated memory be able to be delete[]d.
|
---|
39 | * </p>
|
---|
40 | */
|
---|
41 |
|
---|
42 | class XMLUTIL_EXPORT MemoryManagerArrayImpl : public MemoryManager
|
---|
43 | {
|
---|
44 | public:
|
---|
45 |
|
---|
46 | /** @name Constructor */
|
---|
47 | //@{
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * Default constructor
|
---|
51 | */
|
---|
52 | MemoryManagerArrayImpl()
|
---|
53 | {
|
---|
54 | }
|
---|
55 | //@}
|
---|
56 |
|
---|
57 | /** @name Destructor */
|
---|
58 | //@{
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * Default destructor
|
---|
62 | */
|
---|
63 | virtual ~MemoryManagerArrayImpl()
|
---|
64 | {
|
---|
65 | }
|
---|
66 | //@}
|
---|
67 |
|
---|
68 | /** @name The virtual methods in MemoryManager */
|
---|
69 | //@{
|
---|
70 |
|
---|
71 | /**
|
---|
72 | * This method allocates requested memory.
|
---|
73 | *
|
---|
74 | * @param size The requested memory size
|
---|
75 | *
|
---|
76 | * @return A pointer to the allocated memory
|
---|
77 | */
|
---|
78 | virtual void* allocate(size_t size);
|
---|
79 |
|
---|
80 | /**
|
---|
81 | * This method deallocates memory
|
---|
82 | *
|
---|
83 | * @param p The pointer to the allocated memory to be deleted
|
---|
84 | */
|
---|
85 | virtual void deallocate(void* p);
|
---|
86 |
|
---|
87 | //@}
|
---|
88 |
|
---|
89 | private:
|
---|
90 | // -----------------------------------------------------------------------
|
---|
91 | // Unimplemented constructors and operators
|
---|
92 | // -----------------------------------------------------------------------
|
---|
93 | MemoryManagerArrayImpl(const MemoryManagerArrayImpl&);
|
---|
94 | MemoryManagerArrayImpl& operator=(const MemoryManagerArrayImpl&);
|
---|
95 |
|
---|
96 | };
|
---|
97 |
|
---|
98 | XERCES_CPP_NAMESPACE_END
|
---|
99 |
|
---|
100 | #endif
|
---|