Defines

Type Name
define EOSIO_DISPATCH_INTERNAL
define EOSIO_DISPATCH_HELPER
define EOSIO_DISPATCH
Convenient macro to create contract apply handler.

Defines Documentation

define EOSIO_DISPATCH_INTERNAL

#define EOSIO_DISPATCH_INTERNAL(r, OP, elem)\
case eosio::name( BOOST_PP_STRINGIZE(elem) ).value: \
      eosio::execute_action( eosio::name(receiver), eosio::name(code), &OP::elem ); \
      break;

define EOSIO_DISPATCH_HELPER

#define EOSIO_DISPATCH_HELPER(TYPE, MEMBERS) BOOST_PP_SEQ_FOR_EACH( EOSIO_DISPATCH_INTERNAL, TYPE, MEMBERS )

define EOSIO_DISPATCH

#define EOSIO_DISPATCH(TYPE, MEMBERS)\
extern "C" { \
   void apply( uint64_t receiver, uint64_t code, uint64_t action ) { \
      if( code == receiver ) { \
         switch( action ) { \
            EOSIO_DISPATCH_HELPER( TYPE, MEMBERS ) \
         } \
         /* does not allow destructor of thiscontract to run: eosio_exit(0); */ \
      } \
   } \
} \

Convenient macro to create contract apply handler.

Convenient macro to create contract apply handler To be able to use this macro, the contract needs to be derived from eosio::contract

Parameters:

  • TYPE - The class name of the contract
  • MEMBERS - The sequence of available actions supported by this contract

Example:

EOSIO_DISPATCH( eosio::bios, (setpriv)(setalimits)(setglimits)(setprods)(reqauth) )

The documentation for this class was generated from the following file: libraries/eosiolib/dispatcher.hpp