MVault 0.0.1
Loading...
Searching...
No Matches
VaultOperationResult.h
1#pragma once
2
3#include <string>
4#include <typeinfo>
5#include <typeindex>
6
7namespace mvlt
8{
18 {
19 OtherParentVaultNotValid,
20 SameVaultRecordSetInRequest = -10,
22 DuplicateKey = -8,
28 WrongKey = -2,
29 WrongType = -1,
30 Idle = 0,
31 WrongValue = 1,
33 Success = 3,
34 };
35
40 {
42 bool IsOperationSuccess = true;
43
46
48 std::string Key;
49
51 std::type_index RequestedType = typeid(void);
52
54 std::type_index SavedType = typeid(void);
55
60 std::string ResultCodeString() const noexcept;
61
71 };
72
82}
Iterator class for all library maps.
Definition Map.h:18
VaultOperationResultCode
Enum with all error handling codes.
Definition VaultOperationResult.h:18
@ ParentVaultNotValid
This code is returned when calling VaultRecordSet operations when the parent Vault is not valid.
@ Success
This value is returned when the request was completely successful.
@ DataRecordNotValid
This code is returned when data is requested from the VaultRecordRef and the record it refers to is n...
@ UniqueKeyValueAlredyInSet
This value is returned when the key was found, the requested type and the saved type are equal,...
@ RecordAlredyInSet
This code is returned when trying to add an record to the set when it is already in it.
@ WrongKey
This code is returned when the requested key has not been found.
@ WrongValue
This value is returned when the key was found, the requested type and the saved type are equal,...
@ TryToUpdateUniqueKey
This code is returned when trying to update default value in an unique key.
@ ParentVaultNotMatch
This code is returned during operations on VaultRecordSet when objects depend on different Vaults.
@ TryToAddUniqueKeyInNonEmptyVaultWithoutLambda
This code is returned when trying to add unique key without lamda in non-empty vault.
@ DuplicateKey
This code is returned when trying to add key which alredy in vault.
@ Idle
The default state.
@ WrongType
This code is returned when the requested type does not match the saved type.
Structure for storing the results of MVault operations.
Definition VaultOperationResult.h:40
std::type_index RequestedType
Requested key type.
Definition VaultOperationResult.h:51
bool IsOperationSuccess
A variable for determining whether the operation was successful.
Definition VaultOperationResult.h:42
std::type_index SavedType
Saved key type.
Definition VaultOperationResult.h:54
std::string ResultCodeString() const noexcept
Function for getting a text description of the operation result.
Definition VaultOperationResult.cpp:5
std::string Key
Requested key.
Definition VaultOperationResult.h:48
VaultOperationResultCode ResultCode
The result code of the operation.
Definition VaultOperationResult.h:45