#include <ConfigInstance.h>
Public Types | |
| enum class | Role { SERVER , CLIENT } |
| using | Instance = ConfigInstance |
Public Member Functions | |
| ConfigInstance (ConfigInstance &)=delete | |
| ConfigInstance (ConfigInstance &&)=delete | |
| ConfigInstance & | operator= (ConfigInstance &)=delete |
| ConfigInstance & | operator= (ConfigInstance &&)=delete |
| const std::string & | getInstanceName () const |
| ConfigInstance * | setInstanceName (const std::string &instanceName) |
| bool | getDisabled () const |
| ConfigInstance * | setDisabled (bool disabled=true) |
| ConfigInstance * | configurable (bool configurable) |
| ConfigInstance * | setOnDestroy (const std::function< void(ConfigInstance *)> &onDestroy) |
| Public Member Functions inherited from utils::SubCommand | |
| SubCommand (const SubCommand &)=delete | |
| SubCommand (SubCommand &&)=delete | |
| SubCommand & | operator= (const SubCommand &)=delete |
| SubCommand & | operator= (SubCommand &&)=delete |
| virtual | ~SubCommand () |
| std::string | getName () const |
| std::string | version () const |
| std::string | configToStr () const |
| std::string | help (const CLI::App *helpApp, const CLI::AppFormatMode &mode) const |
| bool | hasParent () const |
| SubCommand * | getParent () const |
| SubCommand * | allowExtras (bool allow=true) |
| SubCommand * | forceUnrequired (bool unrequired=true) |
| SubCommand * | required (bool required=true) |
| SubCommand * | required (CLI::Option *option, bool required=true) |
| bool | getRequired () const |
| SubCommand * | needs (SubCommand *subCommand, bool needs=true) |
| SubCommand * | setRequireCallback (const std::function< void(void)> &callback) |
| SubCommand * | finalCallback (const std::function< void()> &finalCallback) |
| 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 * | 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 |
| CLI::Option * | getOption (const std::string &name) const |
| 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 |
Static Public Member Functions | |
| static CLI::App * | getHelpTriggerApp () |
| static CLI::App * | getShowConfigTriggerApp () |
| static CLI::App * | extracted () |
| static CLI::App * | getCommandlineTriggerApp () |
Protected Member Functions | |
| ConfigInstance (const std::string &instanceName, Role role) | |
| ~ConfigInstance () override | |
| 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 |
| SubCommand * | description (const std::string &description) |
| SubCommand * | footer (const std::string &footer) |
| void | removeSubCommand () |
| CLI::Option * | addConfigFlag (const std::string &defaultConfigFile) const |
| CLI::Option * | addLogFileFlag (const std::string &defaultLogFile) const |
| CLI::Option * | addVersionFlag (const std::string &version) const |
Private Attributes | |
| std::string | instanceName |
| Role | role |
| CLI::Option * | disableOpt = nullptr |
| std::function< void(ConfigInstance *)> | onDestroy |
Static Private Attributes | |
| static const std::string | nameAnonymous = "<anonymous>" |
Friends | |
| class | net::config::ConfigSection |
Additional Inherited Members | |
| 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 |
| CLI::Option * | showConfigOpt = nullptr |
| CLI::Option * | commandlineOpt = nullptr |
| Static Protected Attributes inherited from utils::SubCommand | |
| static std::map< std::string, std::string > | aliases |
| static CLI::App * | helpTriggerApp = nullptr |
| static CLI::App * | showConfigTriggerApp = nullptr |
| static CLI::App * | commandlineTriggerApp = nullptr |
Definition at line 60 of file ConfigInstance.h.
Definition at line 62 of file ConfigInstance.h.
|
strong |
|
explicitprotected |
Definition at line 58 of file ConfigInstance.cpp.
References utils::SubCommand::addFlagFunction(), utils::Config::configRoot, disableOpt, utils::SubCommand::forceUnrequired(), instanceName, role, SERVER, utils::SubCommand::setConfigurable(), and utils::SubCommand::SubCommand().
|
overrideprotected |
Definition at line 84 of file ConfigInstance.cpp.
References onDestroy, and utils::SubCommand::removeSubCommand().
|
delete |
|
delete |
| ConfigInstance * net::config::ConfigInstance::configurable | ( | bool | configurable | ) |
Definition at line 113 of file ConfigInstance.cpp.
References disableOpt, and utils::SubCommand::setConfigurable().
|
static |
|
static |
Definition at line 136 of file ConfigInstance.cpp.
References utils::SubCommand::getCommandlineTriggerApp().
| bool net::config::ConfigInstance::getDisabled | ( | ) | const |
Definition at line 100 of file ConfigInstance.cpp.
References disableOpt.
|
static |
Definition at line 129 of file ConfigInstance.cpp.
References utils::SubCommand::getHelpTriggerApp().
| const std::string & net::config::ConfigInstance::getInstanceName | ( | ) | const |
Definition at line 90 of file ConfigInstance.cpp.
References instanceName, and nameAnonymous.
Referenced by net::un::config::ConfigAddress< ConfigAddressTypeT >::ConfigAddress(), net::config::ConfigSection::ConfigSection(), tls::getClient(), core::socket::stream::FlowController< ConcreteFlowController >::getInstanceName(), legacy::getLegacyClient(), net::config::stream::tls::ConfigSocketServer< ConfigSocketServerBaseT >::getSniCtx(), net::config::stream::tls::ConfigSocketServer< ConfigSocketServerBaseT >::getSslCtx(), main(), core::socket::stream::FlowController< ConcreteFlowController >::setOnFlowCompleted(), and core::socket::stream::SocketConnection::SocketConnection().
|
static |
Definition at line 133 of file ConfigInstance.cpp.
References utils::SubCommand::getShowConfigTriggerApp().
|
delete |
|
delete |
| ConfigInstance * net::config::ConfigInstance::setDisabled | ( | bool | disabled = true | ) |
Definition at line 105 of file ConfigInstance.cpp.
References disableOpt, utils::SubCommand::forceUnrequired(), and utils::SubCommand::setDefaultValue().
| ConfigInstance * net::config::ConfigInstance::setInstanceName | ( | const std::string & | instanceName | ) |
Definition at line 94 of file ConfigInstance.cpp.
References instanceName.
| ConfigInstance * net::config::ConfigInstance::setOnDestroy | ( | const std::function< void(ConfigInstance *)> & | onDestroy | ) |
Definition at line 119 of file ConfigInstance.cpp.
References onDestroy.
Referenced by core::socket::stream::FlowController< ConcreteFlowController >::setOnFlowCompleted().
|
friend |
Definition at line 103 of file ConfigInstance.h.
|
private |
Definition at line 99 of file ConfigInstance.h.
Referenced by ConfigInstance(), configurable(), getDisabled(), and setDisabled().
|
private |
Definition at line 94 of file ConfigInstance.h.
Referenced by ConfigInstance(), getInstanceName(), and setInstanceName().
|
staticprivate |
Definition at line 95 of file ConfigInstance.h.
Referenced by getInstanceName().
|
private |
Definition at line 101 of file ConfigInstance.h.
Referenced by setOnDestroy(), and ~ConfigInstance().
|
private |
Definition at line 97 of file ConfigInstance.h.
Referenced by ConfigInstance().