Savarese Software Research Corporation
service_main.h File Reference

This header defines the service_main utility function template. More...

Include dependency graph for service_main.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct   ServiceFactory< service_type, options_type, has_initializer >
 
struct   ServiceFactory< service_type, options_type, false >
 
struct   ServiceFactory< service_type, options_type, true >
 
struct   ServiceMainOptionsProcessor
 

Macros

#define  WISP_EMPTY_INIT_CODE
 
#define  WISP_CUSTOM_SERVICE_MAIN_WITH_INIT(service_type, handler_type, options_type, options_processor_type, has_initializer, init_code)
 
#define  WISP_CUSTOM_SERVICE_MAIN(service_type, handler_type, options_type, options_processor_type, has_initializer)   WISP_CUSTOM_SERVICE_MAIN_WITH_INIT(service_type, handler_type, options_type, options_processor_type, has_initializer, WISP_EMPTY_INIT_CODE)
 
#define  WISP_SERVICE_MAIN_WITH_INIT(service_type, init_code)
 
#define  WISP_SERVICE_MAIN(service_type)    WISP_SERVICE_MAIN_WITH_INIT(service_type, WISP_EMPTY_INIT_CODE)
 

Functions

template<typename service_type , typename options_type >
__BEGIN_NS_SSRC_WISP_UTILITY std::unique_ptr< service_type >  new_service (const options_type &options)
 
template<typename service_type , typename options_type , typename init_type >
std::unique_ptr< service_type >  new_service (const options_type &options, const init_type &initializer)
 
template<typename ProtocolProcessor , template< typename PP, typename... > class EH, typename CustomOptions , typename CustomOptionsProcessor , bool has_initializer>
int  service_main (int argc, char *argv[])
 

Detailed Description

This header defines the service_main utility function template.

Definition in file service_main.h.

Macro Definition Documentation

#define WISP_CUSTOM_SERVICE_MAIN (   service_type,
  handler_type,
  options_type,
  options_processor_type,
  has_initializer 
)    WISP_CUSTOM_SERVICE_MAIN_WITH_INIT(service_type, handler_type, options_type, options_processor_type, has_initializer, WISP_EMPTY_INIT_CODE)

Definition at line 161 of file service_main.h.

#define WISP_CUSTOM_SERVICE_MAIN_WITH_INIT (   service_type,
  handler_type,
  options_type,
  options_processor_type,
  has_initializer,
  init_code 
)
Value:
int main(int argc, char *argv[]) { \
init_code \
return NS_SSRC_WISP_UTILITY::service_main<service_type, handler_type, options_type, options_processor_type, has_initializer>(argc, argv); \
}

Definition at line 155 of file service_main.h.

#define WISP_EMPTY_INIT_CODE

Definition at line 153 of file service_main.h.

#define WISP_SERVICE_MAIN (   service_type )    WISP_SERVICE_MAIN_WITH_INIT(service_type, WISP_EMPTY_INIT_CODE)

Definition at line 171 of file service_main.h.

#define WISP_SERVICE_MAIN_WITH_INIT (   service_type,
  init_code 
)
Value:
NS_SSRC_WISP_SERVICE::ServiceEventHandler, \
NS_SSRC_WISP_UTILITY::ServiceMainOptions, \
NS_SSRC_WISP_UTILITY::ServiceMainOptionsProcessor, \
false, init_code)

Definition at line 164 of file service_main.h.

Function Documentation

template<typename service_type , typename options_type >
__BEGIN_NS_SSRC_WISP_UTILITY std::unique_ptr<service_type> new_service ( const options_type &  options )
template<typename service_type , typename options_type , typename init_type >
std::unique_ptr<service_type> new_service ( const options_type &  options,
const init_type &  initializer 
)

Definition at line 40 of file service_main.h.

template<typename ProtocolProcessor , template< typename PP, typename... > class EH, typename CustomOptions , typename CustomOptionsProcessor , bool has_initializer>
int service_main ( int  argc,
char *  argv[] 
)

Definition at line 101 of file service_main.h.

References new_service(), NS_SSRC_WISP_SERVICE, EventLoop::start(), and WISP_IMPORT_T.


Savarese Software Research Corporation
Copyright © 2006-2012 Savarese Software Research Corporation. All rights reserved.