start library rewrite in C++

This commit is contained in:
jussi 2020-03-14 12:58:21 +02:00
parent 8afe7956cb
commit 8eb738b9ff
4 changed files with 69 additions and 0 deletions

34
src/include/Device.hpp Normal file
View File

@ -0,0 +1,34 @@
#pragma once
#include <string>
#include <variant>
#include <vector>
namespace TuxClocker {
namespace Device {
template <typename T>
struct Range {
Range();
Range(const T &min_, const T &max_) {min = min_, max = max_;}
T min, max;
};
struct Enumeration {
Enumeration(const std::string &name_, const uint &key_) {name = name_; key = key_;}
std::string name;
uint key;
};
using RangeInfo = std::variant<Range<int>, Range<double>>;
using AssignableInfo = std::variant<RangeInfo, std::vector<Enumeration>>;
class Assignable {
public:
Assignable();
private:
};
};
};

9
src/include/Plugin.hpp Normal file
View File

@ -0,0 +1,9 @@
#pragma once
namespace TuxClocker {
namespace Plugin {
class DevicePlugin {
};
};

25
src/include/Tree.hpp Normal file
View File

@ -0,0 +1,25 @@
#pragma once
#include <vector>
namespace TuxClocker {
template <typename T>
class FlatTreeNode {
T value;
std::vector<int> childIndices;
};
template <typename T>
class FlatTree {
std::vector<FlatTreeNode<T>> nodes;
};
template <typename T>
class TreeNode {
private:
T value;
std::vector<TreeNode<T>> children;
};
};

1
src/plugins/AMD.cpp Normal file
View File

@ -0,0 +1 @@