Poco::Redis

class RedisType

Library: Redis
Package: Redis
Header: Poco/Redis/Type.h

Description

Base class for all Redis types. This class makes it possible to store element with different types in Array.

Inheritance

Known Derived Classes: Type

Member Summary

Member Functions: createRedisType, isArray, isBulkString, isError, isInteger, isSimpleString, read, toString, type

Types Aliases

Ptr

using Ptr = SharedPtr < RedisType >;

Enumerations

Types

REDIS_INTEGER

Redis Integer

REDIS_SIMPLE_STRING

Redis Simple String

REDIS_BULK_STRING

Redis Bulkstring

REDIS_ARRAY

REDIS_ERROR

Constructors

RedisType

RedisType();

Creates the RedisType.

Destructor

~RedisType virtual

virtual ~RedisType();

Destroys the RedisType.

Member Functions

createRedisType static

static RedisType::Ptr createRedisType(
    char marker
);

Create a Redis type based on the marker:

  • '+': a simple string (std::string)
  • '-': an error (Error)
  • '$': a bulk string (BulkString)
  • '*': an array (Array)
  • ':': a signed 64 bit integer (Int64)

isArray inline

bool isArray() const;

Returns true when the value is a Redis array.

isBulkString inline

bool isBulkString() const;

Returns true when the value is a Redis bulkstring.

isError inline

bool isError() const;

Returns true when the value is a Redis error.

isInteger inline

bool isInteger() const;

Returns true when the value is a Redis integer (64 bit integer).

isSimpleString inline

bool isSimpleString() const;

Returns true when the value is a simple string.

read virtual

virtual void read(
    RedisInputStream & input
) = 0;

Reads the value from the stream.

toString virtual

virtual std::string toString() const = 0;

Converts the value to a RESP (REdis Serialization Protocol) string.

type virtual

virtual int type() const = 0;

Returns the type of the value.