Xalan-C++ API Reference  1.12.0
Public Types | Public Member Functions | Public Attributes | List of all members
xalanc::Counter Struct Reference

<meta name="usage" content="internal"> A class that does incremental counting for support of xsl:number. More...

#include <xalanc/XSLT/CountersTable.hpp>

Collaboration diagram for xalanc::Counter:
[legend]

Public Types

typedef XalanSize_t CountType
 
typedef XalanVector< XalanNode * > NodeVectorType
 

Public Member Functions

 Counter (MemoryManager &theManager, const ElemNumber *numberElem, NodeVectorType &countNodes)
 Construct a counter object. More...
 
 Counter (MemoryManager &theManager, const ElemNumber *numberElem=0)
 Construct a counter object. More...
 
 Counter (const Counter &other, MemoryManager &theManager)
 
CountType getPreviouslyCounted (StylesheetExecutionContext &support, const XalanNode *node) const
 Try to find a node that was previously counted. More...
 
XalanNodegetLast () 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 XalanNodem_fromNode
 The node from where the counting starts. More...
 
const ElemNumberm_numberElem
 The owning xsl:number element. More...
 

Detailed Description

<meta name="usage" content="internal"> 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

Definition at line 53 of file CountersTable.hpp.

Member Typedef Documentation

◆ CountType

typedef XalanSize_t xalanc::Counter::CountType

Definition at line 55 of file CountersTable.hpp.

◆ NodeVectorType

Definition at line 57 of file CountersTable.hpp.

Constructor & Destructor Documentation

◆ Counter() [1/3]

xalanc::Counter::Counter ( MemoryManager &  theManager,
const ElemNumber numberElem,
NodeVectorType countNodes 
)
inline

Construct a counter object.

Definition at line 87 of file CountersTable.hpp.

◆ Counter() [2/3]

xalanc::Counter::Counter ( MemoryManager &  theManager,
const ElemNumber numberElem = 0 
)
inline

Construct a counter object.

Definition at line 101 of file CountersTable.hpp.

◆ Counter() [3/3]

xalanc::Counter::Counter ( const Counter other,
MemoryManager &  theManager 
)
inline

Definition at line 109 of file CountersTable.hpp.

Member Function Documentation

◆ getLast()

XalanNode* xalanc::Counter::getLast ( ) const
inline

◆ getPreviouslyCounted()

CountType xalanc::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
nodeThe node to be counted.
Returns
The count of the node, or 0 if not found.

Member Data Documentation

◆ m_countNodes

NodeVectorType xalanc::Counter::m_countNodes

A vector of all nodes counted so far.

Definition at line 70 of file CountersTable.hpp.

◆ m_countNodesStartCount

CountType xalanc::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.

Definition at line 65 of file CountersTable.hpp.

◆ m_fromNode

const XalanNode* xalanc::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.

Definition at line 77 of file CountersTable.hpp.

◆ m_numberElem

const ElemNumber* xalanc::Counter::m_numberElem

The owning xsl:number element.

Definition at line 82 of file CountersTable.hpp.


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