23 #ifndef _IGNITE_CACHE_QUERY_QUERY_SQL
24 #define _IGNITE_CACHE_QUERY_QUERY_SQL
51 SqlQuery(
const std::string& type,
const std::string& sql) :
56 distributedJoins(false),
70 pageSize(other.pageSize),
72 distributedJoins(other.distributedJoins),
75 args.reserve(other.args.size());
77 typedef std::vector<QueryArgumentBase*>::const_iterator Iter;
79 for (Iter i = other.args.begin(); i != other.args.end(); ++i)
80 args.push_back((*i)->Copy());
105 typedef std::vector<QueryArgumentBase*>::const_iterator Iter;
107 for (Iter it = args.begin(); it != args.end(); ++it)
120 std::swap(type, other.type);
121 std::swap(sql, other.sql);
122 std::swap(pageSize, other.pageSize);
123 std::swap(loc, other.loc);
124 std::swap(distributedJoins, other.distributedJoins);
125 std::swap(args, other.args);
186 this->pageSize = pageSize;
216 return distributedJoins;
229 distributedJoins = enabled;
259 writer.
WriteInt32(static_cast<int32_t>(args.size()));
261 for (std::vector<QueryArgumentBase*>::const_iterator it = args.begin(); it != args.end(); ++it)
262 (*it)->Write(writer);
281 bool distributedJoins;
284 std::vector<QueryArgumentBase*> args;
290 #endif //_IGNITE_CACHE_QUERY_QUERY_SQL
int32_t GetPageSize() const
Get page size.
Definition: query_sql.h:174
Declares ignite::binary::BinaryRawWriter class.
void SetDistributedJoins(bool enabled)
Specify if distributed joins are enabled for this query.
Definition: query_sql.h:227
void WriteInt32(int32_t val)
Write 32-byte signed integer.
Definition: binary_raw_writer.cpp:72
SqlQuery & operator=(const SqlQuery &other)
Assignment operator.
Definition: query_sql.h:88
Sql query.
Definition: query_sql.h:42
void WriteString(const char *val)
Write string.
Definition: binary_raw_writer.cpp:142
void SetPageSize(int32_t pageSize)
Set page size.
Definition: query_sql.h:184
void SetLocal(bool loc)
Set local flag.
Definition: query_sql.h:204
void Write(binary::BinaryRawWriter &writer) const
Write query info to the stream.
Definition: query_sql.h:252
const std::string & GetType() const
Get type name.
Definition: query_sql.h:134
Declares ignite::cache::query::QueryArgument class template and ignite::cache::query::QueryArgumentBa...
bool IsDistributedJoins() const
Check if distributed joins are enabled for this query.
Definition: query_sql.h:214
Binary raw writer.
Definition: binary_raw_writer.h:55
void SetSql(const std::string &sql)
Set SQL string.
Definition: query_sql.h:164
void SetType(const std::string &type)
Set type name.
Definition: query_sql.h:144
void AddArgument(const T &arg)
Add argument.
Definition: query_sql.h:242
void WriteBool(bool val)
Write bool.
Definition: binary_raw_writer.cpp:42
bool IsLocal() const
Get local flag.
Definition: query_sql.h:194
void Swap(SqlQuery &other)
Efficiently swaps contents with another SqlQuery instance.
Definition: query_sql.h:116
SqlQuery(const SqlQuery &other)
Copy constructor.
Definition: query_sql.h:67
~SqlQuery()
Destructor.
Definition: query_sql.h:103
Apache Ignite API.
Definition: cache.h:43
const std::string & GetSql() const
Get SQL string.
Definition: query_sql.h:154
Query argument class template.
Definition: query_argument.h:72
SqlQuery(const std::string &type, const std::string &sql)
Constructor.
Definition: query_sql.h:51