Scorum
Public Member Functions | Public Attributes | List of all members
scorum::app::application Class Reference

#include <application.hpp>

Public Member Functions

 application ()
 
 application (std::shared_ptr< chain::database > db)
 
 ~application ()
 
void set_program_options (boost::program_options::options_description &command_line_options, boost::program_options::options_description &configuration_file_options) const
 
void initialize (const boost::program_options::variables_map &options)
 
void initialize_plugins (const boost::program_options::variables_map &options)
 
void startup ()
 
void shutdown ()
 
void startup_plugins ()
 
void shutdown_plugins ()
 
std::vector< std::string > get_default_apis () const
 
std::vector< std::string > get_default_plugins () const
 
bool is_read_only () const
 
template<typename PluginType >
std::shared_ptr< PluginType > register_plugin ()
 
void register_abstract_plugin (std::shared_ptr< abstract_plugin > plug)
 
void enable_plugin (const std::string &name)
 
std::shared_ptr< abstract_pluginget_plugin (const std::string &name) const
 
template<typename PluginType >
std::shared_ptr< PluginType > get_plugin (const std::string &name) const
 
graphene::net::node_ptr p2p_node ()
 
std::shared_ptr< chain::databasechain_database () const
 
void set_block_production (bool producing_blocks)
 
fc::optional< api_access_infoget_api_access_info (const std::string &username) const
 
void set_api_access_info (const std::string &username, api_access_info &&permissions)
 
void register_api_factory (const std::string &name, std::function< fc::api_ptr(const api_context &)> factory)
 
template<typename Api >
void register_api_factory (const std::string &name)
 
fc::api_ptr create_api_by_name (const api_context &ctx)
 
void get_max_block_age (int32_t &result)
 
fc::api< network_broadcast_api > & get_write_node_net_api ()
 

Public Attributes

fc::optional< std::string > _remote_endpoint
 
fc::optional< fc::api< network_broadcast_api > > _remote_net_api
 
fc::optional< fc::api< login_api > > _remote_login
 
fc::http::websocket_connection_ptr _ws_ptr
 
std::shared_ptr< fc::rpc::websocket_api_connection > _ws_apic
 
fc::http::websocket_client _client
 

Detailed Description

Definition at line 98 of file application.hpp.

Constructor & Destructor Documentation

◆ application() [1/2]

scorum::app::application::application ( )

Definition at line 1107 of file application.cpp.

◆ application() [2/2]

scorum::app::application::application ( std::shared_ptr< chain::database db)

Definition at line 1112 of file application.cpp.

◆ ~application()

scorum::app::application::~application ( )

Definition at line 1117 of file application.cpp.

Member Function Documentation

◆ chain_database()

std::shared_ptr< chain::database > scorum::app::application::chain_database ( ) const

Definition at line 1365 of file application.cpp.

◆ create_api_by_name()

fc::api_ptr scorum::app::application::create_api_by_name ( const api_context ctx)

Instantiate the named API. Currently this simply calls the previously registered factory method.

Definition at line 1390 of file application.cpp.

◆ enable_plugin()

void scorum::app::application::enable_plugin ( const std::string &  name)

Definition at line 1443 of file application.cpp.

◆ get_api_access_info()

optional< api_access_info > scorum::app::application::get_api_access_info ( const std::string &  username) const

Definition at line 1375 of file application.cpp.

◆ get_default_apis()

std::vector< std::string > scorum::app::application::get_default_apis ( ) const

Definition at line 1130 of file application.cpp.

◆ get_default_plugins()

std::vector< std::string > scorum::app::application::get_default_plugins ( ) const

Definition at line 1147 of file application.cpp.

◆ get_max_block_age()

void scorum::app::application::get_max_block_age ( int32_t &  result)

Definition at line 1395 of file application.cpp.

◆ get_plugin() [1/2]

std::shared_ptr< abstract_plugin > scorum::app::application::get_plugin ( const std::string &  name) const

Definition at line 1347 of file application.cpp.

◆ get_plugin() [2/2]

template<typename PluginType >
std::shared_ptr<PluginType> scorum::app::application::get_plugin ( const std::string &  name) const
inline

Definition at line 133 of file application.hpp.

◆ get_write_node_net_api()

fc::api< network_broadcast_api > & scorum::app::application::get_write_node_net_api ( )

Definition at line 1400 of file application.cpp.

◆ initialize()

void scorum::app::application::initialize ( const boost::program_options::variables_map &  options)

Definition at line 1318 of file application.cpp.

◆ initialize_plugins()

void scorum::app::application::initialize_plugins ( const boost::program_options::variables_map &  options)

Definition at line 1454 of file application.cpp.

◆ is_read_only()

bool scorum::app::application::is_read_only ( ) const
inline

Definition at line 117 of file application.hpp.

◆ p2p_node()

graphene::net::node_ptr scorum::app::application::p2p_node ( )

Definition at line 1360 of file application.cpp.

◆ register_abstract_plugin()

void scorum::app::application::register_abstract_plugin ( std::shared_ptr< abstract_plugin plug)

Definition at line 1423 of file application.cpp.

◆ register_api_factory() [1/2]

template<typename Api >
void scorum::app::application::register_api_factory ( const std::string &  name)
inline

Convenience method to build an API factory from a type which only requires a reference to the application.

Definition at line 157 of file application.hpp.

◆ register_api_factory() [2/2]

void scorum::app::application::register_api_factory ( const std::string &  name,
std::function< fc::api_ptr(const api_context &)>  factory 
)

Register a way to instantiate the named API with the application.

Definition at line 1385 of file application.cpp.

◆ register_plugin()

template<typename PluginType >
std::shared_ptr<PluginType> scorum::app::application::register_plugin ( )
inline

Definition at line 122 of file application.hpp.

◆ set_api_access_info()

void scorum::app::application::set_api_access_info ( const std::string &  username,
api_access_info &&  permissions 
)

Definition at line 1380 of file application.cpp.

◆ set_block_production()

void scorum::app::application::set_block_production ( bool  producing_blocks)

Definition at line 1370 of file application.cpp.

◆ set_program_options()

void scorum::app::application::set_program_options ( boost::program_options::options_description &  command_line_options,
boost::program_options::options_description &  configuration_file_options 
) const

Definition at line 1159 of file application.cpp.

◆ shutdown()

void scorum::app::application::shutdown ( )

Definition at line 1418 of file application.cpp.

◆ shutdown_plugins()

void scorum::app::application::shutdown_plugins ( )

Definition at line 1409 of file application.cpp.

◆ startup()

void scorum::app::application::startup ( )

Definition at line 1328 of file application.cpp.

◆ startup_plugins()

void scorum::app::application::startup_plugins ( )

Definition at line 1490 of file application.cpp.

Member Data Documentation

◆ _client

fc::http::websocket_client scorum::app::application::_client

Definition at line 185 of file application.hpp.

◆ _remote_endpoint

fc::optional<std::string> scorum::app::application::_remote_endpoint

Definition at line 180 of file application.hpp.

◆ _remote_login

fc::optional<fc::api<login_api> > scorum::app::application::_remote_login

Definition at line 182 of file application.hpp.

◆ _remote_net_api

fc::optional<fc::api<network_broadcast_api> > scorum::app::application::_remote_net_api

Definition at line 181 of file application.hpp.

◆ _ws_apic

std::shared_ptr<fc::rpc::websocket_api_connection> scorum::app::application::_ws_apic

Definition at line 184 of file application.hpp.

◆ _ws_ptr

fc::http::websocket_connection_ptr scorum::app::application::_ws_ptr

Definition at line 183 of file application.hpp.


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