Arduino-Redis
A Redis library for Arduino.
|
A basic object model for the Redis serialization protocol (RESP): https://redis.io/topics/protocol
Definition at line 25 of file RedisInternal.h.
Public Types | |
enum | Type { NoType = '\0', SimpleString = '+', Error = '-', Integer = ':', BulkString = '$', Array = '*', InternalError = '!' } |
Public Member Functions | |
RedisObject (Type tc) | |
RedisObject (Type tc, Client &c) | |
virtual void | init (Client &client) |
virtual String | RESP ()=0 |
virtual | operator String () |
Type | type () const |
Static Public Member Functions | |
static std::shared_ptr< RedisObject > | parseType (Client &) |
Protected Attributes | |
String | data |
Type | _type = Type::NoType |
#include <RedisInternal.h>
enum RedisObject::Type |
Denote a basic Redis type, with NoType and InternalError defined specifically for this API
Definition at line 28 of file RedisInternal.h.
|
virtual |
Initialize a RedisObject instance from the bytestream represented by 'client'. Only does very basic (e.g. SimpleString-style) parsing of the object from the byte stream. Concrete subclasses are expected to override this to provide class-specific parsing & initialization logic.
Reimplemented in RedisArray, and RedisBulkString.
Definition at line 31 of file RedisInternal.cpp.
|
inlinevirtual |
Produce a human-readable String representation. Base implementation only returns the type character, so should be overriden.
Definition at line 58 of file RedisInternal.h.
|
pure virtual |
Produce the Redis serialization protocol (RESP) representation. Must be overridden.
Implemented in RedisInternalError, RedisArray, RedisBulkString, and RedisSimpleString.