Main Page
Namespaces
Classes
Files
Examples
File List
File Members
include
xqilla
runtime
Result.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2001, 2008,
3
* DecisionSoft Limited. All rights reserved.
4
* Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
5
*
6
*
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* You may obtain a copy of the License at
10
*
11
* http://www.apache.org/licenses/LICENSE-2.0
12
*
13
* Unless required by applicable law or agreed to in writing, software
14
* distributed under the License is distributed on an "AS IS" BASIS,
15
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
* See the License for the specific language governing permissions and
17
* limitations under the License.
18
*/
19
20
#ifndef _RESULT_HPP
21
#define _RESULT_HPP
22
23
#include <string>
24
#include <xercesc/util/XercesDefs.hpp>
25
26
#include <xqilla/framework/XQillaExport.hpp>
27
#include <
xqilla/items/Item.hpp
>
28
#include <
xqilla/runtime/ResultImpl.hpp
>
29
#include <xqilla/runtime/EmptyResult.hpp>
30
31
class
Sequence
;
32
class
SequenceType;
33
class
DynamicContext
;
34
class
StaticType
;
35
37
class
XQILLA_API
Result
38
{
39
public
:
40
Result
(
const
Item::Ptr
&item);
41
Result
(
const
Sequence
&seq);
42
Result
(
ResultImpl
*impl);
43
Result
(
const
Result
&o);
44
Result
&operator=(
const
Result
&o);
45
~
Result
();
46
48
ResultImpl
*operator->();
49
51
const
ResultImpl
*operator->()
const
;
52
54
ResultImpl
*
get
();
55
57
const
ResultImpl
*
get
()
const
;
58
60
bool
isNull()
const
;
61
62
EmptyResult* getEmpty()
const
;
63
64
private
:
65
ResultImpl
*_impl;
66
67
static
EmptyResult _empty;
68
};
69
70
inline
bool
Result::isNull
()
const
71
{
72
return
_impl == 0;
73
}
74
75
inline
ResultImpl
*
Result::get
()
76
{
77
if
(_impl)
return
_impl;
78
return
getEmpty
();
79
}
80
81
inline
const
ResultImpl
*
Result::get
()
const
82
{
83
if
(_impl)
return
_impl;
84
return
getEmpty
();
85
}
86
87
inline
ResultImpl
*
Result::operator->
()
88
{
89
return
get
();
90
}
91
92
inline
const
ResultImpl
*
Result::operator->
()
const
93
{
94
return
get
();
95
}
96
97
#endif
RefCountPointer< const Item >
ResultImpl.hpp
Result
A scoped pointer wrapper for the lazily evaluated query result.
Definition:
Result.hpp:37
Result::isNull
bool isNull() const
Returns true if the underlying pointer is null.
Definition:
Result.hpp:70
Item.hpp
DynamicContext
The execution time dynamic context interface.
Definition:
DynamicContext.hpp:38
Result::getEmpty
EmptyResult * getEmpty() const
Result::get
ResultImpl * get()
Returns the underlying ResultImpl object.
Definition:
Result.hpp:75
StaticType
Class that represents the static type of an expression.
Definition:
StaticType.hpp:33
Sequence
An eagerly evaluated result of a query execution.
Definition:
Sequence.hpp:39
ResultImpl
A lazily evaluated query result.
Definition:
ResultImpl.hpp:33
Result::operator->
ResultImpl * operator->()
Returns the underlying ResultImpl object.
Definition:
Result.hpp:87
Generated by
1.8.5