From c94d0c347fdbd8acc774df4ac17617a3f63e4507 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Sun, 9 Jul 2017 23:48:06 +0200 Subject: Delete old codebase This change removes version 1 of the OpenDC simulator codebase as it will be replaced by a complete rewrite in the Kotlin language. --- Simulator/include/database/Database.h | 78 ----------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 Simulator/include/database/Database.h (limited to 'Simulator/include/database/Database.h') diff --git a/Simulator/include/database/Database.h b/Simulator/include/database/Database.h deleted file mode 100644 index 7f867d6c..00000000 --- a/Simulator/include/database/Database.h +++ /dev/null @@ -1,78 +0,0 @@ -#pragma once -#include "simulation/Section.h" -#include "modeling/ModelingTypes.h" - -#include -#include "simulation/Experiment.h" - -namespace Database -{ - /* - The Database class provides a wrapper for the sqlite interface. - */ - class Database - { - public: - /* - Initializes a database with the given name. If it does not yet exist is creates a $name.db file. - */ - explicit Database(char* name); - - /* - Closes the database connection. - */ - ~Database(); - - /* - Starts a sqlite transaction. - */ - void startTransaction() const; - - /* - Ends a sqlite transaction. - */ - void endTransaction() const; - - /* - Writes the history of the experiment to the database. - */ - void writeExperimentHistory(Simulation::Experiment& simulation) const; - - /* - Polls the database for new simulation sections to simulate. - If there are no rows in the table, this returns -1. - */ - int pollQueuedExperiments() const; - - /* - Removes a row of the queued simulation sections. - */ - void dequeueExperiment(int id) const; - - /* - Marks the given experiment as finished in the database. - */ - void finishExperiment(int id) const; - - /* - Creates a simulation object from a simulation in the database. - */ - Simulation::Experiment createExperiment(uint32_t id); - - private: - /* - Sets the scheduler of the datacenter - */ - Simulation::Scheduler* loadScheduler(uint32_t simulationSectionId) const; - - DefaultDatacenter loadDatacenter(uint32_t datacenterId) const; - - /* - Fills the datacenter with workloads from the database. - */ - Simulation::WorkloadPool loadWorkloads(uint32_t traceId) const; - - // The sqlite db connection. - sqlite3 *db; - }; -} -- cgit v1.2.3