TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Types | Public Member Functions | Friends | List of all members
cpid::RedisReply Class Reference

Wrapper class for redisReply from Hiredis. More...

#include <redisclient.h>

Public Types

using Iterator = std::vector< RedisReply >::iterator
 

Public Member Functions

 RedisReply ()=default
 
 RedisReply (RedisReply const &)=delete
 
 RedisReply (RedisReply &&other)
 
 ~RedisReply ()
 
RedisReplyoperator= (RedisReply const &)=delete
 
RedisReplyoperator= (RedisReply &&other)
 
bool isString () const
 
bool isArray () const
 
bool isInteger () const
 
bool isNil () const
 
bool isStatus () const
 
bool isError () const
 
std::string string () const
 
std::string_view stringv () const
 
std::vector< std::string_view > stringvs () const
 Convenience method for array replies consisting of strings. More...
 
int64_t integer () const
 
std::string status () const
 
std::string_view statusv () const
 
std::string error () const
 
bool ok () const
 
size_t size () const
 
RedisReplyat (size_t index)
 
Iterator begin ()
 
Iterator end ()
 

Friends

class RedisClient
 

Detailed Description

Wrapper class for redisReply from Hiredis.

This class provides a typed interface to replies from a Redis server. Replies can be nested, so there's some basic functionality to access data in array replies (size()/at()/begin()/end()). Nested replies can only be accessed by reference; if the top-level reply is destructed the nested replies will be destructed as well.

If the type of the underlying reply is not the type expected by a function (e.g. calling string() on a reply holding an integer), you'll get runtime_error exceptions.

Member Typedef Documentation

using cpid::RedisReply::Iterator = std::vector<RedisReply>::iterator

Constructor & Destructor Documentation

cpid::RedisReply::RedisReply ( )
default
cpid::RedisReply::RedisReply ( RedisReply const &  )
delete
cpid::RedisReply::RedisReply ( RedisReply &&  other)
cpid::RedisReply::~RedisReply ( )

Member Function Documentation

RedisReply & cpid::RedisReply::at ( size_t  index)
RedisReply::Iterator cpid::RedisReply::begin ( )
RedisReply::Iterator cpid::RedisReply::end ( )
std::string cpid::RedisReply::error ( ) const
int64_t cpid::RedisReply::integer ( ) const
bool cpid::RedisReply::isArray ( ) const
bool cpid::RedisReply::isError ( ) const
bool cpid::RedisReply::isInteger ( ) const
bool cpid::RedisReply::isNil ( ) const
bool cpid::RedisReply::isStatus ( ) const
bool cpid::RedisReply::isString ( ) const
bool cpid::RedisReply::ok ( ) const
RedisReply& cpid::RedisReply::operator= ( RedisReply const &  )
delete
RedisReply & cpid::RedisReply::operator= ( RedisReply &&  other)
size_t cpid::RedisReply::size ( ) const
std::string cpid::RedisReply::status ( ) const
std::string_view cpid::RedisReply::statusv ( ) const
std::string cpid::RedisReply::string ( ) const
std::string_view cpid::RedisReply::stringv ( ) const
std::vector< std::string_view > cpid::RedisReply::stringvs ( ) const

Convenience method for array replies consisting of strings.

Friends And Related Function Documentation

friend class RedisClient
friend

The documentation for this class was generated from the following files: