Defines functions to dispatch action to proper action handler inside a contract.
Modules
- Dispatcher C++ API Defines C++ functions to dispatch action to proper action handler inside a contract.
Defines
Defines Documentation
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) )