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 Types

using Socket = 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 ()
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

Protected Member Functions

 ConfigPhysicalSocketServer (ConfigInstance *instance)
 ~ConfigPhysicalSocketServer () override
Protected Member Functions inherited from net::config::ConfigPhysicalSocket
 ConfigPhysicalSocket (net::config::ConfigSection *section)
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)

Private Types

using Super = ConfigPhysicalSocket

Private Attributes

CLI::Option * backlogOpt = nullptr
CLI::Option * acceptsPerTickOpt = nullptr
CLI::Option * acceptTimeoutOpt = nullptr
Private Attributes inherited from net::config::ConfigSection
CLI::App * sectionSc = 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"}
Private Member Functions inherited from net::config::ConfigSection
template<typename T>
 ConfigSection (ConfigInstance *instance, T *sectionPtr, const std::string &group="Sections")
virtual ~ConfigSection ()
 ConfigSection (const ConfigSection &)=delete
 ConfigSection (ConfigSection &&)=delete
ConfigSectionoperator= (const ConfigSection &)=delete
ConfigSectionoperator= (ConfigSection &&)=delete
CLI::Option * addOption (const std::string &name, const std::string &description)
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName)
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &additionalValidator)
template<typename ValueTypeT>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue)
template<typename ValueTypeT>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator)
template<typename ValueTypeT>
CLI::Option * addOptionFunction (const std::string &name, const std::function< void(const std::string &)> &optionFunction, const std::string &description)
CLI::Option * addFlag (const std::string &name, const std::string &description)
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName)
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &additionalValidator)
template<typename ValueTypeT>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue)
template<typename ValueTypeT>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator)
CLI::Option * addFlagFunction (const std::string &name, const std::function< void()> &callback, const std::string &description, const std::string &typeName, const std::string &defaultValue)
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)
CLI::Option * getOption (const std::string &name) const
void required (CLI::Option *opt, bool req=true)
void required (bool required=true)
bool getRequired () const
template<typename ValueType>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue)
template<typename ValueType>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue, const CLI::Validator &additionalValidator)
template<typename ValueType>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue)
template<typename ValueType>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue, const CLI::Validator &additionalValidator)
void setConfigurable (CLI::Option *option, bool configurable)

Detailed Description

Definition at line 63 of file ConfigPhysicalSocketServer.h.

Member Typedef Documentation

◆ Socket

◆ Super

Constructor & Destructor Documentation

◆ ConfigPhysicalSocketServer()

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

Definition at line 54 of file ConfigPhysicalSocketServer.cpp.

55 : ConfigSection(instance, this)
56 , ConfigPhysicalSocket(this) {
58 "--backlog",
59 "Listen backlog",
60 "backlog",
61 BACKLOG,
62 CLI::PositiveNumber);
63
65 "--accepts-per-tick",
66 "Accepts per tick",
67 "number",
68 ACCEPTS_PER_TICK,
69 CLI::PositiveNumber);
70
72 "--accept-timeout",
73 "Accept timeout",
74 "timeout",
75 ACCEPT_TIMEOUT,
76 CLI::NonNegativeNumber);
77 }
ConfigPhysicalSocket(net::config::ConfigSection *section)
CLI::Option * addOption(const std::string &name, const std::string &description)
ConfigSection(ConfigInstance *instance, T *sectionPtr, const std::string &group="Sections")

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

Here is the call graph for this function:

◆ ~ConfigPhysicalSocketServer()

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

Definition at line 79 of file ConfigPhysicalSocketServer.cpp.

79 {
80 }

Member Function Documentation

◆ getAcceptsPerTick()

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

Definition at line 94 of file ConfigPhysicalSocketServer.cpp.

94 {
95 return acceptsPerTickOpt->as<int>();
96 }

References acceptsPerTickOpt.

◆ getAcceptTimeout()

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

Definition at line 114 of file ConfigPhysicalSocketServer.cpp.

114 {
115 return acceptTimeoutOpt->as<utils::Timeval>();
116 }

References acceptTimeoutOpt.

◆ getBacklog()

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

Definition at line 82 of file ConfigPhysicalSocketServer.cpp.

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

References backlogOpt.

◆ setAcceptsPerTick()

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

Definition at line 98 of file ConfigPhysicalSocketServer.cpp.

98 {
100 ->default_val(acceptsPerTickSet)
101 ->clear();
102
103 return *this;
104 }

References acceptsPerTickOpt.

◆ setAcceptTimeout()

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

Definition at line 106 of file ConfigPhysicalSocketServer.cpp.

106 {
108 ->default_val(acceptTimeout)
109 ->clear();
110
111 return *this;
112 }

References acceptTimeoutOpt.

◆ setBacklog()

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

Definition at line 86 of file ConfigPhysicalSocketServer.cpp.

86 {
87 backlogOpt //
88 ->default_val(newBacklog)
89 ->clear();
90
91 return *this;
92 }

References backlogOpt.

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 88 of file ConfigPhysicalSocketServer.h.

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


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