Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fawkes::runtime::InitOptions Class Reference

Initialization options class. More...

#include <>>

List of all members.

Public Member Functions

 InitOptions (const char *basename)
 Constructor.
 InitOptions (int argc, char **argv)
 Constructor from arguments.
 InitOptions (const InitOptions &options)
 Copy constructor.
 ~InitOptions ()
 Destructor.
InitOptionsoperator= (const InitOptions &options)
 Assignment operator.
InitOptionsnet_tcp_port (unsigned short int port)
 Set Fawkes network TCP port.
InitOptionsnet_service_name (const char *service_name)
 Set Fawkes network service name.
InitOptionsdaemonize (bool daemonize, bool kill=false, bool status=false, const char *pid_file=0)
 Set daemonization options.
InitOptionsloggers (const char *loggers)
 Set loggers.
InitOptionslog_level (Logger::LogLevel log_level)
 Set log level.
InitOptionsshow_help (bool show_help)
 Set to show help.
InitOptionsuser (const char *username)
 Set user name to run as.
InitOptionsgroup (const char *groupname)
 Set group name to run as.
InitOptionsdefault_config (const char *default_config)
 Set default config name.
InitOptionshost_config (const char *host_config)
 Set host config name.
InitOptionsbb_cleanup (bool bb_cleanup)
 Set blackboard cleanup.
InitOptionsinit_plugin_cache (bool init_plugin_cache)
 Enable or disable plugin cache initialization.
InitOptionsload_plugins (const char *plugin_list)
 Set list of plugins to load during startup.
InitOptionsdefault_plugin (const char *default_plugin)
 Set additional default plugin name.
InitOptionsplugin_module_flags (Module::ModuleFlags flags)
 Set module flags.
InitOptionsdefault_signal_handlers (bool enable)
 Set default signal handlers.
const char * basename () const
 Get program basename.
bool has_net_tcp_port () const
 Check if TCP port has been passed.
unsigned short int net_tcp_port () const
 Get Fawkes network TCP port.
bool has_net_service_name () const
 Check if network service name has been passed.
const char * net_service_name () const
 Get network service name.
bool has_load_plugin_list () const
 Check if plugin load list has been set.
const char * load_plugin_list () const
 Get plugin load list.
const char * default_plugin () const
 Get name of default plugin.
bool has_loggers () const
 Check if logger string has been passed.
const char * loggers () const
 Get logger string.
Logger::LogLevel log_level () const
 Get log level.
bool show_help () const
 Check if help has been requested.
bool bb_cleanup () const
 Check if blackboard cleanup has been requested.
bool init_plugin_cache () const
 Check if plugin cache initialization has been requested.
bool daemonize () const
 Check if daemonization has been requested.
bool daemonize_kill () const
 Check if killing of daemon has been requested.
bool daemonize_status () const
 Check if status of daemon has been requested.
const char * daemon_pid_file () const
 Get daemon PID file.
bool has_username () const
 Check if user name has been passed.
const char * username () const
 Get user name to run as.
bool has_groupname () const
 Check if group name has been passed.
const char * groupname () const
 Get group name to run as.
const char * host_config () const
 Get host config.
const char * default_config () const
 Get default config.
Module::ModuleFlags plugin_module_flags () const
 Get plugin module flags.
bool default_signal_handlers () const
 Check if default signal handlers should be enabled.

Detailed Description

Initialization options class.

This class provides a container for initialization options that can be passed to the Fawkes runtime. It uses the named parameter idiom which allows to set only the parameters which divert from the default value.

Author:
Tim Niemueller

Definition at line 37 of file init_options.h.


Constructor & Destructor Documentation

fawkes::runtime::InitOptions::InitOptions ( const char *  basename)

Constructor.

Initializes the default options.

Parameters:
basenameprogram base name

Definition at line 52 of file init_options.cpp.

fawkes::runtime::InitOptions::InitOptions ( int  argc,
char **  argv 
)

Constructor from arguments.

Initializes the options from arguments passed from the command line.

Parameters:
argcnumber of elements in argv
argvargument array

Definition at line 154 of file init_options.cpp.

References fawkes::ArgumentParser::arg(), fawkes::ArgumentParser::has_arg(), fawkes::ArgumentParser::parse_int(), and fawkes::ArgumentParser::program_name().

fawkes::runtime::InitOptions::InitOptions ( const InitOptions options)

Copy constructor.

Parameters:
optionsoptions object to copy

Definition at line 86 of file init_options.cpp.

fawkes::runtime::InitOptions::~InitOptions ( )

Destructor.

Definition at line 268 of file init_options.cpp.


Member Function Documentation

const char * fawkes::runtime::InitOptions::basename ( ) const

Get program basename.

Returns:
program base name

Definition at line 636 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::bb_cleanup ( bool  bb_cleanup)

Set blackboard cleanup.

Parameters:
bb_cleanuptrue to run blackboard cleanup, false otherwise
Returns:
reference to this instance

Definition at line 599 of file init_options.cpp.

bool fawkes::runtime::InitOptions::bb_cleanup ( ) const

Check if blackboard cleanup has been requested.

Returns:
true if blackboard cleanup has been requested, false otherwise

Definition at line 750 of file init_options.cpp.

const char * fawkes::runtime::InitOptions::daemon_pid_file ( ) const

Get daemon PID file.

Returns:
daemon PID file path

Definition at line 807 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::daemonize ( bool  daemonize,
bool  kill = false,
bool  status = false,
const char *  pid_file = 0 
)

Set daemonization options.

Parameters:
daemonizedaemonization requested
killkill a running daemon
statusprint status about running daemon
pid_filepath to file to write PID to
Returns:
reference to this instance

Definition at line 439 of file init_options.cpp.

bool fawkes::runtime::InitOptions::daemonize ( ) const

Check if daemonization has been requested.

Returns:
true if daemonization has been requested, false otherwise

Definition at line 779 of file init_options.cpp.

bool fawkes::runtime::InitOptions::daemonize_kill ( ) const

Check if killing of daemon has been requested.

Returns:
true if killing of daemon has been requested, false otherwise

Definition at line 788 of file init_options.cpp.

bool fawkes::runtime::InitOptions::daemonize_status ( ) const

Check if status of daemon has been requested.

Returns:
true if status of daemon has been requested, false otherwise

Definition at line 797 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::default_config ( const char *  default_config)

Set default config name.

Parameters:
default_configdefault config name
Returns:
reference to this instance

Definition at line 565 of file init_options.cpp.

const char * fawkes::runtime::InitOptions::default_config ( ) const

Get default config.

Returns:
default config

Definition at line 855 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::default_plugin ( const char *  default_plugin_)

Set additional default plugin name.

Parameters:
default_plugin_additional default plugin name
Returns:
reference to this instance

Definition at line 393 of file init_options.cpp.

Referenced by NaoFawkesModule::NaoFawkesModule().

const char * fawkes::runtime::InitOptions::default_plugin ( ) const

Get name of default plugin.

This is usually the name of a meta plugin to load the appropriate plugins. It may have a specialized name on a specific robot platform. It defaults to "default". Note that "default" is always loaded to avoid confusion.

Returns:
default plugin name

Definition at line 650 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::default_signal_handlers ( bool  enable)

Set default signal handlers.

Parameters:
enabletrue to enable default signal handlers, false to disable. Note that if you disable the signal handlers you must stop the Fawkes main thread execution by yourself by some other means.
Returns:
reference to this instance

Definition at line 625 of file init_options.cpp.

bool fawkes::runtime::InitOptions::default_signal_handlers ( ) const

Check if default signal handlers should be enabled.

Returns:
true if default signal handlers have been requested, false otherwise

Definition at line 770 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::group ( const char *  groupname)

Set group name to run as.

Parameters:
groupnameuser name to run as
Returns:
reference to this instance

Definition at line 547 of file init_options.cpp.

const char * fawkes::runtime::InitOptions::groupname ( ) const

Get group name to run as.

Returns:
group name to run as

Definition at line 845 of file init_options.cpp.

bool fawkes::runtime::InitOptions::has_groupname ( ) const

Check if group name has been passed.

Returns:
true if the parameter has been set, false otherwise

Definition at line 836 of file init_options.cpp.

bool fawkes::runtime::InitOptions::has_load_plugin_list ( ) const

Check if plugin load list has been set.

Returns:
true if the parameter has been set, false otherwise

Definition at line 696 of file init_options.cpp.

bool fawkes::runtime::InitOptions::has_loggers ( ) const

Check if logger string has been passed.

Returns:
true if the parameter has been set, false otherwise

Definition at line 714 of file init_options.cpp.

bool fawkes::runtime::InitOptions::has_net_service_name ( ) const

Check if network service name has been passed.

Returns:
true if the parameter has been set, false otherwise

Definition at line 678 of file init_options.cpp.

bool fawkes::runtime::InitOptions::has_net_tcp_port ( ) const

Check if TCP port has been passed.

Returns:
true if the parameter has been set, false otherwise

Definition at line 660 of file init_options.cpp.

bool fawkes::runtime::InitOptions::has_username ( ) const

Check if user name has been passed.

Returns:
true if the parameter has been set, false otherwise

Definition at line 817 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::host_config ( const char *  host_config)

Set host config name.

Parameters:
host_confighost config name
Returns:
reference to this instance

Definition at line 582 of file init_options.cpp.

const char * fawkes::runtime::InitOptions::host_config ( ) const

Get host config.

Returns:
host config

Definition at line 865 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::init_plugin_cache ( bool  init_cache)

Enable or disable plugin cache initialization.

Parameters:
init_cachetrue to trigger plugin cache initialization, false to disable
Returns:
reference to this instance

Definition at line 497 of file init_options.cpp.

bool fawkes::runtime::InitOptions::init_plugin_cache ( ) const

Check if plugin cache initialization has been requested.

Returns:
true if plugin cache initialization has been requested, false otherwise

Definition at line 760 of file init_options.cpp.

const char * fawkes::runtime::InitOptions::load_plugin_list ( ) const

Get plugin load list.

Returns:
plugin load list

Definition at line 705 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::load_plugins ( const char *  plugin_list)

Set list of plugins to load during startup.

Parameters:
plugin_listcomma-separated list of names of plugins to load
Returns:
reference to this instance

Definition at line 527 of file init_options.cpp.

Referenced by NaoFawkesModule::NaoFawkesModule().

InitOptions & fawkes::runtime::InitOptions::log_level ( Logger::LogLevel  log_level)

Set log level.

Parameters:
log_leveldesired log level
Returns:
reference to this instance

Definition at line 474 of file init_options.cpp.

Logger::LogLevel fawkes::runtime::InitOptions::log_level ( ) const

Get log level.

Returns:
log level

Definition at line 732 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::loggers ( const char *  loggers)

Set loggers.

Parameters:
loggersstring of loggers
Returns:
reference to this instance

Definition at line 456 of file init_options.cpp.

Referenced by NaoFawkesModule::NaoFawkesModule().

const char * fawkes::runtime::InitOptions::loggers ( ) const

Get logger string.

Returns:
logger stirng

Definition at line 723 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::net_service_name ( const char *  service_name)

Set Fawkes network service name.

Parameters:
service_nameservice name
Returns:
reference to this instance

Definition at line 418 of file init_options.cpp.

Referenced by NaoFawkesModule::NaoFawkesModule().

const char * fawkes::runtime::InitOptions::net_service_name ( ) const

Get network service name.

Returns:
network service name

Definition at line 687 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::net_tcp_port ( unsigned short int  port)

Set Fawkes network TCP port.

Parameters:
portTCP port
Returns:
reference to this instance

Definition at line 406 of file init_options.cpp.

unsigned short int fawkes::runtime::InitOptions::net_tcp_port ( ) const

Get Fawkes network TCP port.

Returns:
Fawkes network TCP port

Definition at line 669 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::operator= ( const InitOptions options)

Assignment operator.

Parameters:
optionsoptions object to copy
Returns:
reference to this instance

Definition at line 288 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::plugin_module_flags ( Module::ModuleFlags  flags)

Set module flags.

Parameters:
flagsflags to open plugin modules with
Returns:
reference to this instance

Definition at line 611 of file init_options.cpp.

Referenced by NaoFawkesModule::NaoFawkesModule().

Module::ModuleFlags fawkes::runtime::InitOptions::plugin_module_flags ( ) const

Get plugin module flags.

Returns:
plugin module flags

Definition at line 875 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::show_help ( bool  show_help)

Set to show help.

Parameters:
show_helptrue to request showing help information, false otherwise
Returns:
reference to this instance

Definition at line 485 of file init_options.cpp.

bool fawkes::runtime::InitOptions::show_help ( ) const

Check if help has been requested.

Returns:
true if help has been requested, false otherwise

Definition at line 741 of file init_options.cpp.

InitOptions & fawkes::runtime::InitOptions::user ( const char *  username)

Set user name to run as.

Parameters:
usernameuser name to run as
Returns:
reference to this instance

Definition at line 508 of file init_options.cpp.

const char * fawkes::runtime::InitOptions::username ( ) const

Get user name to run as.

Returns:
user name to run as

Definition at line 827 of file init_options.cpp.


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