Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XPathConstructionContext.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(XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680)
19 #define XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
33 
34 
35 
36 XALAN_DECLARE_XERCES_CLASS(Locator)
37 
38 
39 
40 XALAN_CPP_NAMESPACE_BEGIN
41 
42 
43 
44 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType;
45 XALAN_USING_XERCES(Locator)
46 
47 
48 
49 class XalanNode;
50 
51 
52 
53 //
54 // An abstract class which provides support for constructing the internal
55 // representation of a stylesheet.
56 //
58 {
59 public:
60 
61  XPathConstructionContext(MemoryManager& theManager);
62 
63  virtual
65 
66 
67  // These interfaces are inherited from ProblemListenerBase...
68  virtual void
69  problem(
70  eSource source,
71  eClassification classification,
72  const XalanDOMString& msg,
73  const Locator* locator,
74  const XalanNode* sourceNode) = 0;
75 
76  virtual void
77  problem(
78  eSource source,
79  eClassification classification,
80  const XalanDOMString& msg,
81  const XalanNode* sourceNode) = 0;
82 
83 
84  // These interfaces are new...
85  /**
86  * Reset the instance. Any existing objects
87  * created by the instance will be destroyed.
88  */
89  virtual void
90  reset() = 0;
91 
92  /**
93  * Get a pooled string given the source string. If
94  * the string already exists in the pool, no copy
95  * will be made. If not, a copy will be made and
96  * kept for later use.
97  *
98  * @param theString The source string
99  * @return a const reference to a pooled string.
100  */
101  virtual const XalanDOMString&
102  getPooledString(const XalanDOMString& theString) = 0;
103 
104  /**
105  * Get a pooled string given the source character
106  * array. If the string already exists in the pool,
107  * no copy will be made. If not, a copy will be made
108  * and kept for later use.
109  *
110  * @param theString The source character array
111  * @param theLength The length of the character array
112  * @return a const reference to a pooled string.
113  */
114  virtual const XalanDOMString&
115  getPooledString(
116  const XalanDOMChar* theString,
118 
119  /**
120  * Get a cached string for temporary use.
121  *
122  * @return A reference to the string
123  */
124  virtual XalanDOMString&
125  getCachedString() = 0;
126 
127  /**
128  * Return a cached string.
129  *
130  * @param theString The string to release.
131  *
132  * @return true if the string was released successfully.
133  */
134  virtual bool
135  releaseCachedString(XalanDOMString& theString) = 0;
136 
138  {
139  public:
140 
141  GetCachedString(XPathConstructionContext& theConstructionContext) :
142  m_constructionContext(&theConstructionContext),
143  m_string(&theConstructionContext.getCachedString())
144  {
145  }
146 
148  {
149  assert(m_string != 0);
150 
151  m_constructionContext->releaseCachedString(*m_string);
152  }
153 
155  get() const
156  {
157  assert(m_string != 0);
158 
159  return *m_string;
160  }
161 
164  {
165  assert(m_constructionContext != 0);
166 
167  return *m_constructionContext;
168  }
169 
170  private:
171 
172  // Not implemented...
173  GetCachedString();
174 
176 
178  operator=(const GetCachedString&);
179 
180 
181  // Data members...
182  XPathConstructionContext* m_constructionContext;
183 
184  XalanDOMString* m_string;
185  };
186 
188 
189  MemoryManager&
191  {
192  return m_memoryManager;
193  }
194 
195  MemoryManager&
197  {
198  return m_memoryManager;
199  }
200 
201 private:
202 
203  MemoryManager& m_memoryManager;
204 };
205 
206 
207 
208 XALAN_CPP_NAMESPACE_END
209 
210 
211 
212 #endif // XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
XPathConstructionContext & getConstructionContext() const
XalanSize_t size_type
virtual void problem(eSource source, eClassification classification, const XalanDOMString &msg, const Locator *locator, const XalanNode *sourceNode)=0
Function that is called when a problem event occurs.
This is the abstract class that is used when reporting a problem some kind, that requires a message...
MemoryManager & getMemoryManager() const
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)
#define XALAN_XPATH_EXPORT
GetCachedString(XPathConstructionContext &theConstructionContext)

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