rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
oqlquery.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 
24 #ifndef _D_OQL_QUERY_
25 #define _D_OQL_QUERY_
26 
27 #include "raslib/odmgtypes.hh"
28 #include <cstddef> // for NULL
29 
30 template <class T>
31 class r_Set;
32 template <class T>
33 class r_Ref;
34 class r_Ref_Any;
35 class r_Point;
36 class r_Sinterval;
37 class r_Minterval;
38 class r_Transaction;
39 class r_GMarray;
40 
41 //@ManMemo: Module: {\bf rasodmg}
71 {
72 public:
74  r_OQL_Query() = default;
75 
77  explicit r_OQL_Query(const char *s);
78 
81 
84 
86  const r_OQL_Query &operator=(const r_OQL_Query &q);
87 
88  //@Man: Stream input operators for every parameter type:
90  r_OQL_Query &operator<<(const char *s);
111 
112 
114  int is_update_query() const;
115 
117  int is_insert_query() const;
118 
120  int is_retrieval_query() const;
121 
122  //@Man: Methods for internal use:
124  void reset_query();
127  const char *get_query() const;
131  const char *get_parameterized_query() const;
133 
134 
135 private:
142  bool startsWith(const char *s, const char *prefix) const;
143  const char *skipComments(const char *s) const;
144 
146  void replaceNextArgument(const char *valueString);
147 
149  char *queryString{NULL};
150 
152  char *parameterizedQueryString{NULL};
153 
155  r_Set<r_GMarray *> *mddConstants{NULL};
156 };
157 
158 //@ManMemo: Module: {\bf rasodmg}
187 void r_oql_execute(r_OQL_Query &query, r_Set<r_Ref_Any> &result, r_Transaction *transaction = NULL);
188 
189 //@ManMemo: Module: {\bf rasodmg}
201 void r_oql_execute(r_OQL_Query &query, r_Set<r_Ref<r_GMarray>> &result, r_Transaction *transaction = NULL);
202 
203 //@ManMemo: Module: {\bf rasodmg}
221 void r_oql_execute(r_OQL_Query &query, r_Set<r_Ref_Any> &result, int dummy, r_Transaction *transaction = NULL);
222 
223 //@ManMemo: Module: {\bf rasodmg}
251 void r_oql_execute(r_OQL_Query &query, r_Transaction *transaction = NULL);
252 
253 #endif
The class represents a generic MDD in the sense that it is independent of the cell base type.
Definition: gmarray.hh:66
The spatial domain of an MDD is represented by an object of class r_Minterval.
Definition: minterval.hh:226
The global function r_oql_execute() is used to invoke RasML queries.
Definition: oqlquery.hh:71
r_OQL_Query & operator<<(r_Minterval in)
r_OQL_Query & operator<<(r_Short s)
r_OQL_Query(const r_OQL_Query &q)
copy constructor
void reset_query()
resets the expandation of the query string
r_OQL_Query & operator<<(r_Sinterval in)
const char * get_parameterized_query() const
gets the parameterized query string
r_OQL_Query & operator<<(r_Char c)
const r_Set< r_GMarray * > * get_constants() const
get mdd constants
r_OQL_Query & operator<<(r_ULong ul)
r_OQL_Query(const char *s)
constructor getting the query string
r_OQL_Query & operator<<(r_UShort us)
const r_OQL_Query & operator=(const r_OQL_Query &q)
assignment operator
const char * get_query() const
gets the expanded query string
r_OQL_Query & operator<<(const char *s)
int is_update_query() const
returns true if the current query is an update / delete one
r_OQL_Query & operator<<(r_Long l)
~r_OQL_Query()
destructor
r_OQL_Query & operator<<(r_GMarray &in)
int is_insert_query() const
returns true if the current query is an insert one
int is_retrieval_query() const
returns true if the current query is an retrieval query (select)
r_OQL_Query & operator<<(r_Point pt)
r_OQL_Query()=default
default constructor
Class r_Point represents an n-dimensional point vector.
Definition: point.hh:43
The class r_Ref_Any is defined to support a reference to any type.
Definition: ref.hh:65
References of type r_Ref in many respects behave like C++ pointers but provide an additional mechanis...
Definition: ref.hh:198
The class implements a set container.
Definition: set.hh:42
The class represents an interval with lower and upper bound.
Definition: sinterval.hh:214
Transactions can be started, committed, aborted, and checkpointed.
Definition: transaction.hh:50
void r_oql_execute(r_OQL_Query &query, r_Set< r_Ref_Any > &result, r_Transaction *transaction=NULL)
The free standing function r_oql_execute is called to execute a retrieval query.
std::uint32_t r_ULong
Definition: odmgtypes.hh:38
std::uint16_t r_UShort
Definition: odmgtypes.hh:35
std::uint8_t r_Char
Definition: odmgtypes.hh:33
std::int32_t r_Long
Definition: odmgtypes.hh:37
std::int16_t r_Short
Definition: odmgtypes.hh:36