Mercurial > hg > orthanc
annotate OrthancFramework/Sources/SQLite/Transaction.h @ 4845:02d77189d8ba received-instance-callback
added ReceivedInstanceCallback + sample C++ plugin
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 09 Dec 2021 17:22:40 +0100 |
parents | 7053502fbf97 |
children | 43e613a7756b |
rev | line source |
---|---|
0 | 1 /** |
59 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1220
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
3 * |
3063 | 4 * Copyright (C) 2012-2016 Sebastien Jodogne <s.jodogne@orthanc-labs.com>, |
1220
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
5 * Medical Physics Department, CHU of Liege, Belgium |
4829
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4811
diff
changeset
|
6 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
4831
7053502fbf97
added copyright UCLouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4829
diff
changeset
|
7 * Copyright (C) 2021-2021 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
0 | 8 * |
17 | 9 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
10 * | |
11 * Redistribution and use in source and binary forms, with or without | |
12 * modification, are permitted provided that the following conditions are | |
13 * met: | |
0 | 14 * |
17 | 15 * * Redistributions of source code must retain the above copyright |
16 * notice, this list of conditions and the following disclaimer. | |
17 * * Redistributions in binary form must reproduce the above | |
18 * copyright notice, this list of conditions and the following disclaimer | |
19 * in the documentation and/or other materials provided with the | |
20 * distribution. | |
21 * * Neither the name of Google Inc., the name of the CHU of Liege, | |
22 * nor the names of its contributors may be used to endorse or promote | |
23 * products derived from this software without specific prior written | |
24 * permission. | |
25 * | |
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
0 | 37 **/ |
38 | |
39 | |
40 #pragma once | |
41 | |
42 #include "Connection.h" | |
1235 | 43 #include "ITransaction.h" |
0 | 44 |
59 | 45 namespace Orthanc |
0 | 46 { |
47 namespace SQLite | |
48 { | |
3992
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3063
diff
changeset
|
49 class ORTHANC_PUBLIC Transaction : public ITransaction |
0 | 50 { |
51 private: | |
52 Connection& connection_; | |
53 | |
54 // True when the transaction is open, false when it's already been committed | |
55 // or rolled back. | |
56 bool isOpen_; | |
57 | |
58 public: | |
59 explicit Transaction(Connection& connection); | |
1235 | 60 |
61 virtual ~Transaction(); | |
0 | 62 |
63 // Returns true when there is a transaction that has been successfully begun. | |
4304 | 64 bool IsOpen() const; |
0 | 65 |
4811
064d86287630
added missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4304
diff
changeset
|
66 virtual void Begin() ORTHANC_OVERRIDE; |
0 | 67 |
4811
064d86287630
added missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4304
diff
changeset
|
68 virtual void Rollback() ORTHANC_OVERRIDE; |
0 | 69 |
4811
064d86287630
added missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4304
diff
changeset
|
70 virtual void Commit() ORTHANC_OVERRIDE; |
0 | 71 }; |
72 } | |
73 } |