Xalan-C++ API Reference  1.12.0
ExecutionContext.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(EXECUTIONCONTEXT_HEADER_GUARD_1357924680)
19 #define EXECUTIONCONTEXT_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
33 
34 
35 
36 namespace XERCES_CPP_NAMESPACE
37 {
38  class Locator;
39 }
40 
41 
42 
43 namespace XALAN_CPP_NAMESPACE {
44 
45 
46 
47 typedef xercesc::Locator LocatorType;
48 
49 
50 
51 class XalanDOMString;
52 class XalanNode;
53 class XalanText;
54 
55 
56 
57 //
58 // An abstract class which provides support for execution.
59 //
61 {
62 public:
63 
64  ExecutionContext(MemoryManager& theMemoryManager);
65 
66  virtual
68 
69 
70  // These interfaces are inherited from ProblemListenerBase
71  virtual void
72  problem(
73  eSource source,
74  eClassification classification,
75  const XalanDOMString& msg,
76  const Locator* locator,
77  const XalanNode* sourceNode) = 0;
78 
79  virtual void
80  problem(
81  eSource source,
82  eClassification classification,
83  const XalanDOMString& msg,
84  const XalanNode* sourceNode) = 0;
85 
86  bool
88  {
89  return m_hasPreserveOrStripConditions;
90  }
91 
92  /**
93  * Determine if a text node should be stripped from the source tree,
94  * as if it weren't there.
95  *
96  * @param textNode text node from the source tree
97  * @return true if the text node should be stripped
98  */
99  virtual bool
100  shouldStripSourceNode(const XalanText& node) = 0;
101 
102  MemoryManager&
104  {
105  return m_memoryManager;
106  }
107 
108  MemoryManager&
110  {
111  return XalanMemoryManager::getExceptionMemoryManager(m_memoryManager);
112  }
113 
114 protected:
115 
116  MemoryManager& m_memoryManager;
117 
119 };
120 
121 
122 
123 }
124 
125 
126 
127 #endif // EXECUTIONCONTEXT_HEADER_GUARD_1357924680
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanNode
Definition: XalanNode.hpp:38
xalanc::XalanText
Definition: XalanText.hpp:40
xalanc::ExecutionContext::m_memoryManager
MemoryManager & m_memoryManager
Definition: ExecutionContext.hpp:116
XALAN_PLATFORMSUPPORT_EXPORT
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:35
PlatformSupportDefinitions.hpp
xalanc::ExecutionContext::getMemoryManager
MemoryManager & getMemoryManager() const
Definition: ExecutionContext.hpp:103
xalanc::ProblemListenerBase::eSource
eSource
Definition: ProblemListenerBase.hpp:62
XalanMemoryManagement.hpp
xalanc::ExecutionContext
Definition: ExecutionContext.hpp:60
xalanc::ExecutionContext::getExceptionMemoryManager
MemoryManager & getExceptionMemoryManager() const
Definition: ExecutionContext.hpp:109
xalanc::ProblemListenerBase::eClassification
eClassification
Definition: ProblemListenerBase.hpp:75
xalanc::ExecutionContext::hasPreserveOrStripSpaceConditions
bool hasPreserveOrStripSpaceConditions() const
Definition: ExecutionContext.hpp:87
xalanc::ProblemListenerBase
This is the abstract class that is used when reporting a problem some kind, that requires a message,...
Definition: ProblemListenerBase.hpp:56
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::ExecutionContext::m_hasPreserveOrStripConditions
bool m_hasPreserveOrStripConditions
Definition: ExecutionContext.hpp:118
ProblemListenerBase.hpp
xalanc::LocatorType
xercesc::Locator LocatorType
Definition: ExecutionContext.hpp:47