From db1e2f066393af3e58814417de5bbe7ea08a145d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 31 Dec 2015 04:04:31 +0000 Subject: Basics working, could do with a tidy up around mocking --- libmysqlpp/embeddedmy-server.h | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 libmysqlpp/embeddedmy-server.h (limited to 'libmysqlpp/embeddedmy-server.h') diff --git a/libmysqlpp/embeddedmy-server.h b/libmysqlpp/embeddedmy-server.h new file mode 100644 index 0000000..a1fa7fb --- /dev/null +++ b/libmysqlpp/embeddedmy-server.h @@ -0,0 +1,45 @@ +#ifndef MYSQL_EMBEDDED_SERVER_H +#define MYSQL_EMBEDDED_SERVER_H + +#include +#include +#include +#include +#include + +namespace MySQL { + namespace Embedded { + class Server; + + typedef boost::intrusive_ptr ServerPtr; + + class Server : public IntrusivePtrBase { + public: + virtual ~Server(); + + static ServerPtr get(const boost::filesystem::path &, const std::vector &); + static ServerPtr getMock(const boost::filesystem::path &); + + protected: + Server(const boost::filesystem::path &, const std::vector &); + + const boost::filesystem::path path; + + private: + static Server * instance; + }; + + class MockServer : public Server { + public: + MockServer(const boost::filesystem::path &); + + void initialize(); + + public: + ~MockServer(); + }; + } +} + +#endif + -- cgit v1.2.3