summaryrefslogtreecommitdiff
path: root/src/database/database.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-06-20 21:19:26 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-06-20 21:19:26 +0200
commite44feb85763c5dbae66beb51892d8dda2126e04c (patch)
tree965ed12eee66d34069a700c1310ddf8d298709f9 /src/database/database.hpp
parent48f2682eb7ee72b0f9e6f2922569fcf352f8ce5f (diff)
Changed the structure of the database to reduce compilation time and save memory
Diffstat (limited to 'src/database/database.hpp')
-rw-r--r--src/database/database.hpp14
1 files changed, 7 insertions, 7 deletions
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<std::string,size_t>;
- using ParametersPtr = const Parameters*;
+ using Parameters = std::unordered_map<std::string, size_t>;
// Structures for content inside the database
struct DatabaseDevice {
std::string name;
- Parameters parameters;
+ std::vector<size_t> parameters; // parameter values
};
struct DatabaseVendor {
std::string type;
@@ -60,6 +59,7 @@ class Database {
struct DatabaseEntry {
std::string kernel;
Precision precision;
+ std::vector<std::string> parameter_names;
std::vector<DatabaseVendor> 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<DatabaseEntry> &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<DatabaseEntry> &db) const;
// Found parameters suitable for this device/kernel
std::shared_ptr<Parameters> parameters_;