ADTF  3.18.2
IHashValueMapabstract

The hashed vlaue table store interface to set and retrieve values via a hash key. More...

Inheritance diagram for IHashValueMap:
[legend]

Public Types

using tHashKey = adtf::util::cStringUtil::tHashKey32
 Type for the HashKey of the Value.
 

Public Member Functions

virtual bool Exists (const tHashKey &oKey) const =0
 Tests is a value for the oKey exists. More...
 
virtual tResult Get (IHashValueMap &oHashMap) const =0
 Copy operation to the oHashMap. More...
 
virtual tResult GetValue (const tHashKey &oHashKey, IHashValueMapValue &oValue) const =0
 Retrieves the value for the hash key oHashKey to oValue if exists. More...
 
virtual tResult SetValue (const tHashKey &oHashKey, const IHashValueMapValue &oValue)=0
 Sets or resets the value for the hash key oHashKey as copy of oValue. More...
 
virtual bool IsEmpty () const =0
 Tests if value map is empty. More...
 
virtual void Reset ()=0
 Clears the value map.
 
virtual uint8_t GetRawMemoryLayoutVersion () const =0
 Return the Version of the memory layout used to store the values. More...
 
- Public Member Functions inherited from IRawValue
virtual tResult FromRaw (const IRawMemory &oRawValue)=0
 Implement to create a fast value copy in memory. More...
 
virtual tResult ToRaw (IRawMemory &&oRawValue) const =0
 Implement to create a fast value copy in memory. More...
 

Protected Member Functions

virtual ~IHashValueMap ()=default
 protected DTOR
 
- Protected Member Functions inherited from IRawValue
virtual ~IRawValue ()=default
 protected DTOR
 

Detailed Description

The hashed vlaue table store interface to set and retrieve values via a hash key.

The hash can be generated by create_hash_value_key.

Remarks
The implemntation must support IRawValue to retrieve a simple memory representation of the whole map.
Use hashed_value_map to implement !!
See also
hashed_value_map, create_hash_value_key

Definition at line 79 of file hashedvaluemap_intf.h.

Member Function Documentation

◆ Exists()

virtual bool Exists ( const tHashKey oKey) const
pure virtual

Tests is a value for the oKey exists.

Parameters
[in]oKeyhash key to check.
Return values
truevalue exists
falsevalue does not exists

Implemented in hash_value_map< STORAGE, INTERFACE >.

◆ Get()

virtual tResult Get ( IHashValueMap oHashMap) const
pure virtual

Copy operation to the oHashMap.

Parameters
[in]oHashMaphash map to copy values to another hash map
Remarks
if the implementation is equal you should use IRawValue to copy memory other use SetValue!
Returns
returns the standard error code
Return values
ERR_NOERRORcopy operation succeeded
ERR_MEMORYIRawValue::FromRaw or SetValue returned error

Implemented in hash_value_map< STORAGE, INTERFACE >.

◆ GetRawMemoryLayoutVersion()

virtual uint8_t GetRawMemoryLayoutVersion ( ) const
pure virtual

Return the Version of the memory layout used to store the values.

Returns
The version number of the Memory layout.

Implemented in hash_value_map< STORAGE, INTERFACE >.

Referenced by hash_value_map< STORAGE, INTERFACE >::Get().

◆ GetValue()

virtual tResult GetValue ( const tHashKey oHashKey,
IHashValueMapValue oValue 
) const
pure virtual

Retrieves the value for the hash key oHashKey to oValue if exists.

Parameters
[in]oHashKeyhashkey
[out]oValuevalue
Returns
returns the standard error code
Return values
ERR_NOERRORsuccedded
ERR_INVALID_TYPEType not supported
anydepends on implementation of IHashedValue.
See also
get_hashed_value

Implemented in hash_value_map< STORAGE, INTERFACE >.

◆ IsEmpty()

virtual bool IsEmpty ( ) const
pure virtual

Tests if value map is empty.

Return values
falsevalues exist
trueno values exist, map is empty.

Implemented in hash_value_map< STORAGE, INTERFACE >.

◆ SetValue()

virtual tResult SetValue ( const tHashKey oHashKey,
const IHashValueMapValue oValue 
)
pure virtual

Sets or resets the value for the hash key oHashKey as copy of oValue.

Parameters
[in]oHashKeyhashkey
[in]oValuevalue to set
Returns
returns the standard error code
Return values
ERR_NOERRORcopy operation succeeded
ERR_MEMORYIRawValue::FromRaw returned error
See also
set_hashed_value

Implemented in hash_value_map< STORAGE, INTERFACE >.

Referenced by hash_value_map< STORAGE, INTERFACE >::Get().