forked from blue/lmdbal
external transaction methods for storage
This commit is contained in:
parent
f39d44890a
commit
e2dbea21d1
19 changed files with 273 additions and 58 deletions
|
@ -54,14 +54,19 @@ MDB_val LMDBAL::Serializer<T>::setData(const T& value) {
|
|||
|
||||
template<class T>
|
||||
T LMDBAL::Serializer<T>::deserialize(const MDB_val& value) {
|
||||
clear();
|
||||
bytes.setRawData((char*)value.mv_data, value.mv_size);
|
||||
T result;
|
||||
stream >> result;
|
||||
deserialize(value, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void LMDBAL::Serializer<T>::deserialize(const MDB_val& value, T& result) {
|
||||
clear();
|
||||
bytes.setRawData((char*)value.mv_data, value.mv_size);
|
||||
stream >> result;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void LMDBAL::Serializer<T>::_setData(const T& value) {
|
||||
stream << value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue