00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680) 00019 #define XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include <xalanc/XPath/XPathDefinitions.hpp> 00025 00026 00027 00028 #include <xalanc/XalanDOM/XalanDOMString.hpp> 00029 00030 00031 00032 #include "xalanc/PlatformSupport/ProblemListenerBase.hpp" 00033 00034 00035 00036 XALAN_DECLARE_XERCES_CLASS(Locator) 00037 00038 00039 00040 XALAN_CPP_NAMESPACE_BEGIN 00041 00042 00043 00044 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType; 00045 XALAN_USING_XERCES(Locator) 00046 00047 00048 00049 class XalanNode; 00050 00051 00052 00053 // 00054 // An abstract class which provides support for constructing the internal 00055 // representation of a stylesheet. 00056 // 00057 class XALAN_XPATH_EXPORT XPathConstructionContext : public ProblemListenerBase 00058 { 00059 public: 00060 00061 XPathConstructionContext(MemoryManager& theManager); 00062 00063 virtual 00064 ~XPathConstructionContext(); 00065 00066 00067 // These interfaces are inherited from ProblemListenerBase... 00068 virtual void 00069 problem( 00070 eSource source, 00071 eClassification classification, 00072 const XalanDOMString& msg, 00073 const Locator* locator, 00074 const XalanNode* sourceNode) = 0; 00075 00076 virtual void 00077 problem( 00078 eSource source, 00079 eClassification classification, 00080 const XalanDOMString& msg, 00081 const XalanNode* sourceNode) = 0; 00082 00083 00084 // These interfaces are new... 00085 /** 00086 * Reset the instance. Any existing objects 00087 * created by the instance will be destroyed. 00088 */ 00089 virtual void 00090 reset() = 0; 00091 00092 /** 00093 * Get a pooled string given the source string. If 00094 * the string already exists in the pool, no copy 00095 * will be made. If not, a copy will be made and 00096 * kept for later use. 00097 * 00098 * @param theString The source string 00099 * @return a const reference to a pooled string. 00100 */ 00101 virtual const XalanDOMString& 00102 getPooledString(const XalanDOMString& theString) = 0; 00103 00104 /** 00105 * Get a pooled string given the source character 00106 * array. If the string already exists in the pool, 00107 * no copy will be made. If not, a copy will be made 00108 * and kept for later use. 00109 * 00110 * @param theString The source character array 00111 * @param theLength The length of the character array 00112 * @return a const reference to a pooled string. 00113 */ 00114 virtual const XalanDOMString& 00115 getPooledString( 00116 const XalanDOMChar* theString, 00117 XalanDOMString::size_type theLength = XalanDOMString::npos) = 0; 00118 00119 /** 00120 * Get a cached string for temporary use. 00121 * 00122 * @return A reference to the string 00123 */ 00124 virtual XalanDOMString& 00125 getCachedString() = 0; 00126 00127 /** 00128 * Return a cached string. 00129 * 00130 * @param theString The string to release. 00131 * 00132 * @return true if the string was released successfully. 00133 */ 00134 virtual bool 00135 releaseCachedString(XalanDOMString& theString) = 0; 00136 00137 class GetCachedString 00138 { 00139 public: 00140 00141 GetCachedString(XPathConstructionContext& theConstructionContext) : 00142 m_constructionContext(&theConstructionContext), 00143 m_string(&theConstructionContext.getCachedString()) 00144 { 00145 } 00146 00147 ~GetCachedString() 00148 { 00149 assert(m_string != 0); 00150 00151 m_constructionContext->releaseCachedString(*m_string); 00152 } 00153 00154 XalanDOMString& 00155 get() const 00156 { 00157 assert(m_string != 0); 00158 00159 return *m_string; 00160 } 00161 00162 XPathConstructionContext& 00163 getConstructionContext() const 00164 { 00165 assert(m_constructionContext != 0); 00166 00167 return *m_constructionContext; 00168 } 00169 00170 private: 00171 00172 // Not implemented... 00173 GetCachedString(); 00174 00175 GetCachedString(const GetCachedString&); 00176 00177 GetCachedString& 00178 operator=(const GetCachedString&); 00179 00180 00181 // Data members... 00182 XPathConstructionContext* m_constructionContext; 00183 00184 XalanDOMString* m_string; 00185 }; 00186 00187 typedef GetCachedString GetAndReleaseCachedString; 00188 00189 MemoryManager& 00190 getMemoryManager() const 00191 { 00192 return m_memoryManager; 00193 } 00194 00195 MemoryManager& 00196 getMemoryManager() 00197 { 00198 return m_memoryManager; 00199 } 00200 00201 private: 00202 00203 MemoryManager& m_memoryManager; 00204 }; 00205 00206 00207 00208 XALAN_CPP_NAMESPACE_END 00209 00210 00211 00212 #endif // XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|