7 #include <redis3m/utils/exception.h>
8 #include <redis3m/reply.h>
10 #include <boost/shared_ptr.hpp>
11 #include <boost/noncopyable.hpp>
12 #include <boost/assign/list_of.hpp>
17 REDIS3M_EXCEPTION(unable_to_connect)
18 REDIS3M_EXCEPTION(transport_failure)
22 extern boost::assign_detail::generic_list<std::
string>(&command)(const std::
string&);
30 typedef boost::shared_ptr<connection> ptr_t;
38 inline static ptr_t
create(
const std::string& host=
"localhost",
39 const unsigned int port=6379)
52 void append(
const std::vector<std::string>& args);
66 std::vector<reply> get_replies(
unsigned int count);
73 inline reply run(
const std::vector<std::string>& args)
85 inline redisContext*
c_ptr() {
return c; }
94 friend class connection_pool;
95 connection(
const std::string& host,
const unsigned int port);
static ptr_t create(const std::string &host="localhost", const unsigned int port=6379)
Create and open a new connection.
Definition: connection.h:38
reply run(const std::vector< std::string > &args)
Utility to call append and then get_reply together.
Definition: connection.h:73
The connection class, represent a connection to a Redis server.
Definition: connection.h:27
Represent a reply received from redis server.
Definition: reply.h:18
redisContext * c_ptr()
Returns raw ptr to hiredis library connection. Use it with caution and pay attention on memory manage...
Definition: connection.h:85