Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanDOMStringCache.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 #if !defined(XALAN_DOMSTRINGCACHE_HEADER_GUARD)
17 #define XALAN_DOMSTRINGCACHE_HEADER_GUARD
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
31 
32 
33 
35 
36 
37 
38 XALAN_CPP_NAMESPACE_BEGIN
39 
40 
41 
43 {
44 public:
45 
46  enum { eDefaultMaximumSize = 100 };
47 
49 
50  explicit
52  unsigned int theMaximumSize = eDefaultMaximumSize);
53 
55 
56  unsigned int
58  {
59  return m_maximumSize;
60  }
61 
62  void
63  setMaximumSize(unsigned int theSize)
64  {
65  m_maximumSize = theSize;
66  }
67 
69  get();
70 
71  bool
72  release(XalanDOMString& theString);
73 
74  /*
75  * Clear all of the strings in the cache. This
76  * destroys all of the strings.
77  *
78  */
79  void
80  clear();
81 
82  /*
83  * Reset the cache so that all strings that are
84  * currently in use are available.
85  */
86  void
87  reset();
88 
90  {
91  public:
92 
94  m_cache(theCache),
95  m_string(&theCache.get())
96  {
97  }
98 
100  {
101  m_cache.release(*m_string);
102  }
103 
105  get() const
106  {
107  return *m_string;
108  }
109 
110  private:
111 
112  XalanDOMStringCache& m_cache;
113 
114  XalanDOMString* const m_string;
115  };
116 
117 private:
118 
119  // not implemented
121 
122  bool
123  operator==(const XalanDOMStringCache&) const;
124 
126  operator=(const XalanDOMStringCache&);
127 
131  StringListType m_availableList;
132 
136  StringListType m_busyList;
137 
138  unsigned int m_maximumSize;
139 
141 };
142 
143 
144 
145 XALAN_CPP_NAMESPACE_END
146 
147 
148 
149 #endif // XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1111
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
~GetAndRelease()
Definition: XalanDOMStringCache.hpp:99
void setMaximumSize(unsigned int theSize)
Definition: XalanDOMStringCache.hpp:63
void clear(XalanDOMString &theString)
Remove all elements from target string.
Definition: DOMStringHelper.hpp:2291
XalanVector< XalanDOMString * > StringListType
Definition: XalanDOMStringCache.hpp:48
Definition: XalanDOMStringCache.hpp:89
Definition: XalanDOMStringCache.hpp:42
Definition: XalanDOMStringReusableAllocator.hpp:39
GetAndRelease(XalanDOMStringCache &theCache)
Definition: XalanDOMStringCache.hpp:93
unsigned int getMaximumSize() const
Definition: XalanDOMStringCache.hpp:57
Definition: XalanDOMString.hpp:42
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:33

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