1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef _SRC_PY_CPP_PYOPTICSMODEL_HH_
19
#define _SRC_PY_CPP_PYOPTICSMODEL_HH_
21
// These ifdefs are required to avoid cpp compiler warning
22
#ifdef _POSIX_C_SOURCE
23
#undef _POSIX_C_SOURCE
34
class OpticsModel; // note this is just in MAUS namespace
36
namespace PyOpticsModel {
38
/** PyOpticsModel is the python implementation of the C++ OpticsModel class
45
/** _alloc allocates memory for PyOpticsModel
47
PyObject *_alloc(PyTypeObject *self, Py_ssize_t nitems);
49
/** _new allocates and initialises memory for PyOpticsModel
51
PyObject *_new(PyTypeObject *self, Py_ssize_t nitems);
53
/** _init initialises an allocated PyOpticsModel object
55
int _init(PyObject* self, PyObject *args, PyObject *kwds);
57
/** deallocate memory */
58
void _dealloc(PyOpticsModel * self);
60
/** synonym for dealloc */
61
void _free(PyOpticsModel * self);
63
/** Initialise optics_model module
65
* This is called by import optics_model; it initialises the OpticsModel type
66
* allowing user to construct and call methods on OpticsModel objects
68
PyMODINIT_FUNC initoptics_model(void);
70
/** Return the C++ optics model associated with a PyOpticsModel
72
* OpticsModel still owns the memory allocated to PyOpticsModel
74
OpticsModel* get_optics_model(PyOpticsModel* py_model);
76
} // namespace PyOpticsModel
79
#endif // _SRC_PY_CPP_PYFIELDS_HH_