MVault 0.0.1
Loading...
Searching...
No Matches
VaultRecord.h
1#pragma once
2
3#include <vector>
4#include <sstream>
5#include <mutex>
6
7#include "VaultClasses.h"
8
9namespace mvlt
10{
17 class VaultRecord : public DataHashMap
18 {
19 private:
20 // Variable to store object validity
21 bool IsValid = true;
22
23 // Validity counter
24 std::size_t RefCounter = 0;
25
26 // Mutex for thread safety
27 mutable std::recursive_mutex VaultRecordMutex;
28
29 // Set with all dependent VaultRecordSets
30 std::unordered_set<VaultRecordSet*> dependentVaultRecordSets;
31
32 public:
33
35 friend Vault;
36
39
42
45
52
61
68
77
79 void AddRef() noexcept;
80
82 void RemoveRef() noexcept;
83
85 void Invalidate() noexcept;
86
92
95
102
109
120 };
121}
Iterator class for all library maps.
Definition Map.h:18
Specialization of class DataContainer, used as a type std::unordered_map<std::string,...
Definition DataContainer.h:287
A class for storing data inside Vault.
Definition VaultRecord.h:18
void AddToDependentSets(VaultRecordSet *vaultRecordSet) noexcept
A method for adding an record to a vaultRecordSet and adding a vaultRecordSet to dependent sets.
Definition VaultRecord.cpp:103
void RemoveFromDependentSets() noexcept
A method for removing record from all dependent VaultRecordSets.
Definition VaultRecord.cpp:94
friend Vault
Making the Vault class friendly so that it has access to the internal members of the VaultRecord clas...
Definition VaultRecord.h:35
friend VaultRecordRef
Making the VaultRecordRef class friendly so that it has access to the internal members of the VaultRe...
Definition VaultRecord.h:38
bool GetIsValid() const noexcept
A method for checking whether a record is inside a Vault.
Definition VaultRecord.cpp:85
VaultRecord() noexcept
Default constructor.
Definition VaultRecord.cpp:6
void Invalidate() noexcept
A method to indicate that the record is no longer valid and is not inside Vault.
Definition VaultRecord.cpp:74
void RemoveRef() noexcept
A method to reduce the number of references to an object.
Definition VaultRecord.cpp:63
void AddRef() noexcept
A method for increasing the number of references to an object.
Definition VaultRecord.cpp:56
void UpdateDependentSets(const std::string &key, const T &data) noexcept
A method for updating the position of a record within all dependencies.
Definition VaultRecord.hpp:9
friend VaultRecordSet
Making the VaultRecordSet class friendly so that it has access to the internal members of the VaultRe...
Definition VaultRecord.h:41
void EraseDependentSet(VaultRecordSet *vaultRecordSet) noexcept
A method for erasing an record from a vaultRecordSet and erasing a vaultRecordSet from dependent sets...
Definition VaultRecord.cpp:110
A class for storing query results.
Definition VaultRecordSet.h:14