Mercurial > hg > orthanc
annotate OrthancFramework/Sources/SQLite/ITransaction.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 |
---|---|
1235 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * | |
3063 | 4 * Copyright (C) 2012-2016 Sebastien Jodogne <s.jodogne@orthanc-labs.com>, |
1235 | 5 * Medical Physics Department, CHU of Liege, Belgium |
4829
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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 |
1235 | 8 * |
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: | |
14 * | |
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. | |
37 **/ | |
38 | |
39 | |
40 #pragma once | |
41 | |
42 #include "NonCopyable.h" | |
43 | |
44 namespace Orthanc | |
45 { | |
46 namespace SQLite | |
47 { | |
48 class ITransaction : public NonCopyable | |
49 { | |
50 public: | |
51 virtual ~ITransaction() | |
52 { | |
53 } | |
54 | |
55 // Begins the transaction. This uses the default sqlite "deferred" transaction | |
56 // type, which means that the DB lock is lazily acquired the next time the | |
57 // database is accessed, not in the begin transaction command. | |
58 virtual void Begin() = 0; | |
59 | |
60 // Rolls back the transaction. This will happen automatically if you do | |
61 // nothing when the transaction goes out of scope. | |
62 virtual void Rollback() = 0; | |
63 | |
64 // Commits the transaction, returning true on success. | |
65 virtual void Commit() = 0; | |
66 }; | |
67 } | |
68 } |