~christopher-hunt08/maus/maus_integrated_kalman

« back to all changes in this revision

Viewing changes to src/input/InputCppRoot/InputCppRoot.i

  • Committer: Durga Rajaram
  • Date: 2014-07-16 15:13:05 UTC
  • mfrom: (659.1.92 cand)
  • Revision ID: durga@fnal.gov-20140716151305-q27rv1y9p03v9lks
Tags: MAUS-v0.9, MAUS-v0.9.0
MAUS-v0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%include std_string.i
2
 
%include cpointer.i
3
 
%include exception.i
4
 
 
5
 
// any exceptions thrown following this declaration should make a python
6
 
// exception
7
 
%exception {
8
 
  try {
9
 
    $function
10
 
  }
11
 
  catch (const std::exception& exc) {
12
 
    PyErr_SetString(PyExc_RuntimeError, (&exc)->what());
13
 
    return NULL;
14
 
  }
15
 
}
16
 
 
17
 
%{
18
 
#include "src/common_cpp/API/IModule.hh"
19
 
#include "src/common_cpp/API/ModuleBase.hh"
20
 
#include "src/common_cpp/API/IInput.hh"
21
 
#include "src/common_cpp/API/InputBase.hh"
22
 
using namespace std;
23
 
%}
24
 
 
25
 
%include "src/common_cpp/API/IModule.hh"
26
 
%include "src/common_cpp/API/ModuleBase.hh"
27
 
%include "src/common_cpp/API/IInput.hh"
28
 
%include "src/common_cpp/API/InputBase.hh"
29
 
 
30
 
%define INPUTBASE_WRAP(OUTPUT) 
31
 
 
32
 
    %template(IInput ## OUTPUT) MAUS::IInput<OUTPUT>;
33
 
    %template(InputBase ## OUTPUT) MAUS::InputBase<OUTPUT>;
34
 
 
35
 
    #ifndef OUTPUT ## p
36
 
    %pointer_functions(OUTPUT,  OUTPUT  ## p);
37
 
    #define OUTPUT ## p
38
 
    #endif
39
 
 
40
 
%enddef
41
 
 
42
 
%feature("shadow") MAUS::InputBase::emitter() %{
43
 
def emitter(self):
44
 
    next_event = self.emitter_cpp()
45
 
    while next_event != "":
46
 
        yield next_event
47
 
        next_event = self.emitter_cpp()
48
 
%}
49
 
 
50
 
using namespace std;
51
 
INPUTBASE_WRAP(string)
52
 
 
53
 
%module InputCppRoot
54
 
%{
55
 
#include "InputCppRoot.hh"
56
 
%}
57
 
 
58
 
%include "InputCppRoot.hh"
59
 
 
60