Added private class for Client and created template for Command class.

This commit is contained in:
Nathan Osman 2013-06-29 12:04:01 -07:00
parent ef1a76349c
commit 1a9f124d42
4 changed files with 71 additions and 2 deletions

View File

@ -2,19 +2,46 @@
#define QREDIS_CLIENT_H
#include <QObject>
#include <QScopedPointer>
#include <qredis/command.h>
#include "qredis_export.h"
namespace QRedis
{
class QREDIS_EXPORT ClientPrivate;
/**
* @brief Provides access to a Redis server.
*/
class QREDIS_EXPORT Client : public QObject
{
Q_OBJECT
public:
/**
* @brief Connects to a Redis server.
*/
Client();
/**
* @brief Disconnects from the Redis server.
*/
virtual ~Client();
void connectToHost();
void disconnectFromHost();
Command * sendCommand();
signals:
void connected();
private:
const QScopedPointer<ClientPrivate> d;
};
}

16
include/qredis/command.h Normal file
View File

@ -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

View File

@ -1,11 +1,21 @@
#include <qredis/client.h>
#include "client_p.h"
using namespace QRedis;
Client::Client()
: d(new ClientPrivate)
{
}
Client::~Client()
{
}
void Client::connectToHost()
{
}
void Client::disconnectFromHost()
{
}

16
src/client_p.h Normal file
View File

@ -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