file dispatcher.hpp

Defines

Type

Name

define

ARISEN_DISPATCH

Defines Documentation

define ARISEN_DISPATCH

#define ARISEN_DISPATCH(TYPE, MEMBERS)\
extern "C" { \
   [[arisen::wasm_entry]] \
   void apply( uint64_t receiver, uint64_t code, uint64_t action ) { \
      if( code == receiver ) { \
         switch( action ) { \
            ARISEN_DISPATCH_HELPER( TYPE, MEMBERS ) \
         } \
         /* does not allow destructor of thiscontract to run: arisen_exit(0); */ \
      } \
   } \
} \

Convenient macro to create contract apply handler

Note:

To be able to use this macro, the contract needs to be derived from arisen::contract

Parameters:

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

ARISEN_DISPATCH( arisen::bios, (setpriv)(setalimits)(setglimits)(setprods)(reqauth) )