15 #ifndef _GRIDGAIN_CACHE_QUERY_SQL 16 #define _GRIDGAIN_CACHE_QUERY_SQL 43 SqlQuery(
const std::string& type,
const std::string& sql) : type(type), sql(sql), pageSize(1024),
44 loc(false), args(NULL)
54 SqlQuery(
const SqlQuery& other) : type(other.type), sql(other.sql), pageSize(other.pageSize),
55 loc(other.loc), args()
57 args.reserve(other.args.size());
59 for (std::vector<QueryArgumentBase*>::const_iterator i = other.args.begin(); i != other.args.end(); ++i)
61 args.push_back((*i)->Copy());
87 for (std::vector<QueryArgumentBase*>::iterator it = args.begin(); it != args.end(); ++it)
100 std::swap(type, other.type);
101 std::swap(sql, other.sql);
102 std::swap(pageSize, other.pageSize);
103 std::swap(loc, other.loc);
104 std::swap(args, other.args);
165 this->pageSize = pageSize;
211 writer.
WriteInt32(static_cast<int32_t>(args.size()));
213 for (std::vector<QueryArgumentBase*>::const_iterator it = args.begin(); it != args.end(); ++it)
214 (*it)->Write(writer);
233 std::vector<QueryArgumentBase*> args;
void Write(portable::PortableRawWriter &writer) const
Write query info to the stream.
Definition: query_sql.h:204
Sql query.
Definition: query_sql.h:34
void WriteInt32(int32_t val)
Write 32-byte signed integer.
Definition: portable_raw_writer.cpp:64
SqlQuery(const std::string &type, const std::string &sql)
Constructor.
Definition: query_sql.h:43
void SetPageSize(int32_t pageSize)
Set page size.
Definition: query_sql.h:163
Query argument.
Definition: query_argument.h:58
void Swap(SqlQuery &other)
Efficiently swaps contents with another SqlQuery instance.
Definition: query_sql.h:96
SqlQuery(const SqlQuery &other)
Copy constructor.
Definition: query_sql.h:54
void WriteString(const char *val)
Write string.
Definition: portable_raw_writer.cpp:114
Declares gridgain::cache::query::QueryArgument class template and gridgain::cache::query::QueryArgume...
bool IsLocal() const
Get local flag.
Definition: query_sql.h:173
void WriteBool(bool val)
Write bool.
Definition: portable_raw_writer.cpp:34
int32_t GetPageSize() const
Get page size.
Definition: query_sql.h:153
void SetSql(const std::string &sql)
Set SQL string.
Definition: query_sql.h:143
void AddArgument(const T &arg)
Add argument.
Definition: query_sql.h:194
void SetType(const std::string &type)
Set type name.
Definition: query_sql.h:123
void SetLocal(bool loc)
Set local flag.
Definition: query_sql.h:183
Declares gridgain::portable::PortableRawWriter class.
~SqlQuery()
Destructor.
Definition: query_sql.h:85
Portable raw writer.
Definition: portable_raw_writer.h:34
SqlQuery & operator=(const SqlQuery &other)
Assignment operator.
Definition: query_sql.h:70
const std::string & GetType() const
Get type name.
Definition: query_sql.h:113
const std::string & GetSql() const
Get SQL string.
Definition: query_sql.h:133
GridGain API.
Definition: cache.h:35