Skip to content

Commit

Permalink
Fix Python wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed Apr 13, 2017
1 parent 41bda87 commit 027d506
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
7 changes: 6 additions & 1 deletion wrappers/GetSCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ void wrap_GetSCP()

scope get_scp_scope = class_<GetSCP>("GetSCP", init<Association &>())
.def("set_generator", &set_generator)
.def("__call__", &odil::GetSCP::operator())
.def(
"__call__",
static_cast<
void (GetSCP::*)(message::Message const &)
>(&GetSCP::operator())
)
;

class_<DataSetGeneratorWrapperGet, boost::noncopyable>(
Expand Down
7 changes: 6 additions & 1 deletion wrappers/StoreSCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void wrap_StoreSCP()
class_<StoreSCP>("StoreSCP", init<Association&>())
.def(init<Association&, StoreSCP::Callback& >())
.def("set_callback", &set_callback)
.def("__call__", &StoreSCP::operator())
.def(
"__call__",
static_cast<
void (StoreSCP::*)(message::Message const &)
>(&StoreSCP::operator())
)
;

}
14 changes: 9 additions & 5 deletions wrappers/StoreSCU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@

#include "odil/StoreSCU.h"

BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(storeMethod, odil::StoreSCU::store, 1, 3)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(
store_overloads, odil::StoreSCU::store, 1, 3)

void wrap_StoreSCU()
{
using namespace boost::python;
using namespace odil;

typedef
void (StoreSCU::*StoreFunction)(
DataSet const &, Value::String const &, Value::Integer) const;

class_<StoreSCU>("StoreSCU", init<Association &>())
.def(
"get_affected_sop_class",
Expand All @@ -28,9 +33,8 @@ void wrap_StoreSCU()
static_cast<void(StoreSCU::*)(DataSet const &)>(&StoreSCU::set_affected_sop_class)
)
.def(
"store",
&StoreSCU::store,
storeMethod()
)
"store",
static_cast<StoreFunction>(&odil::StoreSCU::store),
store_overloads())
;
}

0 comments on commit 027d506

Please sign in to comment.