some more docs, doc build fix
This commit is contained in:
parent
161a850088
commit
3c256e2bf5
@ -8,6 +8,7 @@
|
|||||||
- read only cursors
|
- read only cursors
|
||||||
- some more documentation
|
- some more documentation
|
||||||
- more tests
|
- more tests
|
||||||
|
- doxygen-awesome build bix
|
||||||
|
|
||||||
## LMDBAL 0.3.1 (April 14, 2023)
|
## LMDBAL 0.3.1 (April 14, 2023)
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
@ -6,23 +6,23 @@ if (BUILD_DOXYGEN_AWESOME)
|
|||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(doxygen-awesome-css
|
ExternalProject_Add(doxygen-awesome-css
|
||||||
GIT_REPOSITORY https://github.com/jothepro/doxygen-awesome-css.git
|
GIT_REPOSITORY https://github.com/jothepro/doxygen-awesome-css.git
|
||||||
GIT_TAG "v2.2.0"
|
GIT_TAG "v2.2.1"
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
BUILD_COMMAND make
|
BUILD_COMMAND make
|
||||||
BUILD_IN_SOURCE TRUE
|
BUILD_IN_SOURCE TRUE
|
||||||
INSTALL_COMMAND make DESTDIR=${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css install
|
INSTALL_COMMAND make PREFIX=${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css install
|
||||||
)
|
)
|
||||||
set (DOXYGEN_GENERATE_TREEVIEW YES)
|
set (DOXYGEN_GENERATE_TREEVIEW YES)
|
||||||
set (DOXYGEN_DISABLE_INDEX NO)
|
set (DOXYGEN_DISABLE_INDEX NO)
|
||||||
set (DOXYGEN_FULL_SIDEBAR NO)
|
set (DOXYGEN_FULL_SIDEBAR NO)
|
||||||
set (DOXYGEN_HTML_EXTRA_STYLESHEET
|
set (DOXYGEN_HTML_EXTRA_STYLESHEET
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/doxygen-awesome.css
|
${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/share/doxygen-awesome-css/doxygen-awesome.css
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/doxygen-awesome-sidebar-only.css
|
${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/share/doxygen-awesome-css/doxygen-awesome-sidebar-only.css
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css
|
${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/share/doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css
|
||||||
custom.css
|
custom.css
|
||||||
)
|
)
|
||||||
set (DOXYGEN_HTML_EXTRA_FILES
|
set (DOXYGEN_HTML_EXTRA_FILES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js
|
${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/share/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js
|
||||||
)
|
)
|
||||||
set (DOXYGEN_FULL_SIDEBAR NO)
|
set (DOXYGEN_FULL_SIDEBAR NO)
|
||||||
set (DOXYGEN_HTML_COLORSTYLE "LIGHT")
|
set (DOXYGEN_HTML_COLORSTYLE "LIGHT")
|
||||||
|
@ -141,8 +141,6 @@ void LMDBAL::Cursor<K, V>::open (TransactionID txn) const {
|
|||||||
*
|
*
|
||||||
* This function does nothing if the cursor is closed
|
* This function does nothing if the cursor is closed
|
||||||
*
|
*
|
||||||
* \param[in] txn a transaction you wish this cursor to be bound to
|
|
||||||
*
|
|
||||||
* \throws LMDBAL::Closed thrown if you try to renew the cursor on a closed database
|
* \throws LMDBAL::Closed thrown if you try to renew the cursor on a closed database
|
||||||
* \throws LMDBAL::Unknown thrown if there was a problem beginning new transaction or if there was a problem renewing the cursor by lmdb
|
* \throws LMDBAL::Unknown thrown if there was a problem beginning new transaction or if there was a problem renewing the cursor by lmdb
|
||||||
*/
|
*/
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
|
|
||||||
virtual std::string getMessage() const = 0; /**<\brief returns exception message*/
|
virtual std::string getMessage() const = 0; /**<\brief returns exception message*/
|
||||||
|
|
||||||
const char* what() const noexcept( true ) override;
|
const char* what() const noexcept( true ) override; /**<\brief system exception method that is actually called to show the message*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,6 +21,21 @@
|
|||||||
|
|
||||||
#include "serializer.h"
|
#include "serializer.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \class LMDBAL::Serializer
|
||||||
|
*
|
||||||
|
* A class that is constructed in every LMDBAL::Storage
|
||||||
|
* to serialize or deserialize keys and values.
|
||||||
|
*
|
||||||
|
* It serializes to and deserializes from <a class="el" href="http://www.lmdb.tech/doc/group__mdb.html#structMDB__val">MDB_val</a>MDB_val
|
||||||
|
*
|
||||||
|
* \tparam K type of the keys of the storage
|
||||||
|
* \tparam V type of the values of the storage
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Creates an empty Serializer
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
LMDBAL::Serializer<T>::Serializer() :
|
LMDBAL::Serializer<T>::Serializer() :
|
||||||
bytes(),
|
bytes(),
|
||||||
@ -30,6 +45,13 @@ LMDBAL::Serializer<T>::Serializer() :
|
|||||||
buffer.open(QIODevice::ReadWrite);
|
buffer.open(QIODevice::ReadWrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Creates a Serializer with some data in it
|
||||||
|
*
|
||||||
|
* The data automatically gets serialized
|
||||||
|
*
|
||||||
|
* \param[in] value - a value that is assigned to the serializer
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
LMDBAL::Serializer<T>::Serializer(const T& value) :
|
LMDBAL::Serializer<T>::Serializer(const T& value) :
|
||||||
bytes(),
|
bytes(),
|
||||||
@ -40,11 +62,23 @@ LMDBAL::Serializer<T>::Serializer(const T& value) :
|
|||||||
_setData(value);
|
_setData(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Destoys the serializer
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
LMDBAL::Serializer<T>::~Serializer() {
|
LMDBAL::Serializer<T>::~Serializer() {
|
||||||
buffer.close();
|
buffer.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Sets the data to the seriazer
|
||||||
|
*
|
||||||
|
* This is a normal way to seriaze value
|
||||||
|
*
|
||||||
|
* \param[in] value - a value you want to serialize
|
||||||
|
*
|
||||||
|
* \returns serialized value
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
MDB_val LMDBAL::Serializer<T>::setData(const T& value) {
|
MDB_val LMDBAL::Serializer<T>::setData(const T& value) {
|
||||||
clear();
|
clear();
|
||||||
@ -52,6 +86,15 @@ MDB_val LMDBAL::Serializer<T>::setData(const T& value) {
|
|||||||
return getData();
|
return getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deserializes value
|
||||||
|
*
|
||||||
|
* This is a normal way to deseriaze value
|
||||||
|
*
|
||||||
|
* \param[in] value - a value you want to deserialize
|
||||||
|
*
|
||||||
|
* \returns deserialized value
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
T LMDBAL::Serializer<T>::deserialize(const MDB_val& value) {
|
T LMDBAL::Serializer<T>::deserialize(const MDB_val& value) {
|
||||||
T result;
|
T result;
|
||||||
@ -60,6 +103,14 @@ T LMDBAL::Serializer<T>::deserialize(const MDB_val& value) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deserializes value
|
||||||
|
*
|
||||||
|
* This is a normal way to deseriaze value
|
||||||
|
*
|
||||||
|
* \param[in] value - a value you want to deserialize
|
||||||
|
* \param[out] result - deserialized value
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
void LMDBAL::Serializer<T>::deserialize(const MDB_val& value, T& result) {
|
void LMDBAL::Serializer<T>::deserialize(const MDB_val& value, T& result) {
|
||||||
clear();
|
clear();
|
||||||
@ -67,11 +118,21 @@ void LMDBAL::Serializer<T>::deserialize(const MDB_val& value, T& result) {
|
|||||||
stream >> result;
|
stream >> result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Private function that handles serialization
|
||||||
|
*
|
||||||
|
* \param[in] value - a value you want to serialize
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
void LMDBAL::Serializer<T>::_setData(const T& value) {
|
void LMDBAL::Serializer<T>::_setData(const T& value) {
|
||||||
stream << value;
|
stream << value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Clears the state of serializer
|
||||||
|
*
|
||||||
|
* Normally you don't need to call this function
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
void LMDBAL::Serializer<T>::clear() {
|
void LMDBAL::Serializer<T>::clear() {
|
||||||
if (buffer.pos() > 0) {
|
if (buffer.pos() > 0) {
|
||||||
@ -79,6 +140,15 @@ void LMDBAL::Serializer<T>::clear() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Returns the data if it already was serialized
|
||||||
|
*
|
||||||
|
* Normally you don't need to call this function
|
||||||
|
*
|
||||||
|
* This may be usefull if you called LMDBAL::Serilizer::setData() but lost the result
|
||||||
|
*
|
||||||
|
* \returns Serialized data
|
||||||
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
MDB_val LMDBAL::Serializer<T>::getData() {
|
MDB_val LMDBAL::Serializer<T>::getData() {
|
||||||
MDB_val val;
|
MDB_val val;
|
||||||
|
@ -35,6 +35,12 @@ protected:
|
|||||||
iStorage(const std::string& name, Base* parent);
|
iStorage(const std::string& name, Base* parent);
|
||||||
virtual ~iStorage();
|
virtual ~iStorage();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A private virtual function I need to open each storage in the database
|
||||||
|
*
|
||||||
|
* \param[in] transaction - lmdb transaction to call <a class="el" href="http://www.lmdb.tech/doc/group__mdb.html#gac08cad5b096925642ca359a6d6f0562a">mdb_dbi_open</a>
|
||||||
|
* \returns MDB_SUCCESS if everything went smooth or MDB_<error> -like error code
|
||||||
|
*/
|
||||||
virtual int open(MDB_txn * transaction) = 0;
|
virtual int open(MDB_txn * transaction) = 0;
|
||||||
virtual void close();
|
virtual void close();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user