odtone::sap::user
// In header: </home/carlos/Projectos/odtone/inc/odtone/sap/user.hpp> class user : public odtone::sap::sap { public: // member classes/structs/unions struct config { // construct/copy/destruct config(); // public data members std::string id; uint port; ip_address mihf_address; uint mihf_port; size_t buffer_length; }; // construct/copy/destruct user(const mih::config &, boost::asio::io_service &, const handler &); user(boost::asio::io_service &, const handler &, const config & = config()); ~user(); // public member functions template<typename CompletionHandler> void async_send(mih::message &, CompletionHandler); // private member functions void async_send_(mih::message &, handler &&); void recv_handler(buffer< uint8 > &, size_t, const boost::system::error_code &); void send_handler(mih::frame_vla &, handler &, const boost::system::error_code &); void get_handler(uint, handler &); };
MIH-User SAP I/O Service
This module handles the comunication between MIH-User SAP and its local the MIHF. After being initialized, and in order to run this service, it must be invoked the run() method of the boost::asio::io_service associated.
user
public
construct/copy/destructuser(const mih::config & cfg, boost::asio::io_service & io, const handler & h);
Construct a MIH-User SAP I/O Service. The defined callback is invoked when a request message is received The signature of the callback is: void(odtone::mih::message&, const boost::system::error_code&).
Parameters: |
|
user(boost::asio::io_service & io, const handler & h, const config & cfg = config());
Construct a MIH-User SAP I/O Service. The defined callback is invoked when a request message is received The signature of the callback is: void(odtone::mih::message&, const boost::system::error_code&).
Parameters: |
|
~user();
Destruct a MIH-User SAP I/O Service.
user
public member functionstemplate<typename CompletionHandler> void async_send(mih::message & pm, CompletionHandler h);
Asynchronously send a MIH message to the local MIHF. After sending the message, the callback is called to report the success or failure in delivering the message to the local MIHF. This method retuns immediately.
Parameters: |
|
user
private member functionsvoid async_send_(mih::message & msg, handler && h);
Asynchronously send a MIH message to the local MIHF. After sending the message, the callback is called to report the success or failure in delivering the message to the local MIHF. This method retuns immediately.
Parameters: |
|
void recv_handler(buffer< uint8 > & buff, size_t rbytes, const boost::system::error_code & ec);
Received message callback. This function is executed to process the received messages. If this is a valid message, the message is dispatched to the handler defined by the user.
Parameters: |
|
void send_handler(mih::frame_vla & fm, handler & h, const boost::system::error_code & ec);
Sent message handler. After sending the message, this function is called to report the success or failure in delivering the message to the local MIHF.
Parameters: |
|
void get_handler(uint tid, handler & h);
Get the message handler function of the message.
Parameters: |
|