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

A TokenSource which contains one Tokenizer::Token. More...

#include <qxslttokenizer_p.h>

Inheritance diagram for QPatternist::SingleTokenContainer:
QPatternist::TokenSource QSharedData

Public Functions

virtual Tokenizer::Token nextToken (YYLTYPE *const sourceLocator)
 
 SingleTokenContainer (const Tokenizer::Token &token, const YYLTYPE &location)
 
- Public Functions inherited from QPatternist::TokenSource
 TokenSource ()
 
virtual ~TokenSource ()
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 

Properties

bool m_hasDelivered
 
const YYLTYPE m_location
 
const Tokenizer::Token m_token
 

Additional Inherited Members

- Public Types inherited from QPatternist::TokenSource
typedef QExplicitlySharedDataPointer< TokenSourcePtr
 
typedef QQueue< PtrQueue
 
typedef yytokentype TokenType
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

A TokenSource which contains one Tokenizer::Token.

One possible way to optimize this is to let SingleTokenContainer actually contain a list of tokens, such that XSLTTokenizer::queueToken() could append to that, instead of instansiating a SingleTokenContainer all the time.

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

Definition at line 80 of file qxslttokenizer_p.h.

Constructors and Destructors

◆ SingleTokenContainer()

QPatternist::SingleTokenContainer::SingleTokenContainer ( const Tokenizer::Token token,
const YYLTYPE location 
)
inline

Definition at line 93 of file qxslttokenizer_p.h.

94  : m_token(token)
95  , m_location(location)
96  , m_hasDelivered(false)
97  {
98  }
const Tokenizer::Token m_token

Functions

◆ nextToken()

Tokenizer::Token SingleTokenContainer::nextToken ( YYLTYPE *const  sourceLocator)
virtual
Returns
the next token.

Implements QPatternist::TokenSource.

Definition at line 56 of file qxslttokenizer.cpp.

57 {
58  if(m_hasDelivered)
59  return Tokenizer::Token(END_OF_FILE);
60  else
61  {
63  m_hasDelivered = true;
64  return m_token;
65  }
66 }
const Tokenizer::Token m_token
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63

Properties

◆ m_hasDelivered

bool QPatternist::SingleTokenContainer::m_hasDelivered
private

Definition at line 90 of file qxslttokenizer_p.h.

Referenced by nextToken().

◆ m_location

const YYLTYPE QPatternist::SingleTokenContainer::m_location
private

Definition at line 89 of file qxslttokenizer_p.h.

Referenced by nextToken().

◆ m_token

const Tokenizer::Token QPatternist::SingleTokenContainer::m_token
private

Definition at line 88 of file qxslttokenizer_p.h.

Referenced by nextToken().


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