#include <ConfigInstance.h>
Definition at line 63 of file ConfigInstance.h.
◆ Instance
◆ Role
◆ ConfigInstance() [1/3]
| net::config::ConfigInstance::ConfigInstance |
( |
const std::string & | instanceName, |
|
|
Role | role ) |
|
explicitprotected |
Definition at line 81 of file ConfigInstance.cpp.
85 std::string("Configuration for ")
87 .append(" instance '")
89 .append("'"),
90 "Instances");
91
93 ->add_flag_function(
94 "--disabled{true}",
95 [this](std::size_t) {
97 },
98 "Disable this instance")
99 ->multi_option_policy(CLI::MultiOptionPolicy::TakeLast)
100 ->trigger_on_parse()
101 ->default_str("false")
102 ->type_name("bool")
103 ->check(CLI::IsMember({"true", "false"}))
104 ->group(
instanceSc->get_formatter()->get_label(
"Persistent Options"));
105 }
static void disabled(CLI::App *instance, bool disabled=true)
static CLI::App * addInstance(const std::string &name, const std::string &description, const std::string &group, bool final=false)
References utils::Config::addInstance(), utils::Config::disabled(), disableOpt, instanceName, instanceSc, role, and SERVER.
◆ ~ConfigInstance()
| net::config::ConfigInstance::~ConfigInstance |
( |
| ) |
|
|
protectedvirtual |
◆ ConfigInstance() [2/3]
| net::config::ConfigInstance::ConfigInstance |
( |
ConfigInstance & | | ) |
|
|
delete |
◆ ConfigInstance() [3/3]
| net::config::ConfigInstance::ConfigInstance |
( |
ConfigInstance && | | ) |
|
|
delete |
◆ addSection()
| CLI::App * net::config::ConfigInstance::addSection |
( |
const std::string & | name, |
|
|
const std::string & | description, |
|
|
const std::string & | group = "Sections" ) |
◆ get()
| CLI::App * net::config::ConfigInstance::get |
( |
| ) |
const |
◆ getDisabled()
| bool net::config::ConfigInstance::getDisabled |
( |
| ) |
const |
◆ getInstanceName()
| const std::string & net::config::ConfigInstance::getInstanceName |
( |
| ) |
const |
Definition at line 115 of file ConfigInstance.cpp.
115 {
117 }
static const std::string nameAnonymous
References instanceName, and nameAnonymous.
Referenced by net::config::ConfigSection::addOption(), net::un::config::ConfigAddress< ConfigAddressTypeT >::ConfigAddress(), net::config::ConfigSection::ConfigSection(), tls::getClient(), legacy::getLegacyClient(), net::config::stream::tls::ConfigSocketServer< ConfigSocketServerBaseT >::getSniCtx(), net::config::stream::tls::ConfigSocketClient< ConfigSocketClientBaseT >::getSslCtx(), net::config::stream::tls::ConfigSocketServer< ConfigSocketServerBaseT >::getSslCtx(), main(), and core::socket::stream::SocketConnection::SocketConnection().
◆ getRequired()
| bool net::config::ConfigInstance::getRequired |
( |
| ) |
const |
◆ getRole()
◆ getSection()
| CLI::App * net::config::ConfigInstance::getSection |
( |
const std::string & | name, |
|
|
bool | onlyGot = false, |
|
|
bool | recursive = false ) const |
Definition at line 176 of file ConfigInstance.cpp.
176 {
177 CLI::App* resultSc = nullptr;
178
179 CLI::App* sectionSc =
instanceSc->get_subcommand_no_throw(name);
180 CLI::App* parentSectionSc =
instanceSc->get_parent()->get_subcommand_no_throw(name);
181
182 if (sectionSc != nullptr && (sectionSc->count_all() > 0 || !onlyGot)) {
183 resultSc = sectionSc;
184 } else if (recursive && parentSectionSc != nullptr && (parentSectionSc->count_all() > 0 || !onlyGot)) {
185 resultSc = parentSectionSc;
186 }
187
188 return resultSc;
189 }
References instanceSc.
Referenced by net::config::ConfigSection::ConfigSection().
◆ gotSection()
| bool net::config::ConfigInstance::gotSection |
( |
const std::string & | name, |
|
|
bool | recursive = false ) const |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ required()
| void net::config::ConfigInstance::required |
( |
CLI::App * | section, |
|
|
bool | req = true ) |
◆ setDisabled()
| void net::config::ConfigInstance::setDisabled |
( |
bool | disabled = true | ) |
|
◆ setInstanceName()
| void net::config::ConfigInstance::setInstanceName |
( |
const std::string & | instanceName | ) |
|
◆ net::config::ConfigSection
◆ disableOpt
| CLI::Option* net::config::ConfigInstance::disableOpt = nullptr |
|
private |
◆ instanceName
| std::string net::config::ConfigInstance::instanceName |
|
private |
◆ instanceSc
| CLI::App* net::config::ConfigInstance::instanceSc = nullptr |
|
private |
◆ nameAnonymous
| const std::string net::config::ConfigInstance::nameAnonymous = "<anonymous>" |
|
staticprivate |
◆ requiredCount
| uint8_t net::config::ConfigInstance::requiredCount = 0 |
|
private |
◆ role
| Role net::config::ConfigInstance::role |
|
private |
The documentation for this class was generated from the following files: