Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::txn_test_gen_plugin Class Reference

#include <txn_test_gen_plugin.hpp>

Inheritance diagram for sysio::txn_test_gen_plugin:
Collaboration diagram for sysio::txn_test_gen_plugin:

Public Member Functions

 txn_test_gen_plugin ()
 
 ~txn_test_gen_plugin ()
 
 APPBASE_PLUGIN_REQUIRES ((http_plugin)(chain_plugin)) virtual void set_program_options(options_description &
 
void plugin_initialize (const variables_map &options)
 
void plugin_startup ()
 
void plugin_shutdown ()
 
- Public Member Functions inherited from appbase::plugin< txn_test_gen_plugin >
 plugin ()
 
virtual ~plugin ()
 
virtual state get_state () const override
 
virtual const std::string & name () const override
 
virtual void register_dependencies ()
 
virtual void initialize (const variables_map &options) override
 
virtual void handle_sighup () override
 
virtual void startup () override
 
virtual void shutdown () override
 
- Public Member Functions inherited from appbase::abstract_plugin
virtual ~abstract_plugin ()
 
virtual void set_program_options (options_description &cli, options_description &cfg)=0
 

Public Attributes

options_description &cfg override
 

Additional Inherited Members

- Public Types inherited from appbase::abstract_plugin
enum  state { registered , initialized , started , stopped }
 
- Protected Member Functions inherited from appbase::plugin< txn_test_gen_plugin >
 plugin (const string &name)
 

Detailed Description

Definition at line 10 of file txn_test_gen_plugin.hpp.

Constructor & Destructor Documentation

◆ txn_test_gen_plugin()

sysio::txn_test_gen_plugin::txn_test_gen_plugin ( )

Definition at line 436 of file txn_test_gen_plugin.cpp.

436{}

◆ ~txn_test_gen_plugin()

sysio::txn_test_gen_plugin::~txn_test_gen_plugin ( )

Definition at line 437 of file txn_test_gen_plugin.cpp.

437{}

Member Function Documentation

◆ APPBASE_PLUGIN_REQUIRES()

sysio::txn_test_gen_plugin::APPBASE_PLUGIN_REQUIRES ( (http_plugin)(chain_plugin) ) &

◆ plugin_initialize()

void sysio::txn_test_gen_plugin::plugin_initialize ( const variables_map & options)

Definition at line 447 of file txn_test_gen_plugin.cpp.

447 {
448 try {
449 my.reset( new txn_test_gen_plugin_impl );
450 my->txn_reference_block_lag = options.at( "txn-reference-block-lag" ).as<int32_t>();
451 my->thread_pool_size = options.at( "txn-test-gen-threads" ).as<uint16_t>();
452 const std::string thread_pool_account_prefix = options.at( "txn-test-gen-account-prefix" ).as<std::string>();
453 my->newaccountA = sysio::chain::name(thread_pool_account_prefix + "a");
454 my->newaccountB = sysio::chain::name(thread_pool_account_prefix + "b");
455 my->newaccountT = sysio::chain::name(thread_pool_account_prefix + "t");
456 SYS_ASSERT( my->thread_pool_size > 0, chain::plugin_config_exception,
457 "txn-test-gen-threads ${num} must be greater than 0", ("num", my->thread_pool_size) );
459}
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
#define FC_LOG_AND_RETHROW()
unsigned short uint16_t
Definition stdint.h:125
signed int int32_t
Definition stdint.h:123
Immutable except for fc::from_variant.
Definition name.hpp:43

◆ plugin_shutdown()

void sysio::txn_test_gen_plugin::plugin_shutdown ( )

Definition at line 469 of file txn_test_gen_plugin.cpp.

469 {
470 try {
471 my->stop_generation();
472 }
473 catch(const std::exception& e) {
474 }
475}

◆ plugin_startup()

void sysio::txn_test_gen_plugin::plugin_startup ( )

Definition at line 461 of file txn_test_gen_plugin.cpp.

461 {
462 app().get_plugin<http_plugin>().add_api({
463 CALL_ASYNC(txn_test_gen, my, create_test_accounts, INVOKE_ASYNC_R_R(my, create_test_accounts, std::string, std::string), 200),
464 CALL(txn_test_gen, my, stop_generation, INVOKE_V_V(my, stop_generation), 200),
465 CALL(txn_test_gen, my, start_generation, INVOKE_V_R_R_R(my, start_generation, std::string, uint64_t, uint64_t), 200)
466 });
467}
abstract_plugin & get_plugin(const string &name) const
#define CALL(call_name, http_response_code)
application & app()
#define INVOKE_V_V(api_handle, call_name)
#define CALL_ASYNC(api_name, api_handle, call_name, call_result, INVOKE, http_response_code)
unsigned __int64 uint64_t
Definition stdint.h:136
#define INVOKE_V_R_R_R(api_handle, call_name, in_param0, in_param1, in_param2)
#define INVOKE_ASYNC_R_R(api_handle, call_name, in_param0, in_param1)
Here is the call graph for this function:

Member Data Documentation

◆ override

options_description& cfg sysio::txn_test_gen_plugin::override

Definition at line 16 of file txn_test_gen_plugin.hpp.


The documentation for this class was generated from the following files: