Xalan-C++ API Reference  1.12.0
XObjectTypeCallback.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(XOBJECT_TYPE_CALLBACK_HEADER_GUARD_1357924680)
19 #define XOBJECT_TYPE_CALLBACK_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base header file. Must be first.
25 
26 
27 
28 // $$$ ToDo: This is necessarh while XalanDOMString is a typedef...
30 
31 
32 
33 
34 namespace XALAN_CPP_NAMESPACE {
35 
36 
37 
38 class MutableNodeRefList;
39 class NodeRefListBase;
40 class XalanDocumentFragment;
41 class XObject;
42 class XPathExecutionContext;
43 
44 
45 
46 /**
47  * The purpose of this class is to provide a way to get the "preferred" or
48  * closest matching type for XObject-derived classes. The idea is to pass a
49  * reference to an instance of this class to an XObject instance. It will
50  * then call back to the member function that most closely matches its type.
51  * This makes it possible to get preferred typing information without doing
52  * RTTI or other such type introspections.
53  */
55 {
56 public:
57 
58  XObjectTypeCallback(XPathExecutionContext& theExecutionContext);
59 
60  virtual
62 
63  /**
64  * Call back the XObject with a numeric value.
65  *
66  * @param theXObject
67  * @param theValue
68  */
69  virtual void
70  Number(const XObject& theXObject,
71  double theValue) = 0;
72 
73  /**
74  * Call back the XObject with a boolean value.
75  *
76  * @param theXObject
77  * @param theValue
78  */
79  virtual void
80  Boolean(const XObject& theXObject,
81  bool theValue) = 0;
82 
83  /**
84  * Call back the XObject with a string value.
85  *
86  * @param theXObject
87  * @param theValue
88  */
89  virtual void
90  String(const XObject& theXObject,
91  const XalanDOMString& theValue) = 0;
92 
93  /**
94  * Call back the XObject with a result tree fragment value.
95  *
96  * @param theXObject
97  * @param theValue
98  */
99  virtual void
100  ResultTreeFragment(const XObject& theXObject,
101  const XalanDocumentFragment& theValue) = 0;
102 
103  /**
104  * Call back the XObject with a result tree fragment value.
105  *
106  * @param theXObject
107  * @param theValue
108  */
109  virtual void
110  ResultTreeFragment(const XObject& theXObject,
111  XalanDocumentFragment& theValue) = 0;
112 
113  /**
114  * Call back the XObject with a node set value.
115  *
116  * @param theXObject
117  * @param theValue
118  */
119  virtual void
120  NodeSet(const XObject& theXObject,
121  const NodeRefListBase& theValue) = 0;
122 
123  /**
124  * Call back the XObject with an unknown value.
125  *
126  * @param theXObject
127  * @param theValue
128  */
129  virtual void
130  Unknown(const XObject& theObject,
131  const XalanDOMString& theName) = 0;
132 
133  /**
134  * Call back the XObject with a null value.
135  *
136  * @param theXObject
137  * @param theValue
138  */
139  virtual void
140  Null(const XObject& theObject) = 0;
141 
144  {
145  return m_executionContext;
146  }
147 
148  /*
149  MemoryManager&
150  getMemoryManager()
151  {
152  return m_memoryManager;
153  }
154  */
155 
156 private:
157 
158  XPathExecutionContext& m_executionContext;
159 };
160 
161 
162 
163 }
164 
165 
166 
167 #endif // XOBJECT_TYPE_CALLBACK_HEADER_GUARD_1357924680
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XObjectTypeCallback::getExecutionContext
XPathExecutionContext & getExecutionContext()
Definition: XObjectTypeCallback.hpp:143
XalanDOMString.hpp
XALAN_XPATH_EXPORT
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:35
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
xalanc::XPathExecutionContext
Definition: XPathExecutionContext.hpp:82
xalanc::NodeRefListBase
Local implementation of NodeRefList.
Definition: NodeRefListBase.hpp:44
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::XalanDocumentFragment
Definition: XalanDocumentFragment.hpp:32
XPathDefinitions.hpp