diff --git a/module_bindings/dripline_core/message_pybind.hh b/module_bindings/dripline_core/message_pybind.hh index 706c0053..c5e63d42 100644 --- a/module_bindings/dripline_core/message_pybind.hh +++ b/module_bindings/dripline_core/message_pybind.hh @@ -1,6 +1,8 @@ #ifndef DRIPLINE_PYBIND_MESSAGE #define DRIPLINE_PYBIND_MESSAGE +#include "binding_helpers.hh" + #include "message.hh" #include "message_trampoline.hh" @@ -29,10 +31,10 @@ namespace dripline_pybind message ********/ all_items.push_back( "Message" ); - pybind11::class_< dripline::message, message_trampoline, std::shared_ptr< dripline::message > > message( mod, "Message" ); + pybind11::class_< dripline::message, message_trampoline, std::shared_ptr< dripline::message > > message( mod, "Message", "base class for all dripline messages" ); // internal types - pybind11::enum_< dripline::message::encoding >( message, "encoding" ) + pybind11::enum_< dripline::message::encoding >( message, "encoding", "mime-type of message encoding" ) .value( "json", dripline::message::encoding::json ) ; @@ -78,26 +80,22 @@ namespace dripline_pybind .def( "create_amqp_messages", &dripline::message::create_amqp_messages, "From message object to AMQP", - pybind11::call_guard< pybind11::scoped_ostream_redirect, - pybind11::scoped_estream_redirect >() + DL_BIND_CALL_GUARD_STREAMS ) .def( "encode_message_body", &dripline::message::encode_message_body, "From message object to string", - pybind11::call_guard< pybind11::scoped_ostream_redirect, - pybind11::scoped_estream_redirect >() + DL_BIND_CALL_GUARD_STREAMS ) .def( "derived_modify_amqp_message", &_message::derived_modify_amqp_message, "derived_modify_amqp_message function", - pybind11::call_guard< pybind11::scoped_ostream_redirect, - pybind11::scoped_estream_redirect >() + DL_BIND_CALL_GUARD_STREAMS ) .def( "derived_modify_message_param", &_message::derived_modify_message_param, "derived_modify_amqp_message function", - pybind11::call_guard< pybind11::scoped_ostream_redirect, - pybind11::scoped_estream_redirect >() + DL_BIND_CALL_GUARD_STREAMS ) .def( "encode_full_message", [](const dripline::message& a_message){ return a_message.encode_full_message(4000); } ) @@ -107,7 +105,8 @@ namespace dripline_pybind msg_request ************/ all_items.push_back( "MsgRequest" ); - pybind11::class_< dripline::msg_request, msg_request_trampoline, std::shared_ptr< dripline::msg_request > >( mod, "MsgRequest", message ) + pybind11::class_< dripline::msg_request, msg_request_trampoline, std::shared_ptr< dripline::msg_request > + >( mod, "MsgRequest", message, "dripline messages containing a request to be sent to an endpoint" ) // constructor(s) .def( pybind11::init< >() ) // properties @@ -139,7 +138,8 @@ namespace dripline_pybind pybind11::arg( "routing_key" ) = "", pybind11::arg( "specifier" ) = "", pybind11::arg( "reply_to" ) = "", - pybind11::arg( "encoding" ) = dripline::message::encoding::json + pybind11::arg( "encoding" ) = dripline::message::encoding::json, + "create and populate a new MsgRequest instance" ) .def( "reply", [](dripline::request_ptr_t a_req, @@ -150,6 +150,7 @@ namespace dripline_pybind pybind11::arg( "return_code" ) = 0, pybind11::arg( "return_message" ) = "", pybind11::arg_v( "payload", scarab::param(), "scarab::param()" ) + "construct and send a reply message in response to this request" ) ; @@ -157,7 +158,8 @@ namespace dripline_pybind msg_reply ************/ all_items.push_back( "MsgReply" ); - pybind11::class_< dripline::msg_reply, msg_reply_trampoline, std::shared_ptr< dripline::msg_reply > >( mod, "MsgReply", message ) + pybind11::class_< dripline::msg_reply, msg_reply_trampoline, std::shared_ptr< dripline::msg_reply > + >( mod, "MsgReply", message, "dripline messages containing a reply to a previously received request" ) // constructor(s) .def( pybind11::init< >() ) @@ -184,7 +186,8 @@ namespace dripline_pybind pybind11::arg( "payload" ) = scarab::param(), pybind11::arg( "routing_key" ) = "", pybind11::arg( "specifier" ) = "", - pybind11::arg( "encoding" ) = dripline::message::encoding::json + pybind11::arg( "encoding" ) = dripline::message::encoding::json, + "create and populate a new MsgReply instance" ) .def_static( "create", [](unsigned a_retcode_value, @@ -196,6 +199,7 @@ namespace dripline_pybind pybind11::arg( "return_message" ) = "", pybind11::arg( "payload" ) = scarab::param(), pybind11::arg( "msg_request" ) = dripline::message::encoding::json + "create and populate a new MsgReply instance" ) ; @@ -203,7 +207,8 @@ namespace dripline_pybind msg_alert ************/ all_items.push_back( "MsgAlert" ); - pybind11::class_< dripline::msg_alert, msg_alert_trampoline, std::shared_ptr< dripline::msg_alert > >( mod, "MsgAlert", message ) + pybind11::class_< dripline::msg_alert, msg_alert_trampoline, std::shared_ptr< dripline::msg_alert > + >( mod, "MsgAlert", message, "dripline message containing alert information" ) // constructor(s) .def( pybind11::init< >() ) @@ -217,7 +222,8 @@ namespace dripline_pybind pybind11::arg( "payload" ) = scarab::param(), pybind11::arg( "routing_key" ) = "", pybind11::arg( "specifier" ) = "", - pybind11::arg( "encoding" ) = dripline::message::encoding::json + pybind11::arg( "encoding" ) = dripline::message::encoding::json, + "create and populate a new MsgAlert instance" ) ; diff --git a/module_bindings/dripline_core/scheduler_pybind.hh b/module_bindings/dripline_core/scheduler_pybind.hh index e6e09cad..573177ce 100644 --- a/module_bindings/dripline_core/scheduler_pybind.hh +++ b/module_bindings/dripline_core/scheduler_pybind.hh @@ -29,20 +29,23 @@ namespace dripline_pybind //TODO: does it make sense to provide access to the events map? That will require wrapping the stuct they get stored into. .def( "schedule", - (int (dripline::scheduler::*)(executable_t, clock_t::time_point)) &dripline::scheduler::schedule, - pybind11::arg( "executable" ), - pybind11::arg( "time" ), - "schedule execution of executable at specified future time" - ) + (int (dripline::scheduler::*)(executable_t, clock_t::time_point)) &dripline::scheduler::schedule, + pybind11::arg( "executable" ), + pybind11::arg( "time" ), + "schedule execution of executable at specified future time") .def( "schedule", - (int (dripline::scheduler::*)(executable_t, clock_t::duration, clock_t::time_point)) &dripline::scheduler::schedule, - pybind11::arg( "executable" ), - pybind11::arg( "interval" ), - pybind11::arg_v( "time", clock_t::now(), "now()" ), - "schedule recurring execution of [executable] every [interval], starting at specified future [time]" - ) - .def( "unschedule", &dripline::scheduler::unschedule, pybind11::arg( "id" ), "Cancel a scheduled function call by its id" ) - .def( "execute", &dripline::scheduler::execute, "Start the timing thread which executes scheduled actions" ) + (int (dripline::scheduler::*)(executable_t, clock_t::duration, clock_t::time_point)) &dripline::scheduler::schedule, + pybind11::arg( "executable" ), + pybind11::arg( "interval" ), + pybind11::arg_v( "time", clock_t::now(), "now()" ), + "schedule recurring execution of [executable] every [interval], starting at specified future [time]") + .def( "unschedule", + &dripline::scheduler::unschedule, + pybind11::arg( "id" ), + "Cancel a scheduled function call by its id" ) + .def( "execute", + &dripline::scheduler::execute, + "Start the timing thread which executes scheduled actions" ) ; return all_items;