Qt 4.8
Public Functions | Properties | List of all members
QPatternist::AccelTree::BasicNodeData Class Reference

Houses data for a node, and that all node kinds have. More...

#include <qacceltree_p.h>

Public Functions

 BasicNodeData ()
 
 BasicNodeData (const PreNumber aDepth, const PreNumber aParent, const QXmlNodeModelIndex::NodeKind k, const PreNumber s, const QXmlName n=QXmlName())
 
Depth depth () const
 
bool isCompressed () const
 
QXmlNodeModelIndex::NodeKind kind () const
 
QXmlName name () const
 
PreNumber parent () const
 
void setSize (const PreNumber aSize)
 
PreNumber size () const
 

Properties

Depth m_depth
 
QXmlNodeModelIndex::NodeKind m_kind: 8
 
QXmlName m_name
 
PreNumber m_parent
 
PreNumber m_size
 

Detailed Description

Houses data for a node, and that all node kinds have.

BasicNodeData is internal to the Accel tree implementation, and is only used by those classes.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 121 of file qacceltree_p.h.

Constructors and Destructors

◆ BasicNodeData() [1/2]

QPatternist::AccelTree::BasicNodeData::BasicNodeData ( )
inline

Definition at line 125 of file qacceltree_p.h.

126  {
127  }

◆ BasicNodeData() [2/2]

QPatternist::AccelTree::BasicNodeData::BasicNodeData ( const PreNumber  aDepth,
const PreNumber  aParent,
const QXmlNodeModelIndex::NodeKind  k,
const PreNumber  s,
const QXmlName  n = QXmlName() 
)
inline

Definition at line 129 of file qacceltree_p.h.

133  : m_parent(aParent)
134  , m_size(s)
135  , m_name(n)
136  , m_depth(aDepth)
137  , m_kind(k)
138  {
139  }
QXmlNodeModelIndex::NodeKind m_kind
Definition: qacceltree_p.h:219

Functions

◆ depth()

Depth QPatternist::AccelTree::BasicNodeData::depth ( ) const
inline

Definition at line 141 of file qacceltree_p.h.

Referenced by QPatternist::AccelTree::postNumber(), and QPatternist::AccelTree::printStats().

142  {
143  return m_depth;
144  }

◆ isCompressed()

bool QPatternist::AccelTree::BasicNodeData::isCompressed ( ) const
inline

Definition at line 179 of file qacceltree_p.h.

180  {
182  "Currently, only text nodes are compressed.");
183  /* Note, we don't call size() here, since it has logic for text
184  * nodes. */
185  return m_size == IsCompressed;
186  }
QXmlNodeModelIndex::NodeKind m_kind
Definition: qacceltree_p.h:219
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ kind()

QXmlNodeModelIndex::NodeKind QPatternist::AccelTree::BasicNodeData::kind ( ) const
inline

Definition at line 169 of file qacceltree_p.h.

Referenced by QPatternist::AccelTree::printStats().

170  {
171  return m_kind;
172  }
QXmlNodeModelIndex::NodeKind m_kind
Definition: qacceltree_p.h:219

◆ name()

QXmlName QPatternist::AccelTree::BasicNodeData::name ( ) const
inline

Definition at line 174 of file qacceltree_p.h.

Referenced by QPatternist::AccelTree::printStats().

175  {
176  return m_name;
177  }

◆ parent()

PreNumber QPatternist::AccelTree::BasicNodeData::parent ( ) const
inline

Definition at line 146 of file qacceltree_p.h.

147  {
148  return m_parent;
149  }

◆ setSize()

void QPatternist::AccelTree::BasicNodeData::setSize ( const PreNumber  aSize)
inline

Definition at line 164 of file qacceltree_p.h.

Referenced by QPatternist::AccelTreeBuilder< true >::endElement().

165  {
166  m_size = aSize;
167  }

◆ size()

PreNumber QPatternist::AccelTree::BasicNodeData::size ( ) const
inline
See also
AccelTree::size()

Definition at line 154 of file qacceltree_p.h.

Referenced by QPatternist::AccelTree::postNumber(), and QPatternist::AccelTree::printStats().

155  {
156  /* Remember that we use the m_size to signal compression if
157  * we're a text node. */
159  return 0;
160  else
161  return m_size;
162  }
QXmlNodeModelIndex::NodeKind m_kind
Definition: qacceltree_p.h:219

Properties

◆ m_depth

Depth QPatternist::AccelTree::BasicNodeData::m_depth
private

Definition at line 210 of file qacceltree_p.h.

◆ m_kind

QXmlNodeModelIndex::NodeKind QPatternist::AccelTree::BasicNodeData::m_kind
private

Technically it is sufficient with 7 bits. However, at least MSVC 2005 miscompiles it such that QXmlNodeModelIndex::Text becomes -64 instead of 64 with hilarious crashes as result.

Fortunately this extra bit would be padded anyway.

Definition at line 219 of file qacceltree_p.h.

◆ m_name

QXmlName QPatternist::AccelTree::BasicNodeData::m_name
private

For text nodes, and less importantly, comments, this variable is not used.

Definition at line 208 of file qacceltree_p.h.

◆ m_parent

PreNumber QPatternist::AccelTree::BasicNodeData::m_parent
private

This is the pre number of the parent.

Definition at line 192 of file qacceltree_p.h.

◆ m_size

PreNumber QPatternist::AccelTree::BasicNodeData::m_size
private

This is the count of children this node has.

In the case of a text node, which cannot have children, it is set to IsCompressed, if the content has been the result of CompressedWhitespace::compress(). If it's not compressed, it is zero.

Definition at line 202 of file qacceltree_p.h.


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