Xalan-C++ API Reference  1.12.0
XResultTreeFrag.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(XRESULTTREEFRAG_HEADER_GUARD_1357924680)
19 #define XRESULTTREEFRAG_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base header file. Must be first.
25 
26 
27 
29 
30 
31 
32 // Base class header file.
34 #include <xalanc/XPath/XObject.hpp>
35 
36 
37 
39 
40 
41 
42 namespace XALAN_CPP_NAMESPACE {
43 
44 
45 
46 class ResultTreeFrag;
47 
48 
49 
51 {
52 public:
53 
55 
56 
57  /**
58  * Construct an XResultTreeFrag object from a result tree fragment
59  *
60  * @param value The source result tree fragment.
61  * @param theManager The MemoryManager for this instance.
62  */
64  XalanDocumentFragment& value,
65  MemoryManager& theManager);
66 
67  /**
68  * Construct an XResultTreeFrag object from another
69  *
70  * @param source source XResultTreeFrag
71  * @param theManager The MemoryManager for this instance.
72  */
74  const XResultTreeFrag& source,
75  MemoryManager& theManager);
76 
77  virtual
78  ~XResultTreeFrag();
79 
80  MemoryManager&
82  {
83  return m_cachedStringValue.getMemoryManager();
84  }
85 
86  void
88  {
89  m_executionContext = theExecutionContext;
90  }
91 
92  // These methods are inherited from XObject ...
93 
94  virtual const XalanDOMString&
95  getTypeString() const;
96 
97  virtual double
98  num(XPathExecutionContext& executionContext) const;
99 
100  virtual double
101  num() const;
102 
103  virtual bool
104  boolean(XPathExecutionContext& executionContext) const;
105 
106  virtual const XalanDOMString&
107  str(XPathExecutionContext& executionContext) const;
108 
109  virtual const XalanDOMString&
110  str() const;
111 
112  virtual void
113  str(
114  XPathExecutionContext& executionContext,
115  FormatterListener& formatterListener,
116  MemberFunctionPtr function) const;
117 
118  virtual void
119  str(
120  FormatterListener& formatterListener,
121  MemberFunctionPtr function) const;
122 
123  virtual void
124  str(
125  XPathExecutionContext& executionContext,
126  XalanDOMString& theBuffer) const;
127 
128  virtual void
129  str(XalanDOMString& theBuffer) const;
130 
131  virtual double
132  stringLength(XPathExecutionContext& executionContext) const;
133 
134  virtual const XalanDocumentFragment&
135  rtree() const;
136 
137  virtual void
138  ProcessXObjectTypeCallback(XObjectTypeCallback& theCallbackObject);
139 
140  virtual void
141  ProcessXObjectTypeCallback(XObjectTypeCallback& theCallbackObject) const;
142 
143  /**
144  * Release the ResultTreeFrag held by the instance.
145  */
147  release();
148 
149  /**
150  * Change the value of an XResultTreeFrag
151  *
152  * @param theValue The new value.
153  */
154  void
155  set(XalanDocumentFragment& theValue);
156 
157 protected:
158 
159  virtual void
160  dereferenced();
161 
162 private:
163  //not implemented
164  XResultTreeFrag();
166 
167  // Data members...
168  XalanDocumentFragment* m_value;
169 
170  const XalanDOMString* m_singleTextChildValue;
171 
172  StylesheetExecutionContext* m_executionContext;
173 
174  mutable XalanDOMString m_cachedStringValue;
175 
176  mutable double m_cachedNumberValue;
177 };
178 
179 
180 
181 }
182 
183 
184 
185 #endif // XRESULTTREEFRAG_HEADER_GUARD_1357924680
xalanc::XResultTreeFrag
Definition: XResultTreeFrag.hpp:50
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::StylesheetExecutionContext
Definition: StylesheetExecutionContext.hpp:106
XalanDOMString.hpp
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
xalanc::XResultTreeFrag::setExecutionContext
void setExecutionContext(StylesheetExecutionContext *theExecutionContext)
Definition: XResultTreeFrag.hpp:87
xalanc::XResultTreeFrag::getMemoryManager
MemoryManager & getMemoryManager() const
Definition: XResultTreeFrag.hpp:81
xalanc::XResultTreeFrag::ParentType
XObject ParentType
Definition: XResultTreeFrag.hpp:54
xalanc::XObjectTypeCallback
The purpose of this class is to provide a way to get the "preferred" or closest matching type for XOb...
Definition: XObjectTypeCallback.hpp:54
xalanc::XObject
Class to hold XPath return types.
Definition: XObject.hpp:63
NodeRefListBase.hpp
XSLTDefinitions.hpp
xalanc::FormatterListener
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:56
xalanc::XPathExecutionContext
Definition: XPathExecutionContext.hpp:82
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
StylesheetExecutionContext.hpp
xalanc::XalanDocumentFragment
Definition: XalanDocumentFragment.hpp:32
XObject.hpp