eos/plugins/template_plugin定义了eos项目中所有插件的模板
class template_plugin : public appbase::plugin {public: template_plugin(); virtual ~template_plugin(); APPbase_PLUGIN_REQUIRES() virtual void set_program_options(options_description&, options_description& cfg) override; void plugin_initialize(const variables_map& options); void plugin_startup(); void plugin_shutdown();private: std::unique_ptr my;}; static appbase::abstract_plugin& _template_plugin = app().register_plugin();class template_plugin_impl { public:};template_plugin::template_plugin():my(new template_plugin_impl()){}template_plugin::~template_plugin(){}void template_plugin::set_program_options(options_description&, options_description& cfg) { cfg.add_options() ("option-name", bpo::value()->default_value("default value"), "Option Description") ;}void template_plugin::plugin_initialize(const variables_map& options) { try { if( options.count( "option-name" )) { // Handle the option } } FC_LOG_AND_RETHROW()}void template_plugin::plugin_startup() { // Make the magic happen}void template_plugin::plugin_shutdown() { // OK, that's enough magic}