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 
80  r_OQL_Query(const r_OQL_Query &q);
81 
83  ~r_OQL_Query();
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;
129  const r_Set<r_GMarray *> *get_constants() 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
r_OQL_Query::~r_OQL_Query
~r_OQL_Query()
destructor
r_Short
std::int16_t r_Short
Definition: odmgtypes.hh:36
r_OQL_Query::r_OQL_Query
r_OQL_Query()=default
default constructor
r_ULong
std::uint32_t r_ULong
Definition: odmgtypes.hh:38
r_Ref_Any
The class r_Ref_Any is defined to support a reference to any type.
Definition: ref.hh:64
r_OQL_Query::is_retrieval_query
int is_retrieval_query() const
returns true if the current query is an retrieval query (select)
r_Ref
References of type r_Ref in many respects behave like C++ pointers but provide an additional mechanis...
Definition: collection.hh:196
r_Char
std::uint8_t r_Char
Definition: odmgtypes.hh:33
r_Long
std::int32_t r_Long
Definition: odmgtypes.hh:37
r_OQL_Query::is_update_query
int is_update_query() const
returns true if the current query is an update / delete one
r_OQL_Query::reset_query
void reset_query()
resets the expandation of the query string
r_OQL_Query::get_parameterized_query
const char * get_parameterized_query() const
gets the parameterized query string
r_Point
Class r_Point represents an n-dimensional point vector.
Definition: point.hh:42
r_UShort
std::uint16_t r_UShort
Definition: odmgtypes.hh:35
r_Set
The class implements a set container.
Definition: oqlquery.hh:31
r_Transaction
Transactions can be started, committed, aborted, and checkpointed.
Definition: transaction.hh:49
odmgtypes.hh
r_OQL_Query::get_query
const char * get_query() const
gets the expanded query string
r_OQL_Query::operator<<
r_OQL_Query & operator<<(const char *s)
r_GMarray
The class represents a generic MDD in the sense that it is independent of the cell base type.
Definition: gmarray.hh:65
r_Minterval
The spatial domain of an MDD is represented by an object of class r_Minterval.
Definition: minterval.hh:225
r_oql_execute
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.
r_OQL_Query::operator=
const r_OQL_Query & operator=(const r_OQL_Query &q)
assignment operator
r_OQL_Query::get_constants
const r_Set< r_GMarray * > * get_constants() const
get mdd constants
r_Sinterval
The class represents an interval with lower and upper bound.
Definition: sinterval.hh:213
r_OQL_Query::is_insert_query
int is_insert_query() const
returns true if the current query is an insert one
r_OQL_Query
The global function r_oql_execute() is used to invoke RasML queries.
Definition: oqlquery.hh:70