Added private class for Client and created template for Command class.
This commit is contained in:
parent
ef1a76349c
commit
1a9f124d42
|
|
@ -2,19 +2,46 @@
|
||||||
#define QREDIS_CLIENT_H
|
#define QREDIS_CLIENT_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QScopedPointer>
|
||||||
|
|
||||||
|
#include <qredis/command.h>
|
||||||
#include "qredis_export.h"
|
#include "qredis_export.h"
|
||||||
|
|
||||||
namespace QRedis
|
namespace QRedis
|
||||||
{
|
{
|
||||||
|
class QREDIS_EXPORT ClientPrivate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Provides access to a Redis server.
|
||||||
|
*/
|
||||||
class QREDIS_EXPORT Client : public QObject
|
class QREDIS_EXPORT Client : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Connects to a Redis server.
|
||||||
|
*/
|
||||||
Client();
|
Client();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disconnects from the Redis server.
|
||||||
|
*/
|
||||||
virtual ~Client();
|
virtual ~Client();
|
||||||
|
|
||||||
|
void connectToHost();
|
||||||
|
void disconnectFromHost();
|
||||||
|
|
||||||
|
Command * sendCommand();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
void connected();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
const QScopedPointer<ClientPrivate> d;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef QREDIS_COMMAND_H
|
||||||
|
#define QREDIS_COMMAND_H
|
||||||
|
|
||||||
|
#include "qredis_export.h"
|
||||||
|
|
||||||
|
namespace QRedis
|
||||||
|
{
|
||||||
|
class QREDIS_EXPORT Command
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
//...
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // QREDIS_COMMAND_H
|
||||||
|
|
@ -1,11 +1,21 @@
|
||||||
#include <qredis/client.h>
|
#include <qredis/client.h>
|
||||||
|
#include "client_p.h"
|
||||||
|
|
||||||
using namespace QRedis;
|
using namespace QRedis;
|
||||||
|
|
||||||
Client::Client()
|
Client::Client()
|
||||||
|
: d(new ClientPrivate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Client::~Client()
|
Client::~Client()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Client::connectToHost()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client::disconnectFromHost()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef QREDIS_CLIENT_P_H
|
||||||
|
#define QREDIS_CLIENT_P_H
|
||||||
|
|
||||||
|
#include <QTcpSocket>
|
||||||
|
|
||||||
|
namespace QRedis
|
||||||
|
{
|
||||||
|
class ClientPrivate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
QTcpSocket socket;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // QREDIS_CLIENT_H
|
||||||
Loading…
Reference in New Issue