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-2008
5
* Oracle. All rights reserved.
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
* $Id$
20
*/
21
22
#ifndef _RESULT_HPP
23
#define _RESULT_HPP
24
25
#include <string>
26
#include <xercesc/util/XercesDefs.hpp>
27
28
#include <xqilla/framework/XQillaExport.hpp>
29
#include <
xqilla/items/Item.hpp
>
30
#include <
xqilla/runtime/ResultImpl.hpp
>
31
#include <xqilla/runtime/EmptyResult.hpp>
32
33
class
Sequence
;
34
class
SequenceType;
35
class
DynamicContext
;
36
class
StaticType
;
37
39
class
XQILLA_API
Result
40
{
41
public
:
42
Result
(
const
Item::Ptr
&item);
43
Result
(
const
Sequence
&seq);
44
Result
(
ResultImpl
*impl);
45
Result
(
const
Result
&o);
46
Result
&operator=(
const
Result
&o);
47
~
Result
();
48
50
ResultImpl
*operator->();
51
53
const
ResultImpl
*operator->()
const
;
54
56
ResultImpl
*
get
();
57
59
const
ResultImpl
*
get
()
const
;
60
62
bool
isNull()
const
;
63
64
EmptyResult* getEmpty()
const
;
65
66
private
:
67
ResultImpl
*_impl;
68
69
static
EmptyResult _empty;
70
};
71
72
inline
bool
Result::isNull
()
const
73
{
74
return
_impl == 0;
75
}
76
77
inline
ResultImpl
*
Result::get
()
78
{
79
if
(_impl)
return
_impl;
80
return
getEmpty
();
81
}
82
83
inline
const
ResultImpl
*
Result::get
()
const
84
{
85
if
(_impl)
return
_impl;
86
return
getEmpty
();
87
}
88
89
inline
ResultImpl
*
Result::operator->
()
90
{
91
return
get
();
92
}
93
94
inline
const
ResultImpl
*
Result::operator->
()
const
95
{
96
return
get
();
97
}
98
99
#endif
RefCountPointer< const Item >
ResultImpl.hpp
Result
A scoped pointer wrapper for the lazily evaluated query result.
Definition:
Result.hpp:39
Result::isNull
bool isNull() const
Returns true if the underlying pointer is null.
Definition:
Result.hpp:72
Item.hpp
DynamicContext
The execution time dynamic context interface.
Definition:
DynamicContext.hpp:39
Result::getEmpty
EmptyResult * getEmpty() const
Result::get
ResultImpl * get()
Returns the underlying ResultImpl object.
Definition:
Result.hpp:77
StaticType
Class that represents the static type of an expression.
Definition:
StaticType.hpp:35
Sequence
An eagerly evaluated result of a query execution.
Definition:
Sequence.hpp:41
ResultImpl
A lazily evaluated query result.
Definition:
ResultImpl.hpp:35
Result::operator->
ResultImpl * operator->()
Returns the underlying ResultImpl object.
Definition:
Result.hpp:89
Generated by
1.8.5