GNU Radio Manual and C++ API Reference
3.7.5
The Free & Open Software Radio Ecosystem
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
py_feval.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 2006,2013 Free Software Foundation, Inc.
4
*
5
* This file is part of GNU Radio
6
*
7
* GNU Radio is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3, or (at your option)
10
* any later version.
11
*
12
* GNU Radio is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with GNU Radio; see the file COPYING. If not, write to
19
* the Free Software Foundation, Inc., 51 Franklin Street,
20
* Boston, MA 02110-1301, USA.
21
*/
22
23
#ifndef INCLUDED_GR_PY_FEVAL_H
24
#define INCLUDED_GR_PY_FEVAL_H
25
26
#include <
pmt/pmt.h
>
27
#include <
gnuradio/feval.h
>
28
29
class
ensure_py_gil_state
{
30
PyGILState_STATE d_gstate;
31
public
:
32
ensure_py_gil_state
() { d_gstate = PyGILState_Ensure(); }
33
~ensure_py_gil_state
() { PyGILState_Release(d_gstate); }
34
};
35
36
namespace
gr {
37
38
class
GR_RUNTIME_API
py_feval_dd
:
public
feval_dd
39
{
40
public
:
41
double
calleval(
double
x)
42
{
43
ensure_py_gil_state
_lock;
44
return
eval(x);
45
}
46
virtual
~py_feval_dd
() {};
47
};
48
49
class
GR_RUNTIME_API
py_feval_cc
:
public
feval_cc
50
{
51
public
:
52
gr_complex
calleval(
gr_complex
x)
53
{
54
ensure_py_gil_state
_lock;
55
return
eval(x);
56
}
57
virtual
~py_feval_cc
() {};
58
};
59
60
class
GR_RUNTIME_API
py_feval_ll
:
public
feval_ll
61
{
62
public
:
63
long
calleval(
long
x)
64
{
65
ensure_py_gil_state
_lock;
66
return
eval(x);
67
}
68
virtual
~py_feval_ll
() {};
69
};
70
71
class
GR_RUNTIME_API
py_feval
:
public
feval
72
{
73
public
:
74
void
calleval()
75
{
76
ensure_py_gil_state
_lock;
77
eval();
78
}
79
virtual
~py_feval
() {};
80
};
81
82
class
GR_RUNTIME_API
py_feval_p
:
public
feval_p
83
{
84
public
:
85
void
calleval(
pmt::pmt_t
x)
86
{
87
ensure_py_gil_state
_lock;
88
eval(x);
89
}
90
virtual
~py_feval_p
() {};
91
};
92
93
}
/* namespace gr */
94
95
#endif
/* INCLUDED_GR_PY_FEVAL_H */
gnuradio-runtime
include
gnuradio
py_feval.h
Generated on Fri Oct 3 2014 00:33:51 for GNU Radio Manual and C++ API Reference by
1.8.1.2