MVault 0.0.1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
mvlt::VaultRecord Class Reference

A class for storing data inside Vault. More...

#include <VaultRecord.h>

Inheritance diagram for mvlt::VaultRecord:
Inheritance graph
[legend]
Collaboration diagram for mvlt::VaultRecord:
Collaboration graph
[legend]

Public Member Functions

 VaultRecord () noexcept
 Default constructor.
 
 VaultRecord (const VaultRecord &other) noexcept
 Copy constructor.
 
VaultRecordoperator= (const VaultRecord &other) noexcept
 Assignment operator.
 
 VaultRecord (VaultRecord &&other) noexcept
 Move constructor.
 
VaultRecordoperator= (VaultRecord &&other) noexcept
 Move assignment operator.
 
void AddRef () noexcept
 A method for increasing the number of references to an object.
 
void RemoveRef () noexcept
 A method to reduce the number of references to an object.
 
void Invalidate () noexcept
 A method to indicate that the record is no longer valid and is not inside Vault.
 
bool GetIsValid () const noexcept
 A method for checking whether a record is inside a Vault.
 
void RemoveFromDependentSets () noexcept
 A method for removing record from all dependent VaultRecordSets.
 
void AddToDependentSets (VaultRecordSet *vaultRecordSet) noexcept
 A method for adding an record to a vaultRecordSet and adding a vaultRecordSet to dependent sets.
 
void EraseDependentSet (VaultRecordSet *vaultRecordSet) noexcept
 A method for erasing an record from a vaultRecordSet and erasing a vaultRecordSet from dependent sets.
 
template<class T >
void UpdateDependentSets (const std::string &key, const T &data) noexcept
 A method for updating the position of a record within all dependencies.
 
- Public Member Functions inherited from mvlt::DataContainer< std::unordered_map< std::string, DataSaver > >
iterator begin () noexcept
 Begin provides access to the Data iterator.
 
const_iterator cbegin () const noexcept
 Cbegin provides access to the Data const_iterator.
 
iterator end () noexcept
 End provides access to the Data iterator.
 
const_iterator cend () const noexcept
 Cend provides access to the Data const_iterator.
 
void AddData (const std::string &key, const T &data) noexcept
 Template method for adding a new data to the container.
 
void AddData (const std::string &key, const T &data, F &&deleteFunc) noexcept
 Template method for adding a new data to the container and a function to delete this data.
 
void AddDataFromDataSaver (const std::string &key, const DataSaver &dataSaver) noexcept
 Method for adding a new data to the container.
 
void SetData (const std::string &key, const T &data) noexcept
 Method for changing the value of a data inside a container using a key.
 
void SetData (const std::string &key, const T &data, F &&deleteFunc) noexcept
 Method for changing the value of a data inside a container using a key.
 
void SetDataFromDataSaver (const std::string &key, const DataSaver &dataSaver) noexcept
 Method for changing the value of a data inside a container using a key.
 
bool SetDataFromString (const std::string &key, const std::string &str) noexcept
 Method for setting data by key.
 
bool GetData (const std::string &key, T &data) const noexcept
 Method for getting data from a container using a key.
 
bool GetDataSaver (const std::string &key, DataSaver &dataSaver) const noexcept
 Method for getting dataSaver from a container using a key.
 
bool GetDataAsString (const std::string &key, std::string &str) const noexcept
 Method for getting data converted to string from a container using a key.
 
bool IsData (const std::string &key) const noexcept
 A method for checking whether data with such a key is in the container.
 
void EraseData (const std::string &key) noexcept
 Function for erasing data from a container.
 
void Clear () noexcept
 Method for clear all data inside container.
 
std::size_t Size () const noexcept
 Method for getting the container size.
 

Public Attributes

friend Vault
 Making the Vault class friendly so that it has access to the internal members of the VaultRecord class.
 
friend VaultRecordRef
 Making the VaultRecordRef class friendly so that it has access to the internal members of the VaultRecord class.
 
friend VaultRecordSet
 Making the VaultRecordSet class friendly so that it has access to the internal members of the VaultRecord class.
 

Additional Inherited Members

- Public Types inherited from mvlt::DataContainer< std::unordered_map< std::string, DataSaver > >
typedef C::iterator iterator
 Redefine iterator from C container.
 
typedef C::const_iterator const_iterator
 Redefine const_iterator from C container.
 
- Protected Attributes inherited from mvlt::DataContainer< std::unordered_map< std::string, DataSaver > >
std::unordered_map< std::string, DataSaverContainer
 Container to store all data inside C container.
 

Detailed Description

A class for storing data inside Vault.

It is a wrapper over the Data Hash Map, but adds a functionality to invalidate VaultRecordRef's pointing to an object of this class.
The functionality from HashMap stores allows you to store data of any type and provide access to them using string keys.

Constructor & Destructor Documentation

◆ VaultRecord() [1/2]

mvlt::VaultRecord::VaultRecord ( const VaultRecord other)
noexcept

Copy constructor.

Parameters
[in]otherobject to copy data from

◆ VaultRecord() [2/2]

mvlt::VaultRecord::VaultRecord ( VaultRecord &&  other)
noexcept

Move constructor.

Parameters
[in]otherobject to move data from

Member Function Documentation

◆ AddToDependentSets()

void mvlt::VaultRecord::AddToDependentSets ( VaultRecordSet vaultRecordSet)
noexcept

A method for adding an record to a vaultRecordSet and adding a vaultRecordSet to dependent sets.

Parameters
[in]vaultRecordSetnew dependent VaultRecordSet

◆ EraseDependentSet()

void mvlt::VaultRecord::EraseDependentSet ( VaultRecordSet vaultRecordSet)
noexcept

A method for erasing an record from a vaultRecordSet and erasing a vaultRecordSet from dependent sets.

Parameters
[in]vaultRecordSetdependent VaultRecordSet to erase

◆ GetIsValid()

bool mvlt::VaultRecord::GetIsValid ( ) const
noexcept

A method for checking whether a record is inside a Vault.

Returns
returns the validity of the record

◆ operator=() [1/2]

VaultRecord & mvlt::VaultRecord::operator= ( const VaultRecord other)
noexcept

Assignment operator.

Parameters
[in]otherobject to copy data from
Returns
reference to copied object

◆ operator=() [2/2]

VaultRecord & mvlt::VaultRecord::operator= ( VaultRecord &&  other)
noexcept

Move assignment operator.

Parameters
[in]otherobject to move data from
Returns
reference to moved object

◆ UpdateDependentSets()

template<class T >
void mvlt::VaultRecord::UpdateDependentSets ( const std::string &  key,
const T data 
)
noexcept

A method for updating the position of a record within all dependencies.

Template Parameters
<T>Any type of data except for c arrays
Parameters
[in]keychanged data key
[in]datachanged data

The documentation for this class was generated from the following files: