libmoost
|
User defined data that must NEVER be modified! More...
#include <kvds_bdb_linux.hpp>
Public Member Functions | |
ConstDbt (void const *data, size_t size) | |
void | set_data (void const *data) |
Not allowed to set data on this (via c_tor only)! |
User defined data that must NEVER be modified!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Unfortunately, Dbt only takes non-const pointers. A const cast is required here otherwise we'd have to create local copies of key/data. This should be safe because no modifications are made to key/data unless the semantics of the BDB function being called demand it and in these cases the pointers are non-const anyway.
Below, we encapsulate the three different ways we used Dbt with easy to recognise class names to (a) make the code more readable and (b) to ensure the type of Dbt being used is unequivocally clear. Note, only user memory allocate Dbt allows the data pointer to be changed. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Definition at line 95 of file kvds_bdb_linux.hpp.
moost::kvds::ConstDbt::ConstDbt | ( | void const * | data, |
size_t | size | ||
) | [inline] |
Definition at line 97 of file kvds_bdb_linux.hpp.
void moost::kvds::ConstDbt::set_data | ( | void const * | data | ) |
Not allowed to set data on this (via c_tor only)!