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(XALAN_TraceListener_HEADER_GUARD) 00019 #define XALAN_TraceListener_HEADER_GUARD 00020 00021 // Base include file. Must be first. 00022 #include "XSLTDefinitions.hpp" 00023 00024 00025 00026 XALAN_CPP_NAMESPACE_BEGIN 00027 00028 00029 00030 class TracerEvent; 00031 class SelectionEvent; 00032 class GenerateEvent; 00033 00034 00035 00036 class XALAN_XSLT_EXPORT TraceListener 00037 { 00038 public: 00039 00040 TraceListener(); 00041 00042 virtual 00043 ~TraceListener(); 00044 00045 /** 00046 * Method that is called when a trace event occurs. The method is blocking. 00047 * It must return before processing continues. 00048 * 00049 * @param ev trace event 00050 */ 00051 virtual void 00052 trace(const TracerEvent& ev) = 0; 00053 00054 /** 00055 * Method that is called just after the formatter listener is called. 00056 * 00057 * @param ev generate event 00058 */ 00059 virtual void 00060 selected(const SelectionEvent& ev) = 0; 00061 00062 /** 00063 * Method that is called just after the formatter listener is called. 00064 * 00065 * @param ev generate event 00066 */ 00067 virtual void 00068 generated(const GenerateEvent& ev) = 0; 00069 00070 struct TraceListenerTraceFunctor 00071 { 00072 TraceListenerTraceFunctor(const TracerEvent& theEvent) : 00073 m_event(theEvent) 00074 { 00075 } 00076 00077 void 00078 operator()(TraceListener* theListener) const 00079 { 00080 theListener->trace(m_event); 00081 } 00082 00083 const TracerEvent& m_event; 00084 }; 00085 00086 struct TraceListenerSelectFunctor 00087 { 00088 TraceListenerSelectFunctor(const SelectionEvent& theEvent) : 00089 m_event(theEvent) 00090 { 00091 } 00092 00093 void 00094 operator()(TraceListener* theListener) const 00095 { 00096 theListener->selected(m_event); 00097 } 00098 00099 const SelectionEvent& m_event; 00100 }; 00101 00102 struct TraceListenerGenerateFunctor 00103 { 00104 TraceListenerGenerateFunctor(const GenerateEvent& theEvent) : 00105 m_event(theEvent) 00106 { 00107 } 00108 00109 void 00110 operator()(TraceListener* theListener) const 00111 { 00112 theListener->generated(m_event); 00113 } 00114 00115 const GenerateEvent& m_event; 00116 }; 00117 00118 }; 00119 00120 00121 00122 XALAN_CPP_NAMESPACE_END 00123 00124 00125 00126 #endif //XALAN_TraceListener_HEADER_GUARD
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|