23 #ifndef _IGNITE_CACHE_QUERY_SQL
24 #define _IGNITE_CACHE_QUERY_SQL
51 SqlQuery(
const std::string& type,
const std::string& sql) : type(type), sql(sql), pageSize(1024),
52 loc(false), args(NULL)
62 SqlQuery(
const SqlQuery& other) : type(other.type), sql(other.sql), pageSize(other.pageSize),
63 loc(other.loc), args()
65 args.reserve(other.args.size());
67 for (std::vector<QueryArgumentBase*>::const_iterator i = other.args.begin();
68 i != other.args.end(); ++i)
69 args.push_back((*i)->Copy());
83 std::swap(type, tmp.type);
84 std::swap(sql, tmp.sql);
85 std::swap(pageSize, tmp.pageSize);
86 std::swap(loc, tmp.loc);
87 std::swap(args, tmp.args);
98 for (std::vector<QueryArgumentBase*>::iterator it = args.begin(); it != args.end(); ++it)
111 std::swap(type, other.type);
112 std::swap(sql, other.sql);
113 std::swap(pageSize, other.pageSize);
114 std::swap(loc, other.loc);
115 std::swap(args, other.args);
176 this->pageSize = pageSize;
222 writer.
WriteInt32(static_cast<int32_t>(args.size()));
224 for (std::vector<QueryArgumentBase*>::const_iterator it = args.begin(); it != args.end(); ++it)
225 (*it)->Write(writer);
242 std::vector<QueryArgumentBase*> args;
int32_t GetPageSize() const
Get page size.
Definition: query_sql.h:164
Declares ignite::binary::BinaryRawWriter class.
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:77
Sql query.
Definition: query_sql.h:42
void WriteString(const char *val)
Write string.
Definition: binary_raw_writer.cpp:122
void SetPageSize(int32_t pageSize)
Set page size.
Definition: query_sql.h:174
void SetLocal(bool loc)
Set local flag.
Definition: query_sql.h:194
void Write(binary::BinaryRawWriter &writer) const
Write query info to the stream.
Definition: query_sql.h:215
const std::string & GetType() const
Get type name.
Definition: query_sql.h:124
Declares ignite::cache::query::QueryArgument class template and ignite::cache::query::QueryArgumentBa...
Binary raw writer.
Definition: binary_raw_writer.h:42
void SetSql(const std::string &sql)
Set SQL string.
Definition: query_sql.h:154
void SetType(const std::string &type)
Set type name.
Definition: query_sql.h:134
void AddArgument(const T &arg)
Add argument.
Definition: query_sql.h:205
void WriteBool(bool val)
Write bool.
Definition: binary_raw_writer.cpp:42
bool IsLocal() const
Get local flag.
Definition: query_sql.h:184
void Swap(SqlQuery &other)
Efficiently swaps contents with another SqlQuery instance.
Definition: query_sql.h:107
SqlQuery(const SqlQuery &other)
Copy constructor.
Definition: query_sql.h:62
~SqlQuery()
Destructor.
Definition: query_sql.h:96
Apache Ignite API.
Definition: binary_consts.h:28
const std::string & GetSql() const
Get SQL string.
Definition: query_sql.h:144
Query argument.
Definition: query_argument.h:66
SqlQuery(const std::string &type, const std::string &sql)
Constructor.
Definition: query_sql.h:51