Commits

Palmer, 2E0EOL committed 95e7028

Initial draft, this compiles but does nothing.

Comments (0)

Files changed (4)

+/*
+  This is the base class, which does the real work for the database,
+  at present, is is just a back-end which does nothing, except provide
+  a basis to demonstrate the rest of the library.
+*/
+
+#include "DB.hpp"
+
+int DB::query(const std::string &Query)
+{
+	return false; // FIXME: Everything fails.
+}
+
+int DB::is_mock()
+{
+	// This base class is always non-mock, see DBMock for overridden mockery.
+	return false;
+}
+#include <string>
+
+class DB
+{
+private:
+	int dbh, dbh_ro; // Handles to master and slave database
+protected:
+public:
+	int is_mock(void);
+	int query(const std::string &Query);
+};
+concept : concept.o DB.o
+	g++ -o concept concept.o DB.o
+
+DB.o : DB.cpp DB.hpp
+	g++ -c -o DB.o DB.cpp
+
+concept.o : concept.cpp DB.hpp
+	g++ -c -o concept.o concept.cpp
+
+test : concept
+	./concept
+
+clean:
+	rm -f *.o concept
+/*
+  This is the simple application which attempts to work with a mock database.
+*/
+
+#include "DB.hpp"
+
+int main()
+{
+	DB database;
+	database.query(
+		"SELECT e.id,enrolled,given_name,city FROM employees e, offices o "
+		"WHERE terminated IS NULL AND e.office_id=o.id"
+	);
+	return 0;
+}