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

Houses the data necessary for a template pattern. More...

#include <qtemplatepattern_p.h>

Inheritance diagram for QPatternist::TemplatePattern:
QSharedData

Public Types

typedef int ID
 
typedef QExplicitlySharedDataPointer< TemplatePatternPtr
 
typedef QVector< PtrVector
 

Public Functions

ID id () const
 
const Expression::PtrmatchPattern () const
 
PatternPriority priority () const
 
void setMatchPattern (const Expression::Ptr &pattern)
 
 TemplatePattern (const Expression::Ptr &matchPattern, const PatternPriority pri, const ID id, const Template::Ptr templ)
 
const Template::PtrtemplateTarget () const
 
- 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

ID m_id
 
Expression::Ptr m_matchPattern
 
PatternPriority m_priority
 
Template::Ptr m_templateTarget
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Houses the data necessary for a template pattern.

A template pattern is the match pattern, but have had each operand to | separated out into a separate TemplatePattern. For instance, the pattern a | b | c, becomes three separate TemplatePattern instances.

See also
TemplateMode
Template
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com
Since
4.5

Definition at line 76 of file qtemplatepattern_p.h.

Typedefs

◆ ID

Definition at line 81 of file qtemplatepattern_p.h.

◆ Ptr

Definition at line 79 of file qtemplatepattern_p.h.

◆ Vector

Definition at line 80 of file qtemplatepattern_p.h.

Constructors and Destructors

◆ TemplatePattern()

QPatternist::TemplatePattern::TemplatePattern ( const Expression::Ptr matchPattern,
const PatternPriority  pri,
const ID  id,
const Template::Ptr  templ 
)
inline

Definition at line 116 of file qtemplatepattern_p.h.

120  , m_priority(pri)
121  , m_id(id)
122  , m_templateTarget(templ)
123 
124  {
127  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const Expression::Ptr & matchPattern() const

Functions

◆ id()

TemplatePattern::ID QPatternist::TemplatePattern::id ( ) const
inline

Definition at line 144 of file qtemplatepattern_p.h.

145  {
146  return m_id;
147  }

◆ matchPattern()

const Expression::Ptr & QPatternist::TemplatePattern::matchPattern ( ) const
inline

Definition at line 129 of file qtemplatepattern_p.h.

130  {
131  return m_matchPattern;
132  }

◆ priority()

PatternPriority QPatternist::TemplatePattern::priority ( ) const
inline

Definition at line 139 of file qtemplatepattern_p.h.

140  {
141  return m_priority;
142  }

◆ setMatchPattern()

void QPatternist::TemplatePattern::setMatchPattern ( const Expression::Ptr pattern)
inline

Definition at line 134 of file qtemplatepattern_p.h.

135  {
136  m_matchPattern = pattern;
137  }

◆ templateTarget()

const Template::Ptr & QPatternist::TemplatePattern::templateTarget ( ) const
inline

Definition at line 149 of file qtemplatepattern_p.h.

150  {
151  return m_templateTarget;
152  }

Properties

◆ m_id

ID QPatternist::TemplatePattern::m_id
private

Definition at line 111 of file qtemplatepattern_p.h.

Referenced by id().

◆ m_matchPattern

Expression::Ptr QPatternist::TemplatePattern::m_matchPattern
private

This ID is used to ensure that, as 6.4 Conflict Resolution for Template Rules reads:

"If the pattern contains multiple alternatives separated by |, then the template rule is treated equivalently to a set of template rules, one for each alternative. However, it is not an error if a node matches more than one of the alternatives."

For patterns separated by |, we have one Template instance for each alternative, but they all have the same ID, hence if several alternatives match, we don't flag it as an error if they have the same ID.

Definition at line 109 of file qtemplatepattern_p.h.

Referenced by matchPattern(), setMatchPattern(), and TemplatePattern().

◆ m_priority

PatternPriority QPatternist::TemplatePattern::m_priority
private

Definition at line 110 of file qtemplatepattern_p.h.

Referenced by priority().

◆ m_templateTarget

Template::Ptr QPatternist::TemplatePattern::m_templateTarget
private

Definition at line 112 of file qtemplatepattern_p.h.

Referenced by TemplatePattern(), and templateTarget().


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