Main Page
Namespaces
Classes
Files
Examples
File List
File Members
include
xqilla
events
EventGenerator.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 _EVENTGENERATOR_HPP
21
#define _EVENTGENERATOR_HPP
22
23
#include <xqilla/framework/XQillaExport.hpp>
24
#include <
xqilla/framework/ReferenceCounted.hpp
>
25
#include <
xqilla/runtime/ResultImpl.hpp
>
26
27
class
DynamicContext
;
28
class
EventHandler
;
29
class
ASTNode;
30
class
QueryPathNode;
31
32
class
XQILLA_API
EventGenerator
:
public
ReferenceCounted
33
{
34
public
:
35
typedef
RefCountPointer<EventGenerator>
Ptr
;
36
37
virtual
~EventGenerator
() {}
38
41
virtual
EventGenerator::Ptr
generateEvents(
EventHandler
*events,
DynamicContext
*context) = 0;
42
43
static
void
generateAndTailCall
(
const
EventGenerator::Ptr
&generator,
EventHandler
*events,
44
DynamicContext
*context)
45
{
46
EventGenerator::Ptr
gen = generator;
47
while
(gen.
notNull
()) {
48
gen = gen->generateEvents(events, context);
49
}
50
}
51
52
static
Result
createResult(
const
ASTNode *ast,
const
QueryPathNode *projection,
53
DynamicContext
*context);
54
};
55
56
class
XQILLA_API
ASTNodeEventGenerator
:
public
EventGenerator
57
{
58
public
:
59
ASTNodeEventGenerator
(
const
ASTNode *ast,
bool
preserveNS,
bool
preserveType);
60
61
virtual
EventGenerator::Ptr
generateEvents
(
EventHandler
*events,
DynamicContext
*context);
62
63
protected
:
64
const
ASTNode *
ast_
;
65
bool
preserveNS_,
preserveType_
;
66
};
67
68
#endif
EventGenerator::generateAndTailCall
static void generateAndTailCall(const EventGenerator::Ptr &generator, EventHandler *events, DynamicContext *context)
Definition:
EventGenerator.hpp:43
EventHandler
Definition:
EventHandler.hpp:29
ReferenceCounted
Super class for reference counted classes.
Definition:
ReferenceCounted.hpp:30
ASTNodeEventGenerator
Definition:
EventGenerator.hpp:56
RefCountPointer
Super class of all the reference counted wrappers for Items.
Definition:
ReferenceCounted.hpp:61
EventGenerator::Ptr
RefCountPointer< EventGenerator > Ptr
Definition:
EventGenerator.hpp:35
EventGenerator::generateEvents
virtual EventGenerator::Ptr generateEvents(EventHandler *events, DynamicContext *context)=0
Returns the result of this expression via the EventHandler provided.
ResultImpl.hpp
Result
A scoped pointer wrapper for the lazily evaluated query result.
Definition:
Result.hpp:37
EventGenerator::~EventGenerator
virtual ~EventGenerator()
Definition:
EventGenerator.hpp:37
ASTNodeEventGenerator::preserveType_
bool preserveType_
Definition:
EventGenerator.hpp:65
EventGenerator
Definition:
EventGenerator.hpp:32
DynamicContext
The execution time dynamic context interface.
Definition:
DynamicContext.hpp:38
RefCountPointer::notNull
bool notNull() const
Definition:
ReferenceCounted.hpp:114
ReferenceCounted.hpp
ASTNodeEventGenerator::ast_
const ASTNode * ast_
Definition:
EventGenerator.hpp:64
Generated by
1.8.5