Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XalanDOMStringCache.hpp
Go to the documentation of this file.
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 #if !defined(XALAN_DOMSTRINGCACHE_HEADER_GUARD)
19 #define XALAN_DOMSTRINGCACHE_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
33 
34 
35 
37 
38 
39 
40 XALAN_CPP_NAMESPACE_BEGIN
41 
42 
43 
45 {
46 public:
47 
48  enum { eDefaultMaximumSize = 100u };
49 
51 
52  explicit
54  MemoryManager& theManager,
55  XalanSize_t theMaximumSize = eDefaultMaximumSize);
56 
58 
59  XalanSize_t
61  {
62  return m_maximumSize;
63  }
64 
65  void
66  setMaximumSize(XalanSize_t theSize)
67  {
68  m_maximumSize = theSize;
69  }
70 
72  get();
73 
74  bool
75  release(XalanDOMString& theString);
76 
77  /*
78  * Clear all of the strings in the cache. This
79  * destroys all of the strings.
80  *
81  */
82  void
83  clear();
84 
85  /*
86  * Reset the cache so that all strings that are
87  * currently in use are available.
88  */
89  void
90  reset();
91 
93  {
94  public:
95 
97  m_cache(theCache),
98  m_string(&theCache.get())
99  {
100  }
101 
103  {
104  m_cache.release(*m_string);
105  }
106 
108  get() const
109  {
110  return *m_string;
111  }
112 
113  private:
114 
115  XalanDOMStringCache& m_cache;
116 
117  XalanDOMString* const m_string;
118  };
119 
120 private:
121 
122  // not implemented
124 
125  bool
126  operator==(const XalanDOMStringCache&) const;
127 
129  operator=(const XalanDOMStringCache&);
130 
131  /**
132  * A list to hold the strings that are available...
133  */
134  StringListType m_availableList;
135 
136  /**
137  * A list to hold the strings that are busy...
138  */
139  StringListType m_busyList;
140 
141  XalanSize_t m_maximumSize;
142 
144 };
145 
146 
147 
148 XALAN_CPP_NAMESPACE_END
149 
150 
151 
152 #endif // XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD
void setMaximumSize(XalanSize_t theSize)
XalanSize_t getMaximumSize() const
void clear(XalanDOMString &theString)
Remove all elements from target string.
XalanVector< XalanDOMString * > StringListType
GetAndRelease(XalanDOMStringCache &theCache)
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
#define XALAN_PLATFORMSUPPORT_EXPORT

Interpreting class diagrams

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

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

Apache Logo