Base class for a Thrift application with a singleton with instance function thrift_application_base::i(). Lazy initialization is used to start the Thrift runtime, therefore the Thrift runtime is not started unless thrift_application_base::i() is called at least once. This typically means that at least one rpc variable must be registered by a block before the runtime will start. More...
#include <gnuradio/thrift_application_base.h>
Public Member Functions | |
thrift_application_base (TserverClass *_app) | |
~thrift_application_base () | |
Static Public Member Functions | |
static TserverBase * | i () |
static const std::vector< std::string > | endpoints () |
Protected Member Functions | |
void | set_endpoint (const std::string &endpoint) |
virtual TserverBase * | i_impl ()=0 |
Protected Attributes | |
std::unique_ptr< apache::thrift::server::TServer > | d_thriftserver |
gr::logger_ptr | d_logger |
gr::logger_ptr | d_debug_logger |
Static Protected Attributes | |
static TserverClass * | d_application |
static const unsigned int | d_default_max_init_attempts |
static const unsigned int | d_default_thrift_port |
static const unsigned int | d_default_num_thrift_threads |
static const unsigned int | d_default_thrift_buffer_size |
Base class for a Thrift application with a singleton with instance function thrift_application_base::i(). Lazy initialization is used to start the Thrift runtime, therefore the Thrift runtime is not started unless thrift_application_base::i() is called at least once. This typically means that at least one rpc variable must be registered by a block before the runtime will start.
TserverBase | Template parameter naming the type of the server base, which is typically rpcserverbase. |
TserverClass | Template parameter naming the eventual type of the fully derived application. |
_app | Reference to the fully derived application instance to be returned by thrift_application_base::i(). |
thrift_application_base< TserverBase, TserverClass >::thrift_application_base | ( | TserverClass * | _app | ) |
thrift_application_base< TserverBase, TserverClass >::~thrift_application_base | ( | ) |
Destructor for the application. Since shutdown and cleanup of the runtime is typically custom to a particular booter implementation, this must be implemented as a specialized function for a particular booter. Thus a template implementation is not provided here.
|
static |
Returns the endpoint string of this application.
|
static |
The application singleton instance function.
|
protectedpure virtual |
|
protected |
Allows this application's booter to set the endpoint string after the Thrift runtime has initialized.
[in] | endpoint | The endpoint string reported by this class. |
|
staticprotected |
Reference to the fully derived application instance.
Referenced by thrift_application_base< TserverBase, TserverClass >::thrift_application_base().
|
protected |
|
staticprotected |
Max number of attempts when checking the Thrift runtime for Initialization before giving up. Set in the Thrift config file (see Configuration).
|
staticprotected |
Maximum number of threads to create when serving multiple rpc clients. Set in the Thrift config file (see Configuration).
|
staticprotected |
Default packet size for the IP payload of thrift packets. Set in the Thrift config file (see Configuration).
|
staticprotected |
Default port for the runtime to listen on, if a static port is not specified. Set in the Thrift config file (see Configuration).
|
protected |
Logging instances.
Referenced by thrift_application_base< TserverBase, TserverClass >::thrift_application_base().
|
protected |
Reference to the Thrift runtime.