 |
GridGain C++
|
Go to the documentation of this file.
22 #ifndef _IGNITE_CACHE_QUERY_QUERY_SQL
23 #define _IGNITE_CACHE_QUERY_QUERY_SQL
29 #include <ignite/impl/writable_object.h>
52 SqlQuery(
const std::string& type,
const std::string& sql) :
57 distributedJoins(false),
71 pageSize(other.pageSize),
73 distributedJoins(other.distributedJoins),
76 args.reserve(other.args.size());
78 typedef std::vector<impl::WritableObjectBase*>::const_iterator Iter;
80 for (Iter i = other.args.begin(); i != other.args.end(); ++i)
81 args.push_back((*i)->Copy());
106 typedef std::vector<impl::WritableObjectBase*>::const_iterator Iter;
108 for (Iter it = args.begin(); it != args.end(); ++it)
121 std::swap(type, other.type);
122 std::swap(sql, other.sql);
123 std::swap(pageSize, other.pageSize);
124 std::swap(loc, other.loc);
125 std::swap(distributedJoins, other.distributedJoins);
126 std::swap(args, other.args);
187 this->pageSize = pageSize;
219 return distributedJoins;
232 distributedJoins = enabled;
247 args.push_back(
new impl::WritableObject<T>(arg));
255 std::vector<impl::WritableObjectBase*>::iterator iter;
256 for (iter = args.begin(); iter != args.end(); ++iter)
274 writer.
WriteInt32(
static_cast<int32_t
>(args.size()));
276 std::vector<impl::WritableObjectBase*>::const_iterator it;
278 for (it = args.begin(); it != args.end(); ++it)
279 (*it)->Write(writer);
300 bool distributedJoins;
303 std::vector<impl::WritableObjectBase*> args;
309 #endif //_IGNITE_CACHE_QUERY_QUERY_SQL
void SetType(const std::string &type)
Set type name.
Definition: query_sql.h:145
void SetPageSize(int32_t pageSize)
Set page size.
Definition: query_sql.h:185
Ignite API.
Definition: cache.h:47
~SqlQuery()
Destructor.
Definition: query_sql.h:104
void WriteInt32(int32_t val)
Write 32-byte signed integer.
Definition: binary_raw_writer.cpp:71
const std::string & GetType() const
Get type name.
Definition: query_sql.h:135
SqlQuery & operator=(const SqlQuery &other)
Assignment operator.
Definition: query_sql.h:89
SqlQuery(const SqlQuery &other)
Copy constructor.
Definition: query_sql.h:68
int32_t GetPageSize() const
Get page size.
Definition: query_sql.h:175
void SetLocal(bool loc)
Set local flag.
Definition: query_sql.h:207
void AddArgument(const T &arg)
Add argument.
Definition: query_sql.h:245
Binary raw writer.
Definition: binary_raw_writer.h:61
const std::string & GetSql() const
Get SQL string.
Definition: query_sql.h:155
void SetSql(const std::string &sql)
Set SQL string.
Definition: query_sql.h:165
void Write(binary::BinaryRawWriter &writer) const
Write query info to the stream.
Definition: query_sql.h:267
void Swap(SqlQuery &other)
Efficiently swaps contents with another SqlQuery instance.
Definition: query_sql.h:117
void WriteString(const char *val)
Write string.
Definition: binary_raw_writer.cpp:151
bool IsLocal() const
Get local flag.
Definition: query_sql.h:195
void WriteBool(bool val)
Write bool.
Definition: binary_raw_writer.cpp:41
void ClearArguments()
Remove all added arguments.
Definition: query_sql.h:253
void SetDistributedJoins(bool enabled)
Specify if distributed joins are enabled for this query.
Definition: query_sql.h:230
bool IsDistributedJoins() const
Check if distributed joins are enabled for this query.
Definition: query_sql.h:217
SqlQuery(const std::string &type, const std::string &sql)
Constructor.
Definition: query_sql.h:52
Sql query.
Definition: query_sql.h:43