annotate Sources/Autogenerated/sdk_OrthancPluginJob.methods.h @ 184:f34f3a149c22 java-code-model

added class PythonThreadsAllower
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 02 Jul 2024 15:49:05 +0200
parents 194ba7d6e0f4
children 55473de7694f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
129
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 // Actual implementation of the methods
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 static PyObject *sdk_OrthancPluginJob_OrthancPluginSubmitJob(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 sdk_OrthancPluginJob_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 PythonLock::LogCall("Calling method OrthancPluginSubmitJob() on object of class OrthancPluginJob");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12
177
008be55355a4 regenerating the wrapper after patching SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
13 long int arg0 = 0;
129
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14
177
008be55355a4 regenerating the wrapper after patching SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
15 if (!PyArg_ParseTuple(args, "l", &arg0))
129
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 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
18 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 }
174
e9be3c9294d4 [IMPORTANT] replaced old auto-generated code with Java code model
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
20
129
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 OrthancPlugins::OrthancString s;
184
f34f3a149c22 added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 178
diff changeset
22 {
f34f3a149c22 added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 178
diff changeset
23 PythonThreadsAllower allower;
f34f3a149c22 added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 178
diff changeset
24 s.Assign(OrthancPluginSubmitJob(OrthancPlugins::GetGlobalContext(), self->object_, arg0));
f34f3a149c22 added class PythonThreadsAllower
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 178
diff changeset
25 }
129
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 if (s.GetContent() == NULL)
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::RaiseException(OrthancPluginErrorCode_InternalError);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 else
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 return PyUnicode_FromString(s.GetContent());
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