| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#pragma once |
| 22 |
|
| 23 |
#include <map> |
| 24 |
#include <string> |
| 25 |
|
| 26 |
#include "DataTypes.h" |
| 27 |
#include "Hardware/HardwareParams.h" |
| 28 |
|
| 29 |
namespace Storage |
| 30 |
{ |
| 31 |
class StorageInterface |
| 32 |
{ |
| 33 |
public: |
| 34 |
|
| 35 |
StorageInterface() {}; |
| 36 |
|
| 37 |
|
| 38 |
virtual ~StorageInterface() {}; |
| 39 |
|
| 40 |
|
| 41 |
virtual void SaveHardwareParams(const Hardware::HardwareParams& hardwareParams) = 0; |
| 42 |
|
| 43 |
|
| 44 |
virtual void AllHardwareParams(std::map<ControlID,Hardware::HardwareParams*>& hardwareParams) = 0; |
| 45 |
|
| 46 |
|
| 47 |
virtual void DeleteHardwareParams(const ControlID controlID) = 0; |
| 48 |
|
| 49 |
|
| 50 |
virtual void SaveObject(const ObjectType objectType, const ObjectID objectID, const std::string& name, const std::string& object) = 0; |
| 51 |
|
| 52 |
|
| 53 |
virtual void DeleteObject(const ObjectType objectType, const ObjectID objectID) = 0; |
| 54 |
|
| 55 |
|
| 56 |
virtual void ObjectsOfType(const ObjectType objectType, std::vector<std::string>& objects) = 0; |
| 57 |
|
| 58 |
|
| 59 |
virtual void SaveRelation(const DataModel::Relation::RelationType type, const ObjectID objectID1, const ObjectType objectType2, const ObjectID objectID2, const Priority priority, const std::string& relation) = 0; |
| 60 |
|
| 61 |
|
| 62 |
virtual void DeleteRelationsFrom(const DataModel::Relation::RelationType type, const ObjectID objectID) = 0; |
| 63 |
|
| 64 |
|
| 65 |
virtual void DeleteRelationsTo(const ObjectType objectType, const ObjectID objectID) = 0; |
| 66 |
|
| 67 |
|
| 68 |
virtual void RelationsFrom(const DataModel::Relation::RelationType type, const ObjectID objectID, std::vector<std::string>& relations) = 0; |
| 69 |
|
| 70 |
|
| 71 |
virtual void RelationsTo(const ObjectType objectType, const ObjectID objectID, std::vector<std::string>& relations) = 0; |
| 72 |
|
| 73 |
|
| 74 |
virtual void SaveSetting(const std::string& key, const std::string& value) = 0; |
| 75 |
|
| 76 |
|
| 77 |
virtual std::string GetSetting(const std::string& key) = 0; |
| 78 |
|
| 79 |
|
| 80 |
virtual void StartTransaction() {} |
| 81 |
|
| 82 |
|
| 83 |
virtual void CommitTransaction() {} |
| 84 |
}; |
| 85 |
} |
| 86 |
|