MVault 0.0.1
|
A class that provides access to data inside Vault. More...
#include <VaultRecordRef.h>
Public Member Functions | |
VaultRecordRef () noexcept | |
Default constructor. | |
VaultRecordRef (VaultRecord *vaultRecord, Vault *vlt) noexcept | |
Constructor. | |
VaultRecordRef (const VaultRecordRef &other) noexcept | |
Copy constructor. | |
VaultRecordRef & | operator= (const VaultRecordRef &other) noexcept |
Assignment operator. | |
bool | operator== (const VaultRecordRef &other) const noexcept |
Comparison operator. | |
std::string | GetRecordUniqueId () const noexcept |
A method for obtaining a unique record identifier. | |
template<class T > | |
VaultOperationResult | SetData (const std::string &key, const T &data) noexcept |
Method for updating data inside Vault. | |
VaultOperationResult | SetData (const std::vector< std::pair< std::string, VaultParamInput > > ¶ms) noexcept |
Method for updating data inside Vault. | |
template<class T > | |
VaultOperationResult | GetData (const std::string &key, T &data) const noexcept |
A method for getting data using a key. | |
VaultOperationResult | GetDataAsString (const std::string &key, std::string &str) const noexcept |
Method for getting data converted to string from a container using a key. | |
bool | IsValid () const noexcept |
A function to check the validity of a class object. | |
bool | IsKeyExist (const std::string &key) const noexcept |
The method for getting a default key value. | |
std::vector< std::string > | GetKeys () const noexcept |
The method for getting all the keys. | |
void | PrintRecord () const noexcept |
A method for displaying VaultRecordRef content on the screen. | |
void | Reset () noexcept |
A method for decoupling a class object from record. Reset class object to default state. | |
~VaultRecordRef () noexcept | |
Default destructor. | |
Public Attributes | |
friend | Vault |
Making the Vault class friendly so that it has access to the internal members of the VaultRecordRef class. | |
friend | VaultRecordSet |
Making the VaultRecordSet class friendly so that it has access to the internal members of the VaultRecordRef class. | |
A class that provides access to data inside Vault.
This class works as a reference to the data inside the Vault, you can use it to change the data inside the Vault. If two objects of the class point to the same VaultRecord inside the Vault, then when the data in one object changes, the data in the other object will also change. If the record pointed to by an object of this class is deleted, the isValid function will return false, and any attempt to access or change the data will be ignored.
|
noexcept |
Constructor.
Simply call SetRecord method
[in] | vaultRecord | A pointer to the VaultRecord referenced by the class object VaultRecordRef |
[in] | vlt | A pointer to Vault |
|
noexcept |
Copy constructor.
[in] | other | other VaultRecordRef object |
|
noexcept |
A method for getting data using a key.
<T> | Any type of data except for c arrays |
[in] | key | the key whose value should be obtained |
[in] | data | reference to record the received data |
|
noexcept |
Method for getting data converted to string from a container using a key.
[in] | key | key for getting data |
[out] | str | a reference to string to write data from the container there. If the data was not found, then nothing will be written to the str |
It uses the ToString function inside. If it is not defined for the type, then the str will be an empty string.
|
noexcept |
The method for getting all the keys.
If the record is not valid, it will return an empty vector
|
noexcept |
A method for obtaining a unique record identifier.
Important. Two VaultRecordRef objects pointing to the same record will return the same value. Invalid record will return null
The method for getting a default key value.
[in] | key | the name of the key to search for |
|
noexcept |
A function to check the validity of a class object.
An object may no longer be valid if the record it refers to has been deleted
|
noexcept |
Assignment operator.
[in] | other | other VaultRecordRef object |
|
noexcept |
Comparison operator.
[in] | other | the object to compare with |
|
noexcept |
Method for updating data inside Vault.
<T> | Any type of data except for c arrays |
Using this method, you can change the values inside the VaultRecord inside the Vault
[in] | key | the key whose value needs to be changed |
[in] | data | new key data value |
|
noexcept |
Method for updating data inside Vault.
Using this method, you can change the values inside the VaultRecord inside the Vault.
See Vault::CreateRecord(std::vector<std::pair<std::string, VaultParamInput>>&& params) for more information
[in] | params | a vector of pairs with data to be put in the Vault |