SNode.C
Loading...
Searching...
No Matches
net::config::ConfigPhysicalSocketServer Class Reference

#include <ConfigPhysicalSocketServer.h>

Inheritance diagram for net::config::ConfigPhysicalSocketServer:
Collaboration diagram for net::config::ConfigPhysicalSocketServer:

Public Member Functions

ConfigPhysicalSocketServersetBacklog (int newBacklog)
int getBacklog () const
ConfigPhysicalSocketServersetAcceptsPerTick (int acceptsPerTickSet)
int getAcceptsPerTick () const
ConfigPhysicalSocketServersetAcceptTimeout (const utils::Timeval &acceptTimeout)
utils::Timeval getAcceptTimeout () const
Public Member Functions inherited from net::config::ConfigPhysicalSocket
const std::map< int, std::map< int, net::phy::PhysicalSocketOption > > & getSocketOptions () const
ConfigPhysicalSocketaddSocketOption (int optLevel, int optName, int optValue)
ConfigPhysicalSocketaddSocketOption (int optLevel, int optName, const std::string &optValue)
ConfigPhysicalSocketaddSocketOption (int optLevel, int optName, const std::vector< char > &optValue)
ConfigPhysicalSocketremoveSocketOption (int optLevel, int optName)
ConfigPhysicalSocketsetRetry (bool retry=true)
bool getRetry () const
ConfigPhysicalSocketsetRetryOnFatal (bool retry=true)
bool getRetryOnFatal () const
ConfigPhysicalSocketsetRetryTimeout (double sec)
double getRetryTimeout () const
ConfigPhysicalSocketsetRetryTries (unsigned int tries=0)
unsigned int getRetryTries () const
ConfigPhysicalSocketsetRetryBase (double base)
double getRetryBase () const
ConfigPhysicalSocketsetRetryLimit (unsigned int limit)
unsigned int getRetryLimit () const
ConfigPhysicalSocketsetRetryJitter (double percent)
double getRetryJitter () const
template<typename ConcretConfigPhysicalSocket>
 ConfigPhysicalSocket (ConfigInstance *instance, ConcretConfigPhysicalSocket *section)
Public Member Functions inherited from net::config::ConfigSection
template<typename T>
 ConfigSection (ConfigInstance *instance, T *sectionPtr, const std::string &group="Sections")
 ~ConfigSection () override
 ConfigSection (const ConfigSection &)=delete
 ConfigSection (ConfigSection &&)=delete
ConfigSectionoperator= (const ConfigSection &)=delete
Public Member Functions inherited from utils::SubCommand
 SubCommand (const SubCommand &)=delete
 SubCommand (SubCommand &&)=delete
SubCommandoperator= (const SubCommand &)=delete
SubCommandoperator= (SubCommand &&)=delete
virtual ~SubCommand ()
std::string getName () const
std::string version () const
CLI::Option * setConfig (const std::string &defaultConfigFile) const
CLI::Option * setLogFile (const std::string &defaultLogFile) const
CLI::Option * setVersionFlag (const std::string &version) const
bool hasParent () const
SubCommandgetParent () const
SubCommandallowExtras (bool allow=true)
SubCommandrequired (bool required=true, bool force=true)
SubCommandrequired (SubCommand *subCommand, bool required=true)
SubCommandrequired (CLI::Option *option, bool required=true)
bool getRequired () const
SubCommandneeds (SubCommand *subCommand, bool needs=true)
SubCommanddisabled (SubCommand *subCommand, bool disabled=true)
SubCommandsetRequireCallback (const std::function< void(void)> &callback)
SubCommandfinalCallback (const std::function< void()> &finalCallback)
std::string configToStr () const
std::string help (const CLI::App *helpApp, const CLI::AppFormatMode &mode) const
void addSubCommandApp (std::shared_ptr< utils::AppWithPtr > subCommand)
template<typename NewSubCommand, typename... Args>
NewSubCommand * newSubCommand (Args &&... args)
template<typename RequestedSubCommand>
RequestedSubCommand * getSubCommand ()
template<typename RequestedSubCommand>
RequestedSubCommand * getSubCommand () const
CLI::Option * getOption (const std::string &name) const
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
template<typename ValueTypeT>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &validator) const
template<typename ValueTypeT>
CLI::Option * addOptionVariable (const std::string &name, ValueTypeT &variable, const std::string &description, const std::string &typeName, const CLI::Validator &additionalValidator) const
template<typename ValueTypeT>
CLI::Option * addOptionVariable (const std::string &name, ValueTypeT &variable, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator) const
CLI::Option * addOptionFunction (const std::string &name, const std::function< void(const std::string &)> &callback, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
template<typename ValueTypeT>
CLI::Option * addOptionFunction (const std::string &name, const std::function< void(const std::string &)> &callback, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &validator) const
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
template<typename ValueTypeT>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &validator) const
CLI::Option * addFlagFunction (const std::string &name, const std::function< void()> &callback, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
CLI::Option * addFlagFunction (const std::string &name, const std::function< void()> &callback, const std::string &description, const std::string &typeName, const std::string &defaultValue, const CLI::Validator &validator) const

Protected Member Functions

 ConfigPhysicalSocketServer (ConfigInstance *instance)
 ~ConfigPhysicalSocketServer () override
Protected Member Functions inherited from net::config::ConfigPhysicalSocket
template<typename ConcretConfigPhysicalSocketT>
 ConfigPhysicalSocket (ConfigInstance *instance, ConcretConfigPhysicalSocketT *section)
 ~ConfigPhysicalSocket () override
CLI::Option * addSocketOption (const std::string &name, int optLevel, int optName, const std::string &description, const std::string &typeName, const std::string &defaultValue, const CLI::Validator &validator)
Protected Member Functions inherited from utils::SubCommand
 SubCommand (SubCommand *parent, std::shared_ptr< utils::AppWithPtr > appWithPtr, const std::string &group, bool final=false)
template<typename ConcretSubCommand>
 SubCommand (SubCommand *parent, ConcretSubCommand *concretSubCommand, const std::string &group, bool final=false)
void parse (int argc, char *argv[]) const
SubCommanddescription (const std::string &description)
SubCommandfooter (const std::string &footer)
void removeSubCommand ()
template<typename ValueTypeT>
CLI::Option * setDefaultValue (CLI::Option *option, const ValueTypeT &value, bool clear=true) const
CLI::Option * setConfigurable (CLI::Option *option, bool configurable) const

Private Types

using Super = ConfigPhysicalSocket

Private Attributes

CLI::Option * backlogOpt = nullptr
CLI::Option * acceptsPerTickOpt = nullptr
CLI::Option * acceptTimeoutOpt = nullptr

Additional Inherited Members

Static Public Attributes inherited from net::config::ConfigPhysicalSocket
static constexpr std::string_view NAME {"socket"}
static constexpr std::string_view DESCRIPTION {"Configuration of socket behavior"}
Static Protected Member Functions inherited from utils::SubCommand
static CLI::App * getHelpTriggerApp ()
static CLI::App * getShowConfigTriggerApp ()
static CLI::App * getCommandlineTriggerApp ()
Protected Attributes inherited from utils::SubCommand
CLI::Option * helpOpt = nullptr
Static Protected Attributes inherited from utils::SubCommand
static std::shared_ptr< CLI::Formatter > sectionFormatter = makeSectionFormatter()
static std::map< std::string, std::string > aliases
static CLI::App * helpTriggerApp = nullptr
static CLI::App * showConfigTriggerApp = nullptr
static CLI::App * commandlineTriggerApp = nullptr

Detailed Description

Definition at line 60 of file ConfigPhysicalSocketServer.h.

Member Typedef Documentation

◆ Super

Constructor & Destructor Documentation

◆ ConfigPhysicalSocketServer()

net::config::ConfigPhysicalSocketServer::ConfigPhysicalSocketServer ( ConfigInstance * instance)
explicitprotected

Definition at line 54 of file ConfigPhysicalSocketServer.cpp.

55 : ConfigPhysicalSocket(instance, this) {
57 "--backlog",
58 "Listen backlog",
59 "backlog",
60 BACKLOG,
61 CLI::TypeValidator<int>());
62
64 "--accepts-per-tick",
65 "Accepts per tick",
66 "number",
67 ACCEPTS_PER_TICK,
68 CLI::TypeValidator<int>());
69
71 "--accept-timeout",
72 "Accept timeout",
73 "timeout",
74 ACCEPT_TIMEOUT,
75 CLI::NonNegativeNumber);
76 }
ConfigPhysicalSocket(ConfigInstance *instance, ConcretConfigPhysicalSocketT *section)
CLI::Option * addOption(const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const

References acceptsPerTickOpt, acceptTimeoutOpt, backlogOpt, and net::config::ConfigPhysicalSocket::ConfigPhysicalSocket().

Here is the call graph for this function:

◆ ~ConfigPhysicalSocketServer()

net::config::ConfigPhysicalSocketServer::~ConfigPhysicalSocketServer ( )
overrideprotected

Definition at line 78 of file ConfigPhysicalSocketServer.cpp.

78 {
79 }

Member Function Documentation

◆ getAcceptsPerTick()

int net::config::ConfigPhysicalSocketServer::getAcceptsPerTick ( ) const

Definition at line 91 of file ConfigPhysicalSocketServer.cpp.

91 {
92 return acceptsPerTickOpt->as<int>();
93 }

References acceptsPerTickOpt.

◆ getAcceptTimeout()

utils::Timeval net::config::ConfigPhysicalSocketServer::getAcceptTimeout ( ) const

Definition at line 107 of file ConfigPhysicalSocketServer.cpp.

107 {
108 return acceptTimeoutOpt->as<utils::Timeval>();
109 }

References acceptTimeoutOpt.

◆ getBacklog()

int net::config::ConfigPhysicalSocketServer::getBacklog ( ) const

Definition at line 81 of file ConfigPhysicalSocketServer.cpp.

81 {
82 return backlogOpt->as<int>();
83 }

References backlogOpt.

◆ setAcceptsPerTick()

ConfigPhysicalSocketServer * net::config::ConfigPhysicalSocketServer::setAcceptsPerTick ( int acceptsPerTickSet)

Definition at line 95 of file ConfigPhysicalSocketServer.cpp.

95 {
96 setDefaultValue(acceptsPerTickOpt, acceptsPerTickSet);
97
98 return this;
99 }
CLI::Option * setDefaultValue(CLI::Option *option, const ValueTypeT &value, bool clear=true) const
Definition SubCommand.h:367

References acceptsPerTickOpt, and utils::SubCommand::setDefaultValue().

Here is the call graph for this function:

◆ setAcceptTimeout()

ConfigPhysicalSocketServer * net::config::ConfigPhysicalSocketServer::setAcceptTimeout ( const utils::Timeval & acceptTimeout)

Definition at line 101 of file ConfigPhysicalSocketServer.cpp.

101 {
102 setDefaultValue(acceptTimeoutOpt, acceptTimeout);
103
104 return this;
105 }

References acceptTimeoutOpt, and utils::SubCommand::setDefaultValue().

Here is the call graph for this function:

◆ setBacklog()

ConfigPhysicalSocketServer * net::config::ConfigPhysicalSocketServer::setBacklog ( int newBacklog)

Definition at line 85 of file ConfigPhysicalSocketServer.cpp.

85 {
86 setDefaultValue(backlogOpt, newBacklog);
87
88 return this;
89 }

References backlogOpt, and utils::SubCommand::setDefaultValue().

Here is the call graph for this function:

Member Data Documentation

◆ acceptsPerTickOpt

CLI::Option* net::config::ConfigPhysicalSocketServer::acceptsPerTickOpt = nullptr
private

◆ acceptTimeoutOpt

CLI::Option* net::config::ConfigPhysicalSocketServer::acceptTimeoutOpt = nullptr
private

◆ backlogOpt

CLI::Option* net::config::ConfigPhysicalSocketServer::backlogOpt = nullptr
private

Definition at line 80 of file ConfigPhysicalSocketServer.h.

Referenced by ConfigPhysicalSocketServer(), getBacklog(), and setBacklog().


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