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

Matches boolean literals. More...

#include <qoptimizerblocks_p.h>

Inheritance diagram for QPatternist::BooleanIdentifier:
QPatternist::ExpressionIdentifier QSharedData

Public Functions

 BooleanIdentifier (const bool value)
 
virtual bool matches (const Expression::Ptr &expr) const
 
- Public Functions inherited from QPatternist::ExpressionIdentifier
 ExpressionIdentifier ()
 
virtual ~ExpressionIdentifier ()
 
- 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

const bool m_value
 

Additional Inherited Members

- Public Types inherited from QPatternist::ExpressionIdentifier
typedef QList< ExpressionIdentifier::PtrList
 
typedef QExplicitlySharedDataPointer< ExpressionIdentifierPtr
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Matches boolean literals.

For example BooleanIdentifier(true) would match the former but not the latter operand in this expression: "true() + false()".

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

Definition at line 178 of file qoptimizerblocks_p.h.

Constructors and Destructors

◆ BooleanIdentifier()

BooleanIdentifier::BooleanIdentifier ( const bool  value)

Definition at line 118 of file qoptimizerblocks.cpp.

118  : m_value(value)
119 {
120 }

Functions

◆ matches()

bool BooleanIdentifier::matches ( const Expression::Ptr expr) const
virtual
Parameters
exprthe Expression to be tested. This is guranteed to always be a non null, valid pointer.
Returns
true if expr matches as according to this ExpressionIdentifier, otherwise false.

Implements QPatternist::ExpressionIdentifier.

Definition at line 122 of file qoptimizerblocks.cpp.

123 {
124  return expr->is(Expression::IDBooleanValue) &&
126 }
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const
bool is(const ID id) const

Properties

◆ m_value

const bool QPatternist::BooleanIdentifier::m_value
private

Definition at line 185 of file qoptimizerblocks_p.h.

Referenced by matches().


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