GridGain C++ Client Library
query_text.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) GridGain Systems. All Rights Reserved.
3 * _________ _____ __________________ _____
4 * __ ____/___________(_)______ /__ ____/______ ____(_)_______
5 * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
6 * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
7 * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
8 */
9 
15 #ifndef _GRIDGAIN_CACHE_QUERY_TEXT
16 #define _GRIDGAIN_CACHE_QUERY_TEXT
17 
18 #include <stdint.h>
19 #include <string>
20 
22 
23 namespace gridgain
24 {
25  namespace cache
26  {
27  namespace query
28  {
32  class TextQuery
33  {
34  public:
41  TextQuery(const std::string& type, const std::string& text) : type(type), text(text), pageSize(1024), loc(false)
42  {
43  // No-op.
44  }
45 
51  const std::string& GetType() const
52  {
53  return type;
54  }
55 
61  void SetType(const std::string& type)
62  {
63  this->type = type;
64  }
65 
71  const std::string& GetText() const
72  {
73  return text;
74  }
75 
81  void SetText(const std::string& text)
82  {
83  this->text = text;
84  }
85 
91  int32_t GetPageSize() const
92  {
93  return pageSize;
94  }
95 
101  void SetPageSize(int32_t pageSize)
102  {
103  this->pageSize = pageSize;
104  }
105 
111  bool IsLocal() const
112  {
113  return loc;
114  }
115 
121  void SetLocal(bool loc)
122  {
123  this->loc = loc;
124  }
125 
131  void Write(portable::PortableRawWriter& writer) const
132  {
133  writer.WriteBool(loc);
134  writer.WriteString(text);
135  writer.WriteString(type);
136  writer.WriteInt32(pageSize);
137  }
138 
139  private:
141  std::string type;
142 
144  std::string text;
145 
147  int32_t pageSize;
148 
150  bool loc;
151  };
152  }
153  }
154 }
155 
156 #endif
void SetType(const std::string &type)
Set type name.
Definition: query_text.h:61
void SetText(const std::string &text)
Set text string.
Definition: query_text.h:81
bool IsLocal() const
Get local flag.
Definition: query_text.h:111
Text query.
Definition: query_text.h:32
void WriteInt32(int32_t val)
Write 32-byte signed integer.
Definition: portable_raw_writer.cpp:64
const std::string & GetText() const
Get text string.
Definition: query_text.h:71
int32_t GetPageSize() const
Get page size.
Definition: query_text.h:91
TextQuery(const std::string &type, const std::string &text)
Constructor.
Definition: query_text.h:41
void Write(portable::PortableRawWriter &writer) const
Write query info to the stream.
Definition: query_text.h:131
void WriteString(const char *val)
Write string.
Definition: portable_raw_writer.cpp:114
void WriteBool(bool val)
Write bool.
Definition: portable_raw_writer.cpp:34
void SetLocal(bool loc)
Set local flag.
Definition: query_text.h:121
const std::string & GetType() const
Get type name.
Definition: query_text.h:51
void SetPageSize(int32_t pageSize)
Set page size.
Definition: query_text.h:101
Declares gridgain::portable::PortableRawWriter class.
Portable raw writer.
Definition: portable_raw_writer.h:34
GridGain API.
Definition: cache.h:35