| cpp_redis 4.0.0 cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations and pipelining.

reply_builder.hpp
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2015-2017 Simon Ninon <simon.ninon@gmail.com>
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in all
13 // copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 // SOFTWARE.
22
23 #pragma once
24
25 #include <deque>
26 #include <memory>
27 #include <stdexcept>
28 #include <string>
29
30 #include <cpp_redis/builders/builder_iface.hpp>
31 #include <cpp_redis/core/reply.hpp>
32
33 namespace cpp_redis {
34
35 namespace builders {
36
40 class reply_builder {
41 public:
43 reply_builder(void);
45 ~reply_builder(void) = default;
46
48 reply_builder(const reply_builder&) = delete;
50 reply_builder& operator=(const reply_builder&) = delete;
51
52 public:
60 reply_builder& operator<<(const std::string& data);
61
67 void operator>>(reply& reply);
68
72 const reply& get_front(void) const;
73
77 void pop_front(void);
78
82 bool reply_available(void) const;
83
84 private:
90 bool build_reply(void);
91
92 private:
96 std::string m_buffer;
97
101 std::unique_ptr<builder_iface> m_builder;
102
106 std::deque<reply> m_available_replies;
107 };
108
109 } // namespace builders
110
111 } // namespace cpp_redis
cpp_redis::builders::reply_builder::reply_builder
reply_builder(void)
ctor
cpp_redis::builders::reply_builder::pop_front
void pop_front(void)
cpp_redis::builders::reply_builder::~reply_builder
~reply_builder(void)=default
dtor
cpp_redis::builders::reply_builder::operator<<
reply_builder & operator<<(const std::string &data)
cpp_redis::reply
Definition: reply.hpp:37
cpp_redis::builders::reply_builder
Definition: reply_builder.hpp:40
cpp_redis::builders::reply_builder::get_front
const reply & get_front(void) const
cpp_redis::builders::reply_builder::reply_available
bool reply_available(void) const
cpp_redis::builders::reply_builder::operator>>
void operator>>(reply &reply)
cpp_redis
Definition: array_builder.hpp:29
cpp_redis::builders::reply_builder::operator=
reply_builder & operator=(const reply_builder &)=delete
assignment operator