file action.hpp
Classes
Type | Name |
---|---|
struct | eosio::permission_level |
struct | eosio::action |
struct | eosio::action_wrapper Used to wrap an a particular action to simplify the process of other contracts sending inline actions to "wrapped" action. Example: |
struct | eosio::variant_action_wrapper |
struct | eosio::inline_dispatcher |
struct | eosio::inline_dispatcher< void(T::*)(Args...), Name > |
Defines
Type | Name |
---|---|
define | INLINE_ACTION_SENDER3 |
define | INLINE_ACTION_SENDER2 |
define | INLINE_ACTION_SENDER |
define | SEND_INLINE_ACTION A macro to simplify calling inline actions. |
Detailed Description
Copyright
defined in eos/LICENSE
Defines Documentation
define INLINE_ACTION_SENDER3
#define INLINE_ACTION_SENDER3(CONTRACT_CLASS, FUNCTION_NAME, ACTION_NAME) ::eosio::inline_dispatcher<decltype(&CONTRACT_CLASS::FUNCTION_NAME), ACTION_NAME>::call
define INLINE_ACTION_SENDER2
#define INLINE_ACTION_SENDER2(CONTRACT_CLASS, NAME) INLINE_ACTION_SENDER3( CONTRACT_CLASS, NAME, ::eosio::name(#NAME) )
define INLINE_ACTION_SENDER
#define INLINE_ACTION_SENDER(...) BOOST_PP_OVERLOAD(INLINE_ACTION_SENDER,__VA_ARGS__)(__VA_ARGS__)
define SEND_INLINE_ACTION
#define SEND_INLINE_ACTION(CONTRACT, NAME, ...)\
INLINE_ACTION_SENDER(std::decay_t<decltype(CONTRACT)>, NAME)( (CONTRACT).get_self(),\
BOOST_PP_TUPLE_ENUM(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)) );
A macro to simplify calling inline actions.
Send an inline-action from inside a contract. The send inline action macro is intended to simplify the process of calling inline actions. When calling new actions from existing actions EOSIO supports two communication models, inline and deferred. Inline actions are executed as part of the current transaction. This macro creates an Action using the supplied parameters and automatically calls action.send() on this newly created action. Example:
SEND_INLINE_ACTION( *this, transfer, {st.issuer,N(active)}, {st.issuer, to, quantity, memo} );
The example above is taken from eosio.token. This example: uses the passed in, dereferenced this
pointer, to call this.get_self() i.e. the eosio.token contract; calls the eosio.token::transfer() action; uses the active permission of the "issuer" account; uses parameters st.issuer, to, quantity and memo. This macro creates an action struct used to 'send()' (call) transfer(account_name from, account_name to, asset quantity, string memo)
Parameters:
- CONTRACT - The contract to call, which contains the action being sent, maps to the account
- NAME - The name of the action to be called, maps to a Name
- ... - The authorising permission, maps to an authorization , followed by the parameters of the action, maps to a data.
The documentation for this class was generated from the following file: libraries/eosiolib/contracts/eosio/action.hpp