comparison OrthancServer/Sources/JobEvent.h @ 5410:16cbfefa15e9

Solved a deadlock related to the Job Engine events and plugins
author Alain Mazy <am@osimis.io>
date Tue, 07 Nov 2023 12:52:37 +0100
parents
children 48b8dae6dc77
comparison
equal deleted inserted replaced
5409:68231ca4363a 5410:16cbfefa15e9
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 **/
21
22
23 #pragma once
24
25 #include "ServerEnumerations.h"
26 #include "../../OrthancFramework/Sources/IDynamicObject.h"
27 #include "../../OrthancFramework/Sources/SystemToolbox.h"
28
29 #include <string>
30 #include <json/value.h>
31
32 namespace Orthanc
33 {
34 enum JobEventType
35 {
36 JobEventType_Failure,
37 JobEventType_Submitted,
38 JobEventType_Success
39 };
40
41
42 struct JobEvent : public IDynamicObject
43 {
44 private:
45 JobEventType eventType_;
46 std::string jobId_;
47
48 public:
49 JobEvent(JobEventType eventType,
50 const std::string& jobId) :
51 eventType_(eventType),
52 jobId_(jobId)
53 {
54 }
55
56 JobEvent(const JobEvent& other)
57 : eventType_(other.eventType_),
58 jobId_(other.jobId_)
59 {
60 }
61
62 // JobEvent* Clone() const
63 // {
64 // return new JobEvent(*this);
65 // }
66
67 JobEventType GetEventType() const
68 {
69 return eventType_;
70 }
71
72 const std::string& GetJobId() const
73 {
74 return jobId_;
75 }
76 };
77 }