Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _RESULT_HPP
00023 #define _RESULT_HPP
00024
00025 #include <string>
00026 #include <xercesc/util/XercesDefs.hpp>
00027
00028 #include <xqilla/framework/XQillaExport.hpp>
00029 #include <xqilla/items/Item.hpp>
00030 #include <xqilla/runtime/ResultImpl.hpp>
00031 #include <xqilla/runtime/EmptyResult.hpp>
00032
00033 class Sequence;
00034 class SequenceType;
00035 class DynamicContext;
00036 class StaticType;
00037
00039 class XQILLA_API Result
00040 {
00041 public:
00042 Result(const Item::Ptr &item);
00043 Result(const Sequence &seq);
00044 Result(ResultImpl *impl);
00045 Result(const Result &o);
00046 Result &operator=(const Result &o);
00047 ~Result();
00048
00050 ResultImpl *operator->();
00051
00053 const ResultImpl *operator->() const;
00054
00056 ResultImpl *get();
00057
00059 const ResultImpl *get() const;
00060
00062 bool isNull() const;
00063
00064 EmptyResult* getEmpty() const;
00065
00066 private:
00067 ResultImpl *_impl;
00068
00069 static EmptyResult _empty;
00070 };
00071
00072 inline bool Result::isNull() const
00073 {
00074 return _impl == 0;
00075 }
00076
00077 inline ResultImpl *Result::get()
00078 {
00079 if(_impl) return _impl;
00080 return getEmpty();
00081 }
00082
00083 inline const ResultImpl *Result::get() const
00084 {
00085 if(_impl) return _impl;
00086 return getEmpty();
00087 }
00088
00089 inline ResultImpl *Result::operator->()
00090 {
00091 return get();
00092 }
00093
00094 inline const ResultImpl *Result::operator->() const
00095 {
00096 return get();
00097 }
00098
00099 #endif