message: Add docs for dispatcher
diff: #include <boost/mp11/tuple.hpp>
  #define N(X) ::eosio::string_to_name(#X)
  namespace eosio {
  +
  template<typename Contract, typename FirstAction>
  bool dispatch( uint64_t code, uint64_t act ) {
  if( code == FirstAction::get_account() && FirstAction::get_name() == act ) {
  @@ -25,7 +26,7 @@ namespace eosio {
  * static Contract::on( ActionType )
  * ```
  *
  - * For this to work the Actions must be dervied from the
  + * For this to work the Actions must be derived from eosio::contract
  *
  */
  template<typename Contract, typename FirstAction, typename SecondAction, typename... Actions>
  @@ -37,6 +38,24 @@ namespace eosio {
  return eosio::dispatch<Contract,SecondAction,Actions...>( code, act );
  }
  + /**
  + * @defgroup dispatcher Dispatcher
  + * @brief Dispatch action to proper action handler inside a contract
  + * @ingroup contractdev
  + * @{
  + */
  +
  + /**
  + * Unpack the received action and execute the correponding action handler
  + *
  + * @brief Unpack the received action and execute the correponding action handler
  + * @tparam T - The contract class that has the correponding action handler, this contract should be derived from eosio::contract
  + * @tparam Q - The namespace of the action handler function
  + * @tparam Args - The arguments that the action handler accepts, i.e. members of the action
  + * @param obj - The contract object that has the correponding action handler
  + * @param func - The action handler
  + * @return true
  + */
  template<typename T, typename Q, typename... Args>
  bool execute_action( T* obj, void (Q::*func)(Args...) ) {
  size_t size = action_data_size();
  @@ -62,15 +81,36 @@ namespace eosio {
  boost::mp11::tuple_apply( f2, args );
  return true;
  }
  + /// @} dispatcher
  +// Helper macro for EOSIO_API
  #define EOSIO_API_CALL( r, OP, elem ) \
  case ::eosio::string_to_name( BOOST_PP_STRINGIZE(elem) ): \
  eosio::execute_action( &thiscontract, &OP::elem ); \
  return;
  +// Helper macro for EOSIO_ABI
  #define EOSIO_API( TYPE, MEMBERS ) \
  BOOST_PP_SEQ_FOR_EACH( EOSIO_API_CALL, TYPE, MEMBERS )
  +/**
  + * @addtogroup dispatcher
  + * @{
  + */
  +
  +/**
  + * Convenient macro to create contract apply handler
  + * To be able to use this macro, the contract needs to be derived from eosio::contract
  + *
  + * @brief Convenient macro to create contract apply handler
  + * @param TYPE - The class name of the contract
  + * @param MEMBERS - The sequence of available actions supported by this contract
  + *
  + * Example:
  + * @code
  + * EOSIO_ABI( eosio::bios, (setpriv)(setalimits)(setglimits)(setprods)(reqauth) )
  + * @endcode
  + */
  #define EOSIO_ABI( TYPE, MEMBERS ) \
  extern "C" { \
  void apply( uint64_t receiver, uint64_t code, uint64_t action ) { \
  @@ -84,6 +124,7 @@ extern "C" { \
  } \
  } \
  } \
  + /// @} dispatcher
  /*
  