annotate OrthancServer/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.h @ 5573:823aae1ea72a

removed dependency of HouseKeeper upon Orthanc::Logging
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 Apr 2024 16:01:26 +0200
parents 48b8dae6dc77
children f7adfb22e20e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5264
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
1 /**
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
4 * Department, University Hospital of Liege, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5264
diff changeset
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5264
diff changeset
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
5264
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
7 *
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
8 * This program is free software: you can redistribute it and/or
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
9 * modify it under the terms of the GNU General Public License as
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
10 * published by the Free Software Foundation, either version 3 of the
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
11 * License, or (at your option) any later version.
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
12 *
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
13 * This program is distributed in the hope that it will be useful, but
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
16 * General Public License for more details.
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
17 *
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
18 * You should have received a copy of the GNU General Public License
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
20 **/
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
21
99751c5a7cfe added missing copyrights
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5024
diff changeset
22
5024
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
23 #pragma once
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
24
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
25
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
26 #include "../../../../OrthancFramework/Sources/SQLite/Connection.h"
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
27 #include <boost/thread/mutex.hpp>
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
28 #include <boost/noncopyable.hpp>
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
29
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
30 class PendingDeletionsDatabase : public boost::noncopyable
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
31 {
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
32 private:
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
33 boost::mutex mutex_;
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
34 Orthanc::SQLite::Connection db_;
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
35
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
36 void Setup();
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
37
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
38 public:
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
39 PendingDeletionsDatabase(const std::string& path);
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
40
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
41 void Enqueue(const std::string& uuid,
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
42 Orthanc::FileContentType type);
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
43
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
44 bool Dequeue(std::string& uuid,
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
45 Orthanc::FileContentType& type);
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
46
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
47 unsigned int GetSize();
c2ebc47f4f18 wip: adding DelayedDeletion plugin
Alain Mazy <am@osimis.io>
parents:
diff changeset
48 };