ADTF
|
implementation of the IHashValueMap. More...
Classes | |
class | cHashedValueGetter |
class | cHashedValueSetter |
struct | tHashValueStorageType |
Public Types | |
typedef tHashValueStorageType | value_type |
Public Types inherited from IHashValueMap | |
using | tHashKey = adtf::util::cStringUtil::tHashKey32 |
Type for the HashKey of the Value. | |
Public Member Functions | |
hash_value_map () | |
CTOR. | |
hash_value_map (size_t szPreAllocatedKeyValueSize) | |
CTOR. More... | |
virtual | ~hash_value_map () |
DTOR. | |
hash_value_map (const hash_value_map &oToCopy) | |
Copy CTOR. More... | |
hash_value_map & | operator= (const hash_value_map &oToCopy) |
Copy operator. More... | |
hash_value_map (hash_value_map &&oToCopy)=delete | |
no move DTOR | |
hash_value_map & | operator= (hash_value_map &&oToCopy)=delete |
no move operator | |
bool | Exists (const IHashValueMap::tHashKey &oKey) const override |
Tests is a value for the oKey exists. More... | |
tResult | Get (IHashValueMap &oHashMap) const override |
Copy operation to the oHashMap . More... | |
tResult | GetValue (const IHashValueMap::tHashKey &oHashKey, IHashValueMapValue &oValue) const override |
Retrieves the value for the hash key oHashKey to oValue if exists. More... | |
void | Reset () override |
Clears the value map. | |
tResult | SetValue (const IHashValueMap::tHashKey &oHashKey, const IHashValueMapValue &oValue) override |
Sets or resets the value for the hash key oHashKey as copy of oValue . More... | |
size_t | GetCapacity () const |
Retrieve the current count of value can be stored. More... | |
bool | IsEmpty () const override |
Tests if value map is empty. More... | |
tResult | FromRaw (const IRawMemory &oRawValue) override |
Implement to create a fast value copy in memory. More... | |
tResult | ToRaw (IRawMemory &&oRawValue) const override |
Implement to create a fast value copy in memory. More... | |
uint8_t | GetRawMemoryLayoutVersion () const |
Return the Version of the memory layout used to store the values. More... | |
void * | GetPtr () const |
Protected Member Functions | |
hash_value_map (size_t szPreallocateMemorySize, bool bZeroMemory) | |
Protected Member Functions inherited from IHashValueMap | |
virtual | ~IHashValueMap ()=default |
protected DTOR | |
Protected Member Functions inherited from IRawValue | |
virtual | ~IRawValue ()=default |
protected DTOR | |
Protected Attributes | |
size_t | m_szPreAllocatedKeyValueSize = 0 |
Value count for preallocation of the memory. | |
Private Member Functions | |
value_type * | GetValueT (const IHashValueMap::tHashKey &oKey, value_type **ppFirstInvalid) const |
Private Attributes | |
STORAGE | m_oStorage |
implementation of the IHashValueMap.
STORAGE | Memory storage type |
INTERFACE | interface derived from |
Definition at line 26 of file hashedvaluemap.h.
|
inline |
CTOR.
[in] | szPreAllocatedKeyValueSize | count of values to preallocate memory |
Definition at line 126 of file hashedvaluemap.h.
References hash_value_map< STORAGE, INTERFACE >::m_szPreAllocatedKeyValueSize, and hash_value_map< STORAGE, INTERFACE >::Reset().
|
inline |
Copy CTOR.
[in] | oToCopy | map to copy from |
Definition at line 139 of file hashedvaluemap.h.
References hash_value_map< STORAGE, INTERFACE >::m_szPreAllocatedKeyValueSize, and hash_value_map< STORAGE, INTERFACE >::ToRaw().
|
inlineoverridevirtual |
Tests is a value for the oKey
exists.
[in] | oKey | hash key to check. |
true | value exists |
false | value does not exists |
Implements IHashValueMap.
Definition at line 171 of file hashedvaluemap.h.
|
inlineoverridevirtual |
Implement to create a fast value copy in memory.
Usually this method is called if types are equal implementation is within the same binary!
oRawValue | [in] Memory representation of the value |
ERR_NOERROR | Successfully copied. |
ERR_MEMORY | You have to return ERR_MEMORY if size of oRawValue does not fit !! |
any_error | Depends on the implementation. |
Implements IRawValue.
Definition at line 274 of file hashedvaluemap.h.
References IRawMemory::Get(), and IRawMemory::GetSize().
|
inlineoverridevirtual |
Copy operation to the oHashMap
.
[in] | oHashMap | hash map to copy values to another hash map |
ERR_NOERROR | copy operation succeeded |
ERR_MEMORY | IRawValue::FromRaw or SetValue returned error |
Implements IHashValueMap.
Definition at line 177 of file hashedvaluemap.h.
References IRawValue::FromRaw(), hash_value_map< STORAGE, INTERFACE >::GetCapacity(), hash_value_map< STORAGE, INTERFACE >::GetRawMemoryLayoutVersion(), IHashValueMap::GetRawMemoryLayoutVersion(), IHashValueMapValue::HVT_Invalid, RETURN_IF_FAILED, RETURN_NOERROR, and IHashValueMap::SetValue().
|
inline |
Retrieve the current count of value can be stored.
Definition at line 263 of file hashedvaluemap.h.
Referenced by hash_value_map< STORAGE, INTERFACE >::Get(), hash_value_map< STORAGE, INTERFACE >::IsEmpty(), and hash_value_map< STORAGE, INTERFACE >::SetValue().
|
inlinevirtual |
Return the Version of the memory layout used to store the values.
Implements IHashValueMap.
Definition at line 283 of file hashedvaluemap.h.
Referenced by hash_value_map< STORAGE, INTERFACE >::Get().
|
inlineoverridevirtual |
Retrieves the value for the hash key oHashKey
to oValue
if exists.
[in] | oHashKey | hashkey |
[out] | oValue | value |
ERR_NOERROR | succedded |
ERR_INVALID_TYPE | Type not supported |
any | depends on implementation of IHashedValue. |
Implements IHashValueMap.
Definition at line 205 of file hashedvaluemap.h.
References RETURN_ERROR, and IHashValueMapValue::Set().
|
inlineoverridevirtual |
Tests if value map is empty.
false | values exist |
true | no values exist, map is empty. |
Implements IHashValueMap.
Definition at line 268 of file hashedvaluemap.h.
References hash_value_map< STORAGE, INTERFACE >::GetCapacity(), and IHashValueMapValue::HVT_Invalid.
|
inline |
Copy operator.
[in] | oToCopy | map to copy from |
Definition at line 148 of file hashedvaluemap.h.
References hash_value_map< STORAGE, INTERFACE >::m_szPreAllocatedKeyValueSize, and hash_value_map< STORAGE, INTERFACE >::ToRaw().
|
inlineoverridevirtual |
Sets or resets the value for the hash key oHashKey
as copy of oValue
.
[in] | oHashKey | hashkey |
[in] | oValue | value to set |
ERR_NOERROR | copy operation succeeded |
ERR_MEMORY | IRawValue::FromRaw returned error |
Implements IHashValueMap.
Definition at line 230 of file hashedvaluemap.h.
References hash_value_map< STORAGE, INTERFACE >::GetCapacity(), IHashValueMapValue::GetType(), RETURN_IF_FAILED, and IRawValue::ToRaw().
|
inlineoverridevirtual |
Implement to create a fast value copy in memory.
Usually this method is called if types are equal implementation is within the same binary!
oRawValue | [oRawValue] copy of the memory representation of the value |
ERR_NOERROR | Successfully copied. |
any_error | Depends on the implementation. You are adviced to return the return value of IRawMemory::Set. |
Implements IRawValue.
Definition at line 279 of file hashedvaluemap.h.
Referenced by hash_value_map< STORAGE, INTERFACE >::hash_value_map(), and hash_value_map< STORAGE, INTERFACE >::operator=().