Bitshares-Core  2.0.181105
BitShares blockchain implementation and command-line interface software
Public Member Functions | Protected Member Functions | List of all members
graphene::app::plugin Class Reference

#include <plugin.hpp>

Inheritance diagram for graphene::app::plugin:
graphene::app::abstract_plugin

Public Member Functions

 plugin ()
 
virtual ~plugin () override
 
virtual std::string plugin_name () const override
 
virtual std::string plugin_description () const override
 
virtual void plugin_initialize (const boost::program_options::variables_map &options) override
 Perform early startup routines and register plugin indexes, callbacks, etc. More...
 
virtual void plugin_startup () override
 Begin normal runtime operations. More...
 
virtual void plugin_shutdown () override
 Cleanly shut down the plugin. More...
 
virtual void plugin_set_app (application *app) override
 Register the application instance with the plugin. More...
 
virtual void plugin_set_program_options (boost::program_options::options_description &command_line_options, boost::program_options::options_description &config_file_options) override
 Fill in command line parameters used by the plugin. More...
 
chain::databasedatabase ()
 
applicationapp () const
 
- Public Member Functions inherited from graphene::app::abstract_plugin
virtual ~abstract_plugin ()
 

Protected Member Functions

net::node & p2p_node ()
 

Detailed Description

Provides basic default implementations of abstract_plugin functions.

Definition at line 97 of file plugin.hpp.

Constructor & Destructor Documentation

◆ plugin()

graphene::app::plugin::plugin ( )

Definition at line 30 of file plugin.cpp.

◆ ~plugin()

graphene::app::plugin::~plugin ( )
overridevirtual

Definition at line 36 of file plugin.cpp.

Member Function Documentation

◆ app()

application& graphene::app::plugin::app ( ) const
inline

Definition at line 115 of file plugin.hpp.

◆ database()

chain::database& graphene::app::plugin::database ( )
inline

Definition at line 114 of file plugin.hpp.

◆ p2p_node()

net::node& graphene::app::plugin::p2p_node ( )
inlineprotected

Definition at line 117 of file plugin.hpp.

◆ plugin_description()

std::string graphene::app::plugin::plugin_description ( ) const
overridevirtual

Implements graphene::app::abstract_plugin.

Definition at line 46 of file plugin.cpp.

◆ plugin_initialize()

void graphene::app::plugin::plugin_initialize ( const boost::program_options::variables_map &  options)
overridevirtual

Perform early startup routines and register plugin indexes, callbacks, etc.

Plugins MUST supply a method initialize() which will be called early in the application startup. This method should contain early setup code such as initializing variables, adding indexes to the database, registering callback methods from the database, adding APIs, etc., as well as applying any options in the options map

This method is called BEFORE the database is open, therefore any routines which require any chain state MUST NOT be called by this method. These routines should be performed in startup() instead.

Parameters
optionsThe options passed to the application, via configuration files or command line

Implements graphene::app::abstract_plugin.

Definition at line 51 of file plugin.cpp.

◆ plugin_name()

std::string graphene::app::plugin::plugin_name ( ) const
overridevirtual

Implements graphene::app::abstract_plugin.

Definition at line 41 of file plugin.cpp.

◆ plugin_set_app()

void graphene::app::plugin::plugin_set_app ( application a)
overridevirtual

Register the application instance with the plugin.

This is called by the framework to set the application.

Implements graphene::app::abstract_plugin.

Definition at line 66 of file plugin.cpp.

◆ plugin_set_program_options()

void graphene::app::plugin::plugin_set_program_options ( boost::program_options::options_description &  command_line_options,
boost::program_options::options_description &  config_file_options 
)
overridevirtual

Fill in command line parameters used by the plugin.

Parameters
command_line_optionsAll options this plugin supports taking on the command-line
config_file_optionsAll options this plugin supports storing in a configuration file

This method populates its arguments with any command-line and configuration file options the plugin supports. If a plugin does not need these options, it may simply provide an empty implementation of this method.

Implements graphene::app::abstract_plugin.

Definition at line 72 of file plugin.cpp.

◆ plugin_shutdown()

void graphene::app::plugin::plugin_shutdown ( )
overridevirtual

Cleanly shut down the plugin.

This is called to request a clean shutdown (e.g. due to SIGINT or SIGTERM).

Implements graphene::app::abstract_plugin.

Definition at line 61 of file plugin.cpp.

◆ plugin_startup()

void graphene::app::plugin::plugin_startup ( )
overridevirtual

Begin normal runtime operations.

Plugins MUST supply a method startup() which will be called at the end of application startup. This method should contain code which schedules any tasks, or requires chain state.

Implements graphene::app::abstract_plugin.

Definition at line 56 of file plugin.cpp.


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