GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
thrift_application_base< TserverBase, TserverClass > Class Template Referenceabstract

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

boost::scoped_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
 

Detailed Description

template<typename TserverBase, typename TserverClass>
class thrift_application_base< TserverBase, TserverClass >

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.

Parameters
TserverBaseTemplate parameter naming the type of the server base, which is typically rpcserverbase.
TserverClassTemplate parameter naming the eventual type of the fully derived application.
_appReference to the fully derived application instance to be returned by thrift_application_base::i().

Constructor & Destructor Documentation

◆ thrift_application_base()

template<typename TserverBase , typename TserverClass>
thrift_application_base< TserverBase, TserverClass >::thrift_application_base ( TserverClass *  _app)

◆ ~thrift_application_base()

template<typename TserverBase, typename TserverClass>
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.

Member Function Documentation

◆ endpoints()

template<typename TserverBase , typename TserverClass >
const std::vector< std::string > thrift_application_base< TserverBase, TserverClass >::endpoints ( )
static

Returns the endpoint string of this application.

◆ i()

template<typename TserverBase , typename TserverClass >
TserverBase * thrift_application_base< TserverBase, TserverClass >::i ( )
static

The application singleton instance function.

◆ i_impl()

template<typename TserverBase, typename TserverClass>
virtual TserverBase* thrift_application_base< TserverBase, TserverClass >::i_impl ( )
protectedpure virtual

◆ set_endpoint()

template<typename TserverBase , typename TserverClass >
void thrift_application_base< TserverBase, TserverClass >::set_endpoint ( const std::string &  endpoint)
protected

Allows this application's booter to set the endpoint string after the Thrift runtime has initialized.

Parameters
[in]endpointThe endpoint string reported by this class.

Member Data Documentation

◆ d_application

template<typename TserverBase, typename TserverClass>
TserverClass * thrift_application_base< TserverBase, TserverClass >::d_application
staticprotected

◆ d_debug_logger

template<typename TserverBase, typename TserverClass>
gr::logger_ptr thrift_application_base< TserverBase, TserverClass >::d_debug_logger
protected

◆ d_default_max_init_attempts

template<typename TserverBase, typename TserverClass>
const unsigned int thrift_application_base< TserverBase, TserverClass >::d_default_max_init_attempts
staticprotected

Max number of attempts when checking the Thrift runtime for Initialization before giving up. Set in the Thrift config file (see Configuration).

Referenced by thrift_application_base< TserverBase, TImplClass >::thrift_application_base().

◆ d_default_num_thrift_threads

template<typename TserverBase, typename TserverClass>
const unsigned int thrift_application_base< TserverBase, TserverClass >::d_default_num_thrift_threads
staticprotected

Maximum number of threads to create when serving multiple rpc clients. Set in the Thrift config file (see Configuration).

◆ d_default_thrift_buffer_size

template<typename TserverBase, typename TserverClass>
const unsigned int thrift_application_base< TserverBase, TserverClass >::d_default_thrift_buffer_size
staticprotected

Default packet size for the IP payload of thrift packets. Set in the Thrift config file (see Configuration).

◆ d_default_thrift_port

template<typename TserverBase, typename TserverClass>
const unsigned int thrift_application_base< TserverBase, TserverClass >::d_default_thrift_port
staticprotected

Default port for the runtime to listen on, if a static port is not specified. Set in the Thrift config file (see Configuration).

◆ d_logger

template<typename TserverBase, typename TserverClass>
gr::logger_ptr thrift_application_base< TserverBase, TserverClass >::d_logger
protected

◆ d_thriftserver

template<typename TserverBase, typename TserverClass>
boost::scoped_ptr<apache::thrift::server::TServer> thrift_application_base< TserverBase, TserverClass >::d_thriftserver
protected

Reference to the Thrift runtime.


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