Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph-python
Commits
191491b3
Commit
191491b3
authored
Jan 01, 2011
by
florent
Browse files
Add a function to get the list of type names registered for signals.
* src/signal-caster-py.cc: new.
parent
b5e62358
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/signal-caster-py.cc
0 → 100644
View file @
191491b3
/*
* Copyright 2010 (C) CNRS
* Author: Florent Lamiraux
*/
#include
<Python.h>
#include
<iostream>
#include
<sstream>
#include
<dynamic-graph/signal-caster.h>
namespace
dynamicgraph
{
namespace
python
{
extern
PyObject
*
error
;
namespace
signalCaster
{
PyObject
*
getSignalTypeList
(
PyObject
*
self
,
PyObject
*
args
)
{
void
*
pointer
=
NULL
;
PyObject
*
object
=
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,
""
))
return
NULL
;
std
::
vector
<
std
::
string
>
typeList
=
dynamicgraph
::
g_caster
.
listTypenames
();
unsigned
int
typeNumber
=
typeList
.
size
();
// Build a tuple object
PyObject
*
typeTuple
=
PyTuple_New
(
typeNumber
);
for
(
unsigned
int
iType
=
0
;
iType
<
typeNumber
;
iType
++
)
{
PyObject
*
className
=
Py_BuildValue
(
"s"
,
typeList
[
iType
].
c_str
());
PyTuple_SetItem
(
typeTuple
,
iType
,
className
);
}
return
Py_BuildValue
(
"O"
,
typeTuple
);
}
}
//namespace signalCaster
}
// namespace dynamicgraph
}
// namespace python
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment