summaryrefslogtreecommitdiff
path: root/libmysqlpp/embeddedmy-server.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-31 04:04:31 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2017-05-04 20:44:40 +0100
commitdb1e2f066393af3e58814417de5bbe7ea08a145d (patch)
tree9d01e48d8ef7d63fbcca6aced2461b3f1e234dfd /libmysqlpp/embeddedmy-server.h
parentBeginnings of embbeded MySQL (diff)
downloadlibdbpp-mysql-db1e2f066393af3e58814417de5bbe7ea08a145d.tar.bz2
libdbpp-mysql-db1e2f066393af3e58814417de5bbe7ea08a145d.tar.xz
libdbpp-mysql-db1e2f066393af3e58814417de5bbe7ea08a145d.zip
Basics working, could do with a tidy up around mocking
Diffstat (limited to 'libmysqlpp/embeddedmy-server.h')
-rw-r--r--libmysqlpp/embeddedmy-server.h45
1 files changed, 45 insertions, 0 deletions
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 <string>
+#include <vector>
+#include <boost/filesystem/path.hpp>
+#include <intrusivePtrBase.h>
+#include <boost/intrusive_ptr.hpp>
+
+namespace MySQL {
+ namespace Embedded {
+ class Server;
+
+ typedef boost::intrusive_ptr<Server> ServerPtr;
+
+ class Server : public IntrusivePtrBase {
+ public:
+ virtual ~Server();
+
+ static ServerPtr get(const boost::filesystem::path &, const std::vector<std::string> &);
+ static ServerPtr getMock(const boost::filesystem::path &);
+
+ protected:
+ Server(const boost::filesystem::path &, const std::vector<std::string> &);
+
+ const boost::filesystem::path path;
+
+ private:
+ static Server * instance;
+ };
+
+ class MockServer : public Server {
+ public:
+ MockServer(const boost::filesystem::path &);
+
+ void initialize();
+
+ public:
+ ~MockServer();
+ };
+ }
+}
+
+#endif
+