1 // Copyright (c) 1996 James Clark
2 // See the file copying.txt for copying permission.
4 #ifndef NumberCache_INCLUDED
5 #define NumberCache_INCLUDED 1
9 #include "NamedTable.h"
13 #ifdef DSSSL_NAMESPACE
14 namespace DSSSL_NAMESPACE {
20 // Return 0 if argument is not a node.
21 bool childNumber(const NodePtr &node, unsigned long &);
22 // Number of elements before or equal to node whose gi is equal to s.
23 unsigned long elementNumber(const NodePtr &node, const StringC &s);
24 // Number of elements before or equal to node whose gi is equal to s,
25 // and that are after the last element before node with gi reset.
26 unsigned long elementNumberAfter(const NodePtr &, const StringC &s,
27 const StringC &reset);
29 struct Entry : Named {
30 Entry(const StringC &);
34 // A separate cache for each level of the tree.
35 NCVector<NamedTable<Entry> > childNumbers_;
36 struct ElementEntry : Entry {
37 ElementEntry(const StringC &);
41 NamedTable<ElementEntry> elementNumbers_;
42 friend struct ElementEntry;
45 #ifdef DSSSL_NAMESPACE
49 #endif /* not NumberCache_INCLUDED */