From e44feb85763c5dbae66beb51892d8dda2126e04c Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Tue, 20 Jun 2017 21:19:26 +0200 Subject: Changed the structure of the database to reduce compilation time and save memory --- src/database/database.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/database/database.hpp') diff --git a/src/database/database.hpp b/src/database/database.hpp index 82fbc252..3f984439 100644 --- a/src/database/database.hpp +++ b/src/database/database.hpp @@ -44,13 +44,12 @@ class Database { public: // Type alias for the database parameters - using Parameters = std::unordered_map; - using ParametersPtr = const Parameters*; + using Parameters = std::unordered_map; // Structures for content inside the database struct DatabaseDevice { std::string name; - Parameters parameters; + std::vector parameters; // parameter values }; struct DatabaseVendor { std::string type; @@ -60,6 +59,7 @@ class Database { struct DatabaseEntry { std::string kernel; Precision precision; + std::vector parameter_names; std::vector vendors; }; @@ -93,10 +93,10 @@ class Database { private: // Search method for a specified database, returning pointer (possibly a nullptr) - ParametersPtr Search(const std::string &this_kernel, const std::string &this_type, - const std::string &this_vendor, const std::string &this_device, - const Precision this_precision, - const std::vector &db) const; + Parameters Search(const std::string &this_kernel, const std::string &this_type, + const std::string &this_vendor, const std::string &this_device, + const Precision this_precision, + const std::vector &db) const; // Found parameters suitable for this device/kernel std::shared_ptr parameters_; -- cgit v1.2.3