~t-carlisle1/maus/test

« back to all changes in this revision

Viewing changes to src/common_cpp/Utils/PyMausCpp.hh

  • Committer: Timothy Carlisle (MICE 2008)
  • Date: 2011-06-22 16:59:28 UTC
  • mfrom: (486.3.56 maus)
  • Revision ID: carlisle@pplxint6.physics.ox.ac.uk-20110622165928-4mr32fa3anlw2odu
bleu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
 
2
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 */
 
17
 
 
18
#ifndef PYMAUSCPP
 
19
#define PYMAUSCPP
 
20
 
 
21
#include "Python.h"
 
22
 
 
23
namespace MAUS {
 
24
 
 
25
/*  @brief Defines some interfaces available in Python from C
 
26
 *
 
27
 *  The interface between Python and C in MAUS is usually done using text files
 
28
 *  (e.g. json). In a few places we need to make some function calls available
 
29
 *  to python. Those function calls are defined here.
 
30
 */
 
31
 
 
32
// Nb: Following tested in tests/py_unit/test_error_handler.py
 
33
 
 
34
/* @brief Initialise the libMausCpp module
 
35
 *
 
36
 * Called by "import libMausCpp" - here we just define the list of functions
 
37
 * available in libMausCpp.
 
38
 */
 
39
PyMODINIT_FUNC initlibMausCpp(void);
 
40
 
 
41
 
 
42
// Nb: Following tested in tests/py_unit/test_error_handler.py and
 
43
//                         tests/cpp_unit/CppErrorHandlerTest.cc
 
44
 
 
45
/* @brief Call back to make Python ErrorHandler by the CppErrorHandler
 
46
 *
 
47
 * Tell C which python function to call in the event of an error by calling the
 
48
 * SetHandleExceptionFunction. Aim is to use the same python code to manage
 
49
 * errors arising from both C and Python; argument is a function with callsign
 
50
 * like\n
 
51
 *
 
52
 *    def HandleExceptionStrings(doc, caller, error_message)
 
53
 *
 
54
 * See also: src/common_py/ErrorHandler, src/common_cpp/CppErrorHandler
 
55
 */
 
56
static PyObject* CppErrorHandler_SetHandleExceptionFunction
 
57
                                              (PyObject *dummy, PyObject *args);
 
58
 
 
59
}  // namespace MAUS
 
60
 
 
61
#endif
 
62