MDBX Containers
Loading...
Searching...
No Matches
mdbxc::KeyValueTable< KeyT, ValueT >::AssignmentProxy Class Reference

Helper proxy for convenient assignment via operator[]. More...

#include <KeyValueTable.hpp>

Public Member Functions

 AssignmentProxy (KeyValueTable &db, KeyT key)
 Constructs the proxy for a specific key.
 
AssignmentProxyoperator= (const ValueT &value)
 Assigns a value to the stored key.
 
 operator ValueT () const
 Implicit conversion to the value type.
 

Private Attributes

KeyValueTablem_db
 Reference to the owning table.
 
KeyT m_key
 Key associated with this proxy.
 

Detailed Description

template<class KeyT, class ValueT>
class mdbxc::KeyValueTable< KeyT, ValueT >::AssignmentProxy

Helper proxy for convenient assignment via operator[].

Definition at line 102 of file KeyValueTable.hpp.

Constructor & Destructor Documentation

◆ AssignmentProxy()

template<class KeyT, class ValueT>
mdbxc::KeyValueTable< KeyT, ValueT >::AssignmentProxy::AssignmentProxy ( KeyValueTable & db,
KeyT key )
inline

Constructs the proxy for a specific key.

Parameters
dbReference to the owning table.
keyKey associated with this proxy.

Definition at line 107 of file KeyValueTable.hpp.

Member Function Documentation

◆ operator ValueT()

template<class KeyT, class ValueT>
mdbxc::KeyValueTable< KeyT, ValueT >::AssignmentProxy::operator ValueT ( ) const
inline

Implicit conversion to the value type.

If the key does not exist, a default-constructed value is inserted.

Definition at line 120 of file KeyValueTable.hpp.

◆ operator=()

template<class KeyT, class ValueT>
AssignmentProxy & mdbxc::KeyValueTable< KeyT, ValueT >::AssignmentProxy::operator= ( const ValueT & value)
inline

Assigns a value to the stored key.

Parameters
valueValue to store.
Returns
Reference to this proxy.

Definition at line 113 of file KeyValueTable.hpp.

Member Data Documentation

◆ m_db

template<class KeyT, class ValueT>
KeyValueTable& mdbxc::KeyValueTable< KeyT, ValueT >::AssignmentProxy::m_db
private

Reference to the owning table.

Definition at line 129 of file KeyValueTable.hpp.

◆ m_key

template<class KeyT, class ValueT>
KeyT mdbxc::KeyValueTable< KeyT, ValueT >::AssignmentProxy::m_key
private

Key associated with this proxy.

Definition at line 130 of file KeyValueTable.hpp.


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