Qt 4.8
Public Functions | Protected Functions | Protected Variables | List of all members
QPatternist::SingleContainer Class Reference

Base class for expressions that has exactly one operand. More...

#include <qsinglecontainer_p.h>

Inheritance diagram for QPatternist::SingleContainer:
QPatternist::Expression QSharedData QPatternist::CppCastingHelper< Expression > QPatternist::SourceLocationReflection QPatternist::Atomizer QPatternist::AttributeNameValidator QPatternist::CardinalityVerifier QPatternist::CastableAs QPatternist::CastAs QPatternist::CollationChecker QPatternist::CommentConstructor QPatternist::CopyOf QPatternist::CurrentItemStore QPatternist::DocumentConstructor QPatternist::DynamicContextStore QPatternist::EBVExtractor QPatternist::EvaluationCache< IsForGlobal > QPatternist::FirstItemPredicate QPatternist::InstanceOf QPatternist::ItemVerifier QPatternist::NCNameConstructor QPatternist::NodeSortExpression QPatternist::OrderBy QPatternist::QNameConstructor QPatternist::SimpleContentConstructor QPatternist::StaticBaseURIStore QPatternist::StaticCompatibilityStore QPatternist::TextNodeConstructor QPatternist::TreatAs QPatternist::UntypedAtomicConverter

Public Functions

virtual bool compressOperands (const StaticContext::Ptr &)
 
virtual Expression::List operands () const
 
virtual void setOperands (const Expression::List &operands)
 
- Public Functions inherited from QPatternist::Expression
virtual ExpressionVisitorResult::Ptr accept (const ExpressionVisitor::Ptr &visitor) const =0
 
virtual const SourceLocationReflectionactualReflection () const
 Returns this. More...
 
virtual void announceFocusType (const ItemType::Ptr &itemType)
 
virtual Expression::Ptr compress (const StaticContext::Ptr &context)
 
Properties deepProperties () const
 Computes the union of properties for this Expression and all its descending children. More...
 
virtual Properties dependencies () const
 
virtual QString description () const
 
virtual bool evaluateEBV (const DynamicContext::Ptr &context) const
 
virtual Item::Iterator::Ptr evaluateSequence (const DynamicContext::Ptr &context) const
 
virtual Item evaluateSingleton (const DynamicContext::Ptr &context) const
 
virtual void evaluateToSequenceReceiver (const DynamicContext::Ptr &context) const
 
virtual ItemType::Ptr expectedContextItemType () const
 
virtual SequenceType::List expectedOperandTypes () const =0
 
 Expression ()
 
bool has (const Property prop) const
 
bool hasDependency (const Property prop) const
 
virtual ID id () const
 
bool is (const ID id) const
 
bool isEvaluated () const
 
virtual ItemType::Ptr newFocusType () const
 
virtual QList< QExplicitlySharedDataPointer< OptimizationPass > > optimizationPasses () const
 
virtual PatternPriority patternPriority () const
 
virtual Properties properties () const
 
const Expression::Ptrrewrite (const Expression::Ptr &to, const StaticContext::Ptr &context) const
 Rewrites this Expression to to, and return to. More...
 
virtual SequenceType::Ptr staticType () const =0
 
virtual Expression::Ptr typeCheck (const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
 
virtual ~Expression ()
 
- 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 Functions inherited from QPatternist::CppCastingHelper< Expression >
const TCastTarget * as () const
 
TCastTarget * as ()
 
- Public Functions inherited from QPatternist::SourceLocationReflection
virtual QSourceLocation sourceLocation () const
 
 SourceLocationReflection ()
 
virtual ~SourceLocationReflection ()
 

Protected Functions

 SingleContainer (const Expression::Ptr &operand)
 
- Protected Functions inherited from QPatternist::Expression
void typeCheckOperands (const StaticContext::Ptr &context)
 
- Protected Functions inherited from QPatternist::CppCastingHelper< Expression >
 CppCastingHelper ()
 

Protected Variables

Expression::Ptr m_operand
 

Additional Inherited Members

- Public Types inherited from QPatternist::Expression
typedef QExplicitlySharedDataPointer< const ExpressionConstPtr
 A smart pointer wrapping const Expression instances. More...
 
enum  ID {
  IDBooleanValue = 1, IDCountFN, IDEmptyFN, IDExistsFN,
  IDExpressionSequence, IDGeneralComparison, IDIfThenClause, IDIgnorableExpression,
  IDIntegerValue, IDPositionFN, IDStringValue, IDValueComparison,
  IDRangeVariableReference, IDContextItem, IDUserFunctionCallsite, IDExpressionVariableReference,
  IDAttributeConstructor, IDUpperCaseFN, IDLowerCaseFN, IDFirstItemPredicate,
  IDEmptySequence, IDReturnOrderBy, IDLetClause, IDForClause,
  IDPath, IDNamespaceConstructor, IDArgumentReference, IDGenericPredicate,
  IDAxisStep, IDFloat, IDCombineNodes, IDUnresolvedVariableReference,
  IDCardinalityVerifier
}
 
typedef QList< Expression::PtrList
 
typedef QFlags< PropertyProperties
 
enum  Property {
  UseContextItem = 1, DisableElimination = 1 << 1, IsEvaluated = 1 << 2, DisableTypingDeduction = 1 << 3,
  EmptynessFollowsChild = 1 << 4, RewriteToEmptyOnEmpty = 1 << 5, RequiresFocus = 1 << 6, AffectsOrderOnly = 1 << 7,
  RequiresContextItem = (1 << 8) | RequiresFocus, CreatesFocusForLast = 1 << 9, LastOperandIsCollation = 1 << 10, DependsOnLocalVariable = (1 << 11) | DisableElimination,
  EvaluationCacheRedundant = (1 << 12), IsNodeConstructor = 1 << 13, RequiresCurrentItem = 1 << 14
}
 
typedef QExplicitlySharedDataPointer< ExpressionPtr
 A smart pointer wrapping mutable Expression instances. More...
 
typedef ::QAbstractXmlForwardIterator< Expression::PtrQAbstractXmlForwardIterator
 
typedef QVector< Expression::PtrVector
 
- Static Public Functions inherited from QPatternist::Expression
static void rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context)
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Base class for expressions that has exactly one operand.

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

Definition at line 69 of file qsinglecontainer_p.h.

Constructors and Destructors

◆ SingleContainer()

SingleContainer::SingleContainer ( const Expression::Ptr operand)
protected

Definition at line 51 of file qsinglecontainer.cpp.

51  : m_operand(operand)
52 {
53  Q_ASSERT(operand);
54 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Functions

◆ compressOperands()

bool SingleContainer::compressOperands ( const StaticContext::Ptr )
virtual
Returns
true if all operands are constant values of somekind, and are already evaluated. A string literal, is a typical example.

Implements QPatternist::Expression.

Definition at line 69 of file qsinglecontainer.cpp.

70 {
71  rewrite(m_operand, m_operand->compress(context), context);
72 
73  return m_operand->isEvaluated();
74 }
virtual Expression::Ptr compress(const StaticContext::Ptr &context)
static void rewrite(Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context)

◆ operands()

Expression::List SingleContainer::operands ( ) const
virtual
Returns
the expression's child expressions. For example, a function's arguments is returned here.

If this Expression has no operands, an empty list should be returned.

Implements QPatternist::Expression.

Definition at line 56 of file qsinglecontainer.cpp.

57 {
58  Expression::List list;
59  list.append(m_operand);
60  return list;
61 }
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507

◆ setOperands()

void SingleContainer::setOperands ( const Expression::List operands)
virtual

Implements QPatternist::Expression.

Definition at line 63 of file qsinglecontainer.cpp.

64 {
65  Q_ASSERT(ops.count() == 1);
66  m_operand = ops.first();
67 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Properties

◆ m_operand

Expression::Ptr QPatternist::SingleContainer::m_operand
protected

Definition at line 80 of file qsinglecontainer_p.h.

Referenced by QPatternist::EBVExtractor::actualReflection(), QPatternist::DynamicContextStore::actualReflection(), QPatternist::Atomizer::actualReflection(), QPatternist::ItemVerifier::actualReflection(), QPatternist::CurrentItemStore::actualReflection(), QPatternist::CardinalityVerifier::actualReflection(), QPatternist::UntypedAtomicConverter::actualReflection(), QPatternist::EvaluationCache< IsForGlobal >::actualReflection(), QPatternist::QNameConstructor::actualReflection(), QPatternist::CastAs::castToQName(), QPatternist::NodeSortExpression::compress(), QPatternist::CurrentItemStore::compress(), QPatternist::InstanceOf::compress(), QPatternist::SimpleContentConstructor::compress(), QPatternist::CastableAs::compress(), QPatternist::CardinalityVerifier::compress(), QPatternist::FirstItemPredicate::compress(), QPatternist::CopyOf::compress(), QPatternist::EvaluationCache< IsForGlobal >::compress(), QPatternist::CastAs::compress(), QPatternist::OrderBy::compress(), compressOperands(), QPatternist::CommentConstructor::evaluateContent(), QPatternist::CurrentItemStore::evaluateEBV(), QPatternist::DynamicContextStore::evaluateEBV(), QPatternist::EBVExtractor::evaluateEBV(), QPatternist::InstanceOf::evaluateEBV(), QPatternist::CastableAs::evaluateEBV(), QPatternist::NodeSortExpression::evaluateSequence(), QPatternist::CurrentItemStore::evaluateSequence(), QPatternist::DynamicContextStore::evaluateSequence(), QPatternist::CardinalityVerifier::evaluateSequence(), QPatternist::ItemVerifier::evaluateSequence(), QPatternist::Atomizer::evaluateSequence(), QPatternist::ArgumentConverter::evaluateSequence(), QPatternist::UntypedAtomicConverter::evaluateSequence(), QPatternist::EvaluationCache< IsForGlobal >::evaluateSequence(), QPatternist::OrderBy::evaluateSequence(), QPatternist::XSLTSimpleContentConstructor::evaluateSingleton(), QPatternist::TextNodeConstructor::evaluateSingleton(), QPatternist::CurrentItemStore::evaluateSingleton(), QPatternist::DynamicContextStore::evaluateSingleton(), QPatternist::CollationChecker::evaluateSingleton(), QPatternist::DocumentConstructor::evaluateSingleton(), QPatternist::ItemVerifier::evaluateSingleton(), QPatternist::CardinalityVerifier::evaluateSingleton(), QPatternist::AttributeNameValidator::evaluateSingleton(), QPatternist::Atomizer::evaluateSingleton(), QPatternist::SimpleContentConstructor::evaluateSingleton(), QPatternist::NCNameConstructor::evaluateSingleton(), QPatternist::QNameConstructor::evaluateSingleton(), QPatternist::FirstItemPredicate::evaluateSingleton(), QPatternist::ArgumentConverter::evaluateSingleton(), QPatternist::UntypedAtomicConverter::evaluateSingleton(), QPatternist::CastAs::evaluateSingleton(), QPatternist::EvaluationCache< IsForGlobal >::evaluateSingleton(), QPatternist::TextNodeConstructor::evaluateToSequenceReceiver(), QPatternist::DocumentConstructor::evaluateToSequenceReceiver(), QPatternist::CopyOf::evaluateToSequenceReceiver(), QPatternist::CopyOf::expectedContextItemType(), operands(), QPatternist::CurrentItemStore::properties(), QPatternist::CopyOf::properties(), QPatternist::EvaluationCache< IsForGlobal >::properties(), QPatternist::OrderBy::properties(), setOperands(), QPatternist::NodeSortExpression::staticType(), QPatternist::TextNodeConstructor::staticType(), QPatternist::StaticCompatibilityStore::staticType(), QPatternist::ItemVerifier::staticType(), QPatternist::CardinalityVerifier::staticType(), QPatternist::StaticBaseURIStore::staticType(), QPatternist::Atomizer::staticType(), QPatternist::DynamicContextStore::staticType(), QPatternist::SimpleContentConstructor::staticType(), QPatternist::AttributeNameValidator::staticType(), QPatternist::CollationChecker::staticType(), QPatternist::CurrentItemStore::staticType(), QPatternist::UntypedAtomicConverter::staticType(), QPatternist::CopyOf::staticType(), QPatternist::FirstItemPredicate::staticType(), QPatternist::EvaluationCache< IsForGlobal >::staticType(), QPatternist::CastAs::staticType(), QPatternist::OrderBy::staticType(), QPatternist::StaticCompatibilityStore::typeCheck(), QPatternist::StaticBaseURIStore::typeCheck(), QPatternist::NCNameConstructor::typeCheck(), QPatternist::CastableAs::typeCheck(), QPatternist::Atomizer::typeCheck(), QPatternist::TreatAs::typeCheck(), QPatternist::UntypedAtomicConverter::typeCheck(), QPatternist::CastAs::typeCheck(), and QPatternist::EvaluationCache< IsForGlobal >::typeCheck().


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