Mercurial > hg > orthanc-python
comparison Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.impl.h @ 129:5643e97d9367 fix-leak
reproducible code generation
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Aug 2023 11:40:22 +0200 |
parents | eb6ac5a801d1 |
children | c55b0583084b |
comparison
equal
deleted
inserted
replaced
128:5b59ebc267e1 | 129:5643e97d9367 |
---|---|
78 }; | 78 }; |
79 | 79 |
80 | 80 |
81 | 81 |
82 | 82 |
83 // Actual implementation of the methods | |
84 static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistIsMatch( | |
85 sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) | |
86 { | |
87 PythonLock::LogCall("Calling method OrthancPluginWorklistIsMatch() on object of class OrthancPluginWorklistQuery"); | |
88 | |
89 if (self->object_ == NULL) | |
90 { | |
91 PyErr_SetString(PyExc_ValueError, "Invalid object"); | |
92 return NULL; | |
93 } | |
94 | |
95 Py_buffer arg0; | |
96 | |
97 if (!PyArg_ParseTuple(args, "s*", &arg0)) | |
98 { | |
99 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
100 return NULL; | |
101 } | |
102 long value = OrthancPluginWorklistIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); | |
103 PyBuffer_Release(&arg0); | |
104 return PyLong_FromLong(value); | |
105 } | |
106 | |
107 static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistGetDicomQuery( | |
108 sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) | |
109 { | |
110 PythonLock::LogCall("Calling method OrthancPluginWorklistGetDicomQuery() on object of class OrthancPluginWorklistQuery"); | |
111 | |
112 if (self->object_ == NULL) | |
113 { | |
114 PyErr_SetString(PyExc_ValueError, "Invalid object"); | |
115 return NULL; | |
116 } | |
117 | |
118 | |
119 OrthancPlugins::MemoryBuffer buffer; | |
120 OrthancPluginErrorCode code = OrthancPluginWorklistGetDicomQuery(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); | |
121 | |
122 if (code == OrthancPluginErrorCode_Success) | |
123 { | |
124 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
125 } | |
126 else | |
127 { | |
128 PythonLock::RaiseException(code); | |
129 return NULL; | |
130 } | |
131 } | |
132 | |
133 | |
134 | |
135 static void RegisterOrthancPluginWorklistQueryClass(PyObject* module) | 83 static void RegisterOrthancPluginWorklistQueryClass(PyObject* module) |
136 { | 84 { |
137 sdk_OrthancPluginWorklistQuery_Type.tp_new = PyType_GenericNew; | 85 sdk_OrthancPluginWorklistQuery_Type.tp_new = PyType_GenericNew; |
138 sdk_OrthancPluginWorklistQuery_Type.tp_flags = Py_TPFLAGS_DEFAULT; | 86 sdk_OrthancPluginWorklistQuery_Type.tp_flags = Py_TPFLAGS_DEFAULT; |
139 sdk_OrthancPluginWorklistQuery_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginWorklistQuery"; | 87 sdk_OrthancPluginWorklistQuery_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginWorklistQuery"; |