2 #include "../acl_cpp_define.hpp" 3 #include "../stdlib/noncopyable.hpp" 4 #include "../stdlib/tbox.hpp" 10 #if !defined(ACL_CLIENT_ONLY) && !defined(ACL_REDIS_DISABLE) 17 class redis_client_cluster;
18 class redis_client_pipeline;
19 class redis_pipeline_message;
72 void set_check_addr(
bool on);
86 void clear(
bool save_slot =
false);
89 void reset(
bool save_slot =
false);
122 const char* get_client_addr(
void)
const;
191 const char* result_status(
void)
const;
200 const char* result_error(
void)
const;
218 size_t result_size(
void)
const;
228 int result_number(
bool* success = NULL)
const;
238 long long int result_number64(
bool* success = NULL)
const;
250 const char* get_result(
size_t i,
size_t* len = NULL)
const;
259 bool eof(
void)
const;
298 const char* result_value(
size_t i,
size_t* len = NULL)
const;
310 void set_slice_request(
bool on);
323 void set_slice_respond(
bool on);
334 const redis_result* request(
size_t argc,
const char* argv[],
335 size_t lens[],
size_t nchild = 0);
343 const redis_result* request(
const std::vector<string>& args,
358 static void build_request(
size_t argc,
const char* argv[],
359 size_t lens[],
string& out);
367 void build_request(
size_t argc,
const char* argv[],
size_t lens[]);
370 const redis_result* run(
size_t nchild = 0,
int* timeout = NULL);
372 void clear_request(
void);
373 const redis_result** scan_keys(
const char* cmd,
const char* key,
374 int& cursor,
size_t& size,
const char* pattern,
375 const size_t* count);
376 const redis_result** scan_keys(
const char* cmd,
const char* key,
377 size_t klen,
int& cursor,
size_t& size,
const char* pattern,
378 const size_t* count);
382 void build(
const char* cmd,
const char* key,
383 const std::map<string, string>& attrs);
384 void build(
const char* cmd,
const char* key,
size_t klen,
385 const std::map<string, string>& attrs);
386 void build(
const char* cmd,
const char* key,
387 const std::map<string, const char*>& attrs);
389 void build(
const char* cmd,
const char* key,
390 const std::vector<string>& names,
391 const std::vector<string>& values);
392 void build(
const char* cmd,
const char* key,
size_t klen,
393 const std::vector<string>& names,
394 const std::vector<string>& values);
395 void build(
const char* cmd,
const char* key,
396 const std::vector<const char*>& names,
397 const std::vector<const char*>& values);
399 void build(
const char* cmd,
const char* key,
400 const char* names[],
const char* values[],
size_t argc);
401 void build(
const char* cmd,
const char* key,
402 const int names[],
const char* values[],
size_t argc);
403 void build(
const char* cmd,
const char* key,
404 const char* names[],
const size_t names_len[],
405 const char* values[],
const size_t values_len[],
size_t argc);
406 void build(
const char* cmd,
const char* key,
size_t klen,
407 const char* names[],
const size_t names_len[],
408 const char* values[],
const size_t values_len[],
size_t argc);
412 void build(
const char* cmd,
const char* key,
413 const std::vector<string>& names);
414 void build(
const char* cmd,
const char* key,
size_t klen,
415 const std::vector<string>& names);
416 void build(
const char* cmd,
const char* key,
417 const std::vector<const char*>& names);
418 void build(
const char* cmd,
const char* key,
419 const std::vector<int>& names);
421 void build(
const char* cmd,
const char* key,
422 const char* names[],
size_t argc);
423 void build(
const char* cmd,
const char* key,
424 const char* names[],
const size_t lens[],
size_t argc);
425 void build(
const char* cmd,
const char* key,
size_t klen,
426 const char* names[],
const size_t lens[],
size_t argc);
427 void build(
const char* cmd,
const char* key,
428 const int names[],
size_t argc);
433 int get_number(
bool* success = NULL);
434 long long int get_number64(
bool* success = NULL);
435 int get_number(std::vector<int>& out);
436 int get_number64(std::vector<long long int>& out);
437 bool check_status(
const char* success =
"OK");
439 int get_status(std::vector<bool>& out);
440 const char* get_status(
void);
442 int get_string(
string& buf);
443 int get_string(
string* buf);
444 int get_string(
char* buf,
size_t size);
445 int get_strings(std::vector<string>& result);
446 int get_strings(std::vector<string>* result);
447 int get_strings(std::list<string>& result);
448 int get_strings(std::list<string>* result);
449 int get_strings(std::map<string, string>& result);
450 int get_strings(std::vector<string>& names,
451 std::vector<string>& values);
452 int get_strings(std::vector<const char*>& names,
453 std::vector<const char*>& values);
465 void hash_slot(
const char* key);
466 void hash_slot(
const char* key,
size_t len);
489 const char* get_addr(
const char* info);
490 void set_client_addr(
const char* addr);
520 void argv_space(
size_t n);
523 void build_request1(
size_t argc,
const char* argv[],
size_t lens[]);
526 void build_request2(
size_t argc,
const char* argv[],
size_t lens[]);
540 #endif // !defined(ACL_CLIENT_ONLY) && !defined(ACL_REDIS_DISABLE)
const string * request_buf(void) const
#define ACL_CPP_DEPRECATED
redis_request * get_request_obj(void) const
dbuf_pool * get_dbuf(void) const
redis_client * get_client(void) const
bool is_check_addr(void) const
redis_client_cluster * get_cluster(void) const
const redis_result * result_
string * get_request_buf(void) const
redis_client_pipeline * get_pipeline(void) const
#define ACL_CPP_DEPRECATED_FOR(f)
bool is_slice_req(void) const
redis_pipeline_message * pipe_msg_
redis_request * request_obj_
redis_client_pipeline * pipeline_
redis_client_cluster * cluster_