00001 /* 00002 * Copyright (c) 2001-2006 00003 * DecisionSoft Limited. All rights reserved. 00004 * Copyright (c) 2004-2006 00005 * Progress Software Corporation. All rights reserved. 00006 * Copyright (c) 2004-2006 00007 * Oracle. All rights reserved. 00008 * 00009 * See the file LICENSE for redistribution information. 00010 * 00011 * $Id: ResultImpl.hpp,v 1.9 2006/11/01 16:37:15 jpcs Exp $ 00012 */ 00013 00014 #ifndef _RESULTIMPL_HPP 00015 #define _RESULTIMPL_HPP 00016 00017 #include <string> 00018 #include <xercesc/util/XercesDefs.hpp> 00019 00020 #include <xqilla/framework/XQillaExport.hpp> 00021 #include <xqilla/items/Item.hpp> 00022 #include <xqilla/framework/ReferenceCounted.hpp> 00023 #include <xqilla/ast/LocationInfo.hpp> 00024 00025 class SequenceType; 00026 class DynamicContext; 00027 class Sequence; 00028 00030 class XQILLA_API ResultImpl : public ReferenceCounted, public LocationInfo 00031 { 00032 public: 00033 virtual ~ResultImpl() {} 00034 00036 virtual Item::Ptr next(DynamicContext *context) = 0; 00037 00039 virtual void skip() {} 00040 00042 virtual bool getEffectiveBooleanValue(DynamicContext* context, const LocationInfo *info); 00044 static bool getEffectiveBooleanValue(const Item::Ptr &first, const Item::Ptr &second, DynamicContext* context, const LocationInfo *info); 00045 00047 virtual Sequence toSequence(DynamicContext *context); 00048 00050 virtual std::string asString(DynamicContext *context, int indent) const = 0; 00051 00052 static std::string getIndent(int indent); 00053 00054 protected: 00059 ResultImpl(const LocationInfo *o) 00060 { 00061 setLocationInfo(o); 00062 } 00063 00064 private: 00065 ResultImpl(const ResultImpl &) {}; 00066 ResultImpl &operator=(const ResultImpl &) { return *this; }; 00067 }; 00068 00069 #endif