/* * Copyright (c) 2001, DecisionSoft Limited All rights reserved. * Please see LICENSE.TXT for more information. */ #ifndef _DATAITEMS_HPP #define _DATAITEMS_HPP #include #include #include class DynamicContext; class StaticContext; class Sequence; class DataItem; class StaticResolutionContext; typedef std::vector > VectorOfDataItems; class PATHAN_EXPORT DataItem { public: ///enum for data types typedef enum { LITERAL, SEQUENCE, FUNCTION, NAVIGATION, VARIABLE, STEP, FOR, QUANTIFIED, IF, INSTANCE_OF, CASTABLE_AS, CAST_AS, TREAT_AS, OPERATOR, CONTEXT_ITEM, PARENTHESIZED } whichType; enum executionFlags { UNORDERED =0x01, RETURN_ONE=0x02, RETURN_TWO=0x04 }; virtual Sequence collapseTree(DynamicContext* context, int flags=0) const = 0; /** Returns true if this DataItem has no predicates, and is an instance of DataItemSequence or DataItemLiteral */ virtual bool isConstant() const = 0; /** Returns true if this DataItem has no predicates, and is an instance of DataItemSequence or DataItemLiteral. If the literal value of this DataItem is a single DateOrTimeType, then hasTimezone() on it must return true, otherwise this method will return false. */ virtual bool isConstantAndHasTimezone(StaticContext* context) const = 0; virtual void addPredicates(const VectorOfDataItems &steps) = 0; /// Returns the type of the DataItemImpl pointed to. virtual whichType getType(void) const = 0; virtual DataItem* staticResolution(StaticContext *context, StaticResolutionContext *src) = 0; }; #endif