Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanAllocator.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-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 #if !defined(XALANALLOCATOR_INCLUDE_GUARD_1357924680)
18 #define XALANALLOCATOR_INCLUDE_GUARD_1357924680
19 
20 
21 
22 #include <cstddef>
23 
24 
25 
26 XALAN_CPP_NAMESPACE_BEGIN
27 
28 
29 
30 template <class Type>
32 {
33 public:
34  typedef size_t size_type;
35  typedef ptrdiff_t difference_type;
36  typedef Type* pointer;
37  typedef const Type* const_pointer;
38  typedef Type& reference;
39  typedef const Type& const_reference;
40  typedef Type value_type;
41 
42 
44  m_memoryManager(theManager)
45  {
46  }
47 
48 
50  {
51  }
52 
55  {
56  return m_memoryManager;
57  }
58 
59  pointer
60  address(reference x) const
61  {
62  return &x;
63  }
64 
67  {
68  return &x;
69  }
70 
71  pointer
73  size_type size,
74  const void* /* hint */ = 0)
75  {
76  return (pointer)m_memoryManager.allocate(size * sizeof(Type));
77  }
78 
79  void
81  pointer p,
82  size_type /* n */)
83  {
84  if( p == 0 )
85  {
86  return;
87  }
88 
89  m_memoryManager.deallocate(p);
90  }
91 
92  size_type
93  max_size() const
94  {
95  return ~0;
96  }
97 
98  void
100  pointer p,
101  const Type& val)
102  {
103  new (p) Type(val);
104  }
105 
106  void
108  {
109  p->Type::~Type();
110  }
111 
112 private:
114 
116  operator=(const XalanAllocator<Type>&);
117 
118  MemoryManagerType& m_memoryManager;
119 };
120 
121 
122 
123 XALAN_CPP_NAMESPACE_END
124 
125 
126 
127 #endif // XALANALLOCATOR_INCLUDE_GUARD_1357924680

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo