Mercurial > hg > orthanc-python
annotate Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.methods.h @ 195:d7a6e75558ee java-code-model
documented orthanc.RegisterOnChangeCallback()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 02 Jul 2024 18:56:28 +0200 |
parents | 55473de7694f |
children | 3678a028f1f6 |
rev | line source |
---|---|
186
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
1 /** |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
2 * Python plugin for Orthanc |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
3 * Copyright (C) 2020-2023 Osimis S.A., Belgium |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
4 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
5 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
6 * |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
10 * the License, or (at your option) any later version. |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
11 * |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
15 * Affero General Public License for more details. |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
16 * |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
19 **/ |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
20 |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
21 |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
22 // WARNING: Auto-generated file. Do not modify it by hand. |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
23 |
55473de7694f
added warning about auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
184
diff
changeset
|
24 |
129
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 // Actual implementation of the methods |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistIsMatch( |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 PythonLock::LogCall("Calling method OrthancPluginWorklistIsMatch() on object of class OrthancPluginWorklistQuery"); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 if (self->object_ == NULL) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 return NULL; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 Py_buffer arg0; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 if (!PyArg_ParseTuple(args, "s*", &arg0)) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 return NULL; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 } |
174
e9be3c9294d4
[IMPORTANT] replaced old auto-generated code with Java code model
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
44 |
184
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
45 long value; |
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
46 { |
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
47 PythonThreadsAllower allower; |
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
48 value = OrthancPluginWorklistIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); |
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
49 } |
129
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 PyBuffer_Release(&arg0); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 return PyLong_FromLong(value); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistGetDicomQuery( |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 PythonLock::LogCall("Calling method OrthancPluginWorklistGetDicomQuery() on object of class OrthancPluginWorklistQuery"); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 if (self->object_ == NULL) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 return NULL; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
174
e9be3c9294d4
[IMPORTANT] replaced old auto-generated code with Java code model
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
66 |
129
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 OrthancPlugins::MemoryBuffer buffer; |
184
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
68 OrthancPluginErrorCode code; |
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
69 { |
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
70 PythonThreadsAllower allower; |
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
71 code = OrthancPluginWorklistGetDicomQuery(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); |
f34f3a149c22
added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
72 } |
129
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 if (code == OrthancPluginErrorCode_Success) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 else |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 PythonLock::RaiseException(code); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 return NULL; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 |