eos/plugins/template_plugin定义了eos项目中所有插件的模板
class template_plugin : public appbase::plugin<template_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<class template_plugin_impl> my;
};
static appbase::abstract_plugin& _template_plugin = app().register_plugin<template_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<string>()->default_value("default value"),
"Option Description")
;
}
void template_plugin::plugin_initialize(const variables_map& options) {
try {
if( options.count( "option-name" )) {
}
}
FC_LOG_AND_RETHROW()
}
void template_plugin::plugin_startup() {
}
void template_plugin::plugin_shutdown() {
}
|