Qt 4.8
Public Types | Public Functions | Public Variables | Static Private Functions | Properties | List of all members
QPatternist::TemplateMode Class Reference

Houses the data specific to the templates for a certain mode. More...

#include <qtemplatemode_p.h>

Inheritance diagram for QPatternist::TemplateMode:
QSharedData

Public Types

typedef QExplicitlySharedDataPointer< TemplateModePtr
 

Public Functions

void addMode (const TemplateMode::Ptr &mode)
 
void finalize ()
 
const QXmlNamename () const
 
 TemplateMode (const QXmlName &modeName)
 
- 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...
 

Public Variables

TemplatePattern::Vector templatePatterns
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Static Private Functions

static bool lessThanByPriority (const TemplatePattern::Ptr &t1, const TemplatePattern::Ptr &t2)
 

Properties

const QXmlName m_modeName
 

Detailed Description

Houses the data specific to the templates for a certain mode.

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

Definition at line 74 of file qtemplatemode_p.h.

Typedefs

◆ Ptr

Definition at line 77 of file qtemplatemode_p.h.

Constructors and Destructors

◆ TemplateMode()

QPatternist::TemplateMode::TemplateMode ( const QXmlName modeName)
inline

Definition at line 79 of file qtemplatemode_p.h.

79  : m_modeName(modeName)
80  {
81  }

Functions

◆ addMode()

void QPatternist::TemplateMode::addMode ( const TemplateMode::Ptr mode)
inline

Adds the templates in mode to this TemplateMode.

The existing name remains.

Definition at line 117 of file qtemplatemode_p.h.

118  {
119  templatePatterns += mode->templatePatterns;
120  }
TemplatePattern::Vector templatePatterns

◆ finalize()

void TemplateMode::finalize ( )

Orders its templates by priority such that the first lookup always returns the template with highest priority, and removes templates shadowed by import precedence.

Definition at line 54 of file qtemplatemode.cpp.

55 {
57 
58  /* Now we have a list of patterns sorted by priority. */
59 }
TemplatePattern::Vector templatePatterns
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
Definition: qvector.h:250
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
Definition: qvector.h:247
static bool lessThanByPriority(const TemplatePattern::Ptr &t1, const TemplatePattern::Ptr &t2)

◆ lessThanByPriority()

bool TemplateMode::lessThanByPriority ( const TemplatePattern::Ptr t1,
const TemplatePattern::Ptr t2 
)
inlinestaticprivate

Operator for qSort().

Definition at line 48 of file qtemplatemode.cpp.

Referenced by finalize().

50 {
51  return t1->priority() > t2->priority();
52 }

◆ name()

const QXmlName & QPatternist::TemplateMode::name ( ) const
inline

Definition at line 112 of file qtemplatemode_p.h.

113  {
114  return m_modeName;
115  }

Properties

◆ m_modeName

const QXmlName QPatternist::TemplateMode::m_modeName
private

Definition at line 102 of file qtemplatemode_p.h.

◆ templatePatterns

TemplatePattern::Vector QPatternist::TemplateMode::templatePatterns

Definition at line 83 of file qtemplatemode_p.h.

Referenced by finalize(), and QPatternist::ApplyTemplate::findTemplate().


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