23 #ifndef _IGNITE_CACHE_QUERY_QUERY_SQL 24 #define _IGNITE_CACHE_QUERY_QUERY_SQL 30 #include <ignite/impl/cache/query/query_argument.h> 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<impl::cache::query::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<impl::cache::query::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;
244 args.push_back(
new impl::cache::query::QueryArgument<T>(arg));
252 std::vector<impl::cache::query::QueryArgumentBase*>::iterator iter;
253 for (iter = args.begin(); iter != args.end(); ++iter)
271 writer.
WriteInt32(static_cast<int32_t>(args.size()));
273 std::vector<impl::cache::query::QueryArgumentBase*>::const_iterator it;
275 for (it = args.begin(); it != args.end(); ++it)
276 (*it)->Write(writer);
297 bool distributedJoins;
300 std::vector<impl::cache::query::QueryArgumentBase*> args;
306 #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
void ClearArguments()
Remove all added arguments.
Definition: query_sql.h:250
Sql query.
Definition: query_sql.h:42
void WriteString(const char *val)
Write string.
Definition: binary_raw_writer.cpp:152
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:264
const std::string & GetType() const
Get type name.
Definition: query_sql.h:134
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:48
const std::string & GetSql() const
Get SQL string.
Definition: query_sql.h:154
SqlQuery(const std::string &type, const std::string &sql)
Constructor.
Definition: query_sql.h:51