Loading...
Searching...
No Matches
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

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

## 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

  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().

## Constructor & Destructor Documentation

## thrift_application_base()

template<typename TserverBase , typename TserverClass >

thrift_application_base< TserverBase, TserverClass >::thrift_application_base | ( | TserverClass * | _app | ) |

References gr::configure_default_loggers(), thrift_application_base< TserverBase, TserverClass >::d_application, thrift_application_base< TserverBase, TserverClass >::d_debug_logger, and thrift_application_base< TserverBase, TserverClass >::d_logger.

## ~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 | ( |  | ) |

protected pure virtual

Implemented in thrift_server_template< TserverBase, TserverClass, TImplClass >, and thrift_server_template< rpcserver_base, rpcserver_thrift, rpcserver_booter_thrift >.

## 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] | endpoint | The endpoint string reported by this class.

## Member Data Documentation

## d_application

template<typename TserverBase , typename TserverClass >

TserverClass * thrift_application_base< TserverBase, TserverClass >::d_application

static protected

Reference to the fully derived application instance.

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

## d_debug_logger

template<typename TserverBase , typename TserverClass >

gr::logger_ptr thrift_application_base< TserverBase, TserverClass >::d_debug_logger

protected

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

## d_default_max_init_attempts

template<typename TserverBase , typename TserverClass >

const unsigned int thrift_application_base< TserverBase, TserverClass >::d_default_max_init_attempts

static protected

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

## d_default_num_thrift_threads

template<typename TserverBase , typename TserverClass >

const unsigned int thrift_application_base< TserverBase, TserverClass >::d_default_num_thrift_threads

static protected

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

static protected

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

static protected

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

Logging instances.

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

## d_thriftserver

template<typename TserverBase , typename TserverClass >

std::unique_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:

- thrift_application_base.h