## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.5

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# Counter Struct Reference

A class that does incremental counting for support of xsl:number. More...

`#include <CountersTable.hpp>`

Collaboration diagram for Counter:

[legend]
List of all members.

## Public Types

- typedef unsigned long CountType
- typedef std::vector<XalanNode*> NodeVectorType

## Public Methods

- Counter (const ElemNumber *numberElem, NodeVectorType &countNodes)
    Construct a counter object. More...
- Counter (const ElemNumber *numberElem=0)
    Construct a counter object. More...
- CountType getPreviouslyCounted (StylesheetExecutionContext &support, const XalanNode *node) const
    Try to find a node that was previously counted. More...
- XalanNode* getLast () const
    Get the last node in the list. More...

## Public Attributes

- CountType m_countNodesStartCount
    The start count from where m_countNodes counts from. More...
- NodeVectorType m_countNodes
    A vector of all nodes counted so far. More...
- const XalanNode* m_fromNode
    The node from where the counting starts. More...
- const ElemNumber* m_numberElem
    The owning xsl:number element. More...

## Detailed Description

A class that does incremental counting for support of xsl:number.

This class stores a cache of counted nodes (m_countNodes). It tries to cache the counted nodes in document order... the node count is based on its position in the cache list

## Member Typedef Documentation

typedef unsigned long Counter::CountType

typedef std::vector< XalanNode *> Counter::NodeVectorType<XalanNode*>

## Constructor & Destructor Documentation

Counter::Counter ( | const ElemNumber * numberElem,
| NodeVectorType & countNodes )

| Construct a counter object.

Counter::Counter ( | const ElemNumber * numberElem = 0 )

| Construct a counter object.

## Member Function Documentation

XalanNode * Counter::getLast ( | ) const

| Get the last node in the list.

CountType Counter::getPreviouslyCounted ( | StylesheetExecutionContext & support,
| const XalanNode * node ) const

  | Try to find a node that was previously counted. If found, return a positive integer that corresponds to the count. Parameters:
  node | The node to be counted.
Returns: The count of the node, or 0 if not found.

## Member Data Documentation

NodeVectorType Counter::m_countNodes

| A vector of all nodes counted so far.

CountType Counter::m_countNodesStartCount

| The start count from where m_countNodes counts from. In other words, the count of a given node in the m_countNodes vector is node position + m_countNodesStartCount.

const XalanNode * Counter::m_fromNode

| The node from where the counting starts. This is needed to find a counter if the node being counted is not immediatly found in the m_countNodes vector.

const ElemNumber * Counter::m_numberElem

| The owning xsl:number element.

The documentation for this struct was generated from the following file:

- CountersTable.hpp

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.5 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.