Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

CountersTable.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2004 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #if !defined(XALAN_COUNTERSTABLE_HEADER_GUARD_1357924680)
00017 #define XALAN_COUNTERSTABLE_HEADER_GUARD_1357924680
00018 
00026 // Base include file.  Must be first.
00027 #include <xalanc/XSLT/XSLTDefinitions.hpp>
00028 
00029 
00030 
00031 #include <vector>
00032 
00033 
00034 
00035 #include "xalanc/XPath/MutableNodeRefList.hpp"
00036 
00037 
00038 
00039 XALAN_CPP_NAMESPACE_BEGIN
00040 
00041 
00042 
00043 class ElemNumber;
00044 class StylesheetExecutionContext;
00045 
00046 
00047 
00055 struct Counter
00056 {
00057     typedef unsigned long   CountType;
00058 
00059 #if defined(XALAN_NO_STD_NAMESPACE)
00060     typedef vector<XalanNode*>          NodeVectorType;
00061 #else
00062     typedef std::vector<XalanNode*>     NodeVectorType;
00063 #endif
00064 
00065 
00072     CountType           m_countNodesStartCount;
00073 
00077     NodeVectorType      m_countNodes;
00078 
00084     const XalanNode*    m_fromNode;
00085 
00089     const ElemNumber*   m_numberElem;
00090 
00094     Counter(
00095             const ElemNumber*   numberElem,
00096             NodeVectorType&     countNodes) :
00097         m_countNodesStartCount(0),
00098         m_countNodes(countNodes),
00099         m_fromNode(0),
00100         m_numberElem(numberElem)
00101     {
00102     }
00103 
00107     Counter(const ElemNumber*   numberElem = 0) :
00108         m_countNodesStartCount(0),
00109         m_countNodes(),
00110         m_fromNode(0),
00111         m_numberElem(numberElem)
00112     {
00113     }
00114 
00121     CountType
00122     getPreviouslyCounted(
00123             StylesheetExecutionContext&     support,
00124             const XalanNode*                node) const;
00125 
00129     XalanNode*
00130     getLast() const
00131     {
00132         return m_countNodes.empty() == true ? 0 : m_countNodes.back();
00133     }
00134 };
00135 
00136 
00137 
00145 class CountersTable
00146 {
00147 public:
00148 
00149     typedef Counter::CountType  CountType;
00150 
00151 #if defined(XALAN_NO_STD_NAMESPACE)
00152     typedef vector<Counter>                 CounterVectorType;
00153     typedef vector<CounterVectorType>       ElemCounterVectorVectorType;
00154 #else
00155     typedef std::vector<Counter>            CounterVectorType;
00156     typedef std::vector<CounterVectorType>  ElemCounterVectorVectorType;
00157 #endif
00158 
00159     typedef Counter::NodeVectorType         NodeVectorType;
00160 
00164     CountersTable(unsigned long     theSize = 0) :
00165         m_countersVector(),
00166         m_newFound()
00167     {
00168         resize(theSize);
00169     };
00170 
00171 
00179     void
00180     resize(unsigned long    theSize)
00181     {
00182         m_countersVector.resize(theSize);
00183     }
00184 
00194     CountType
00195     countNode(
00196             StylesheetExecutionContext&     executionContext,
00197             const ElemNumber&               numberElem,
00198             XalanNode*                      node);
00199 
00203     void
00204     reset()
00205     {
00206         m_newFound.clear();
00207 
00208         m_countersVector.clear();
00209     }
00210 
00211 private:
00212 
00216     ElemCounterVectorVectorType     m_countersVector;
00217 
00218 
00222     NodeVectorType                  m_newFound;
00223 };
00224 
00225 
00226 
00227 XALAN_CPP_NAMESPACE_END
00228 
00229 
00230 
00231 #endif  // !defined(XALAN_COUNTERSTABLE_HEADER_GUARD_1357924680)

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.8
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.