Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Engine/OrthancPluginDatabase.h @ 4593:60a860942c5e db-changes
moved handling of answers from database plugins from OrthancPluginDatabase to its Transaction subclass
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 15 Mar 2021 18:22:53 +0100 |
parents | ff8170d17d90 |
children | d494b4f1103e |
comparison
equal
deleted
inserted
replaced
4592:36bbf3169a27 | 4593:60a860942c5e |
---|---|
44 #include "../Include/orthanc/OrthancCDatabasePlugin.h" | 44 #include "../Include/orthanc/OrthancCDatabasePlugin.h" |
45 #include "PluginsErrorDictionary.h" | 45 #include "PluginsErrorDictionary.h" |
46 | 46 |
47 namespace Orthanc | 47 namespace Orthanc |
48 { | 48 { |
49 class OrthancPluginDatabase : | 49 class OrthancPluginDatabase : public IDatabaseWrapper |
50 public IDatabaseWrapper | |
51 { | 50 { |
52 private: | 51 private: |
53 class Transaction; | 52 class Transaction; |
54 | 53 |
55 typedef std::pair<int64_t, ResourceType> AnswerResource; | 54 SharedLibrary& library_; |
56 typedef std::map<MetadataType, std::string> AnswerMetadata; | 55 PluginsErrorDictionary& errorDictionary_; |
57 | 56 OrthancPluginDatabaseBackend backend_; |
58 SharedLibrary& library_; | |
59 PluginsErrorDictionary& errorDictionary_; | |
60 _OrthancPluginDatabaseAnswerType type_; | |
61 OrthancPluginDatabaseBackend backend_; | |
62 OrthancPluginDatabaseExtensions extensions_; | 57 OrthancPluginDatabaseExtensions extensions_; |
63 void* payload_; | 58 void* payload_; |
64 IDatabaseListener* listener_; | 59 Transaction* activeTransaction_; |
65 | 60 bool fastGetTotalSize_; |
66 bool fastGetTotalSize_; | 61 uint64_t currentDiskSize_; |
67 uint64_t currentDiskSize_; | |
68 | |
69 std::list<std::string> answerStrings_; | |
70 std::list<int32_t> answerInt32_; | |
71 std::list<int64_t> answerInt64_; | |
72 std::list<AnswerResource> answerResources_; | |
73 std::list<FileInfo> answerAttachments_; | |
74 | |
75 DicomMap* answerDicomMap_; | |
76 std::list<ServerIndexChange>* answerChanges_; | |
77 std::list<ExportedResource>* answerExportedResources_; | |
78 bool* answerDone_; | |
79 bool answerDoneIgnored_; | |
80 std::list<std::string>* answerMatchingResources_; | |
81 std::list<std::string>* answerMatchingInstances_; | |
82 AnswerMetadata* answerMetadata_; | |
83 | 62 |
84 OrthancPluginDatabaseContext* GetContext() | 63 OrthancPluginDatabaseContext* GetContext() |
85 { | 64 { |
86 return reinterpret_cast<OrthancPluginDatabaseContext*>(this); | 65 return reinterpret_cast<OrthancPluginDatabaseContext*>(this); |
87 } | 66 } |
88 | 67 |
89 void CheckSuccess(OrthancPluginErrorCode code); | 68 void CheckSuccess(OrthancPluginErrorCode code); |
90 | |
91 void ResetAnswers(); | |
92 | |
93 void ForwardAnswers(std::list<int64_t>& target); | |
94 | |
95 void ForwardAnswers(std::list<std::string>& target); | |
96 | |
97 bool ForwardSingleAnswer(std::string& target); | |
98 | |
99 bool ForwardSingleAnswer(int64_t& target); | |
100 | 69 |
101 public: | 70 public: |
102 OrthancPluginDatabase(SharedLibrary& library, | 71 OrthancPluginDatabase(SharedLibrary& library, |
103 PluginsErrorDictionary& errorDictionary, | 72 PluginsErrorDictionary& errorDictionary, |
104 const OrthancPluginDatabaseBackend& backend, | 73 const OrthancPluginDatabaseBackend& backend, |