1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the  "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 // Class header file.
20 #include "XalanSourceTreeAttributeNSAllocator.hpp"
21 
22 
23 
24 namespace XALAN_CPP_NAMESPACE {
25 
26 
27 
XalanSourceTreeAttributeNSAllocator(MemoryManager & theManager,size_type theBlockCount)28 XalanSourceTreeAttributeNSAllocator::XalanSourceTreeAttributeNSAllocator(MemoryManager&  theManager, size_type  theBlockCount) :
29     m_allocator(theManager, theBlockCount)
30 {
31 }
32 
33 
34 
~XalanSourceTreeAttributeNSAllocator()35 XalanSourceTreeAttributeNSAllocator::~XalanSourceTreeAttributeNSAllocator()
36 {
37 }
38 
39 
40 
41 XalanSourceTreeAttributeNSAllocator::ObjectType*
create(const XalanDOMString & theName,const XalanDOMString & theLocalName,const XalanDOMString & theNamespaceURI,const XalanDOMString & thePrefix,const XalanDOMString & theValue,XalanSourceTreeElement * theOwnerElement,IndexType theIndex)42 XalanSourceTreeAttributeNSAllocator::create(
43             const XalanDOMString&       theName,
44             const XalanDOMString&       theLocalName,
45             const XalanDOMString&       theNamespaceURI,
46             const XalanDOMString&       thePrefix,
47             const XalanDOMString&       theValue,
48             XalanSourceTreeElement*     theOwnerElement,
49             IndexType                   theIndex)
50 {
51     ObjectType* const   theBlock = m_allocator.allocateBlock();
52     assert(theBlock != 0);
53 
54     new(theBlock) ObjectType(
55                         theName,
56                         theLocalName,
57                         theNamespaceURI,
58                         thePrefix,
59                         theValue,
60                         theOwnerElement,
61                         theIndex);
62 
63     m_allocator.commitAllocation(theBlock);
64 
65     return theBlock;
66 }
67 
68 
69 
70 void
reset()71 XalanSourceTreeAttributeNSAllocator::reset()
72 {
73     m_allocator.reset();
74 }
75 
76 
77 
78 }
79