Mercurial > hg > orthanc
diff OrthancServer/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.h @ 5024:c2ebc47f4f18 delayed-deletion
wip: adding DelayedDeletion plugin
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 20 Jun 2022 16:53:21 +0200 |
parents | |
children | 99751c5a7cfe |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OrthancServer/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.h Mon Jun 20 16:53:21 2022 +0200 @@ -0,0 +1,26 @@ +#pragma once + + +#include "../../../../OrthancFramework/Sources/SQLite/Connection.h" +#include <boost/thread/mutex.hpp> +#include <boost/noncopyable.hpp> + +class PendingDeletionsDatabase : public boost::noncopyable +{ +private: + boost::mutex mutex_; + Orthanc::SQLite::Connection db_; + + void Setup(); + +public: + PendingDeletionsDatabase(const std::string& path); + + void Enqueue(const std::string& uuid, + Orthanc::FileContentType type); + + bool Dequeue(std::string& uuid, + Orthanc::FileContentType& type); + + unsigned int GetSize(); +};