SNode.C
Loading...
Searching...
No Matches
net::un::config::ConfigAddress< ConfigAddressTypeT > Class Template Reference

#include <ConfigAddress.h>

Inheritance diagram for net::un::config::ConfigAddress< ConfigAddressTypeT >:
Collaboration diagram for net::un::config::ConfigAddress< ConfigAddressTypeT >:

Public Member Functions

ConfigAddresssetSocketAddress (const SocketAddress &socketAddress)
ConfigAddresssetSunPath (const std::string &sunPath)
std::string getSunPath () const
void configurable (bool configurable=true) final
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
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

 ConfigAddress (net::config::ConfigInstance *instance, const std::string &addressOptionName, const std::string &addressOptionDescription)
ConfigAddresssunPathRequired (bool required=true)
Protected Member Functions inherited from utils::SubCommand
 SubCommand (SubCommand *parent, std::shared_ptr< utils::AppWithPtr > appWithPtr, const std::string &group, bool final)
template<typename ConcretSubCommand>
 SubCommand (SubCommand *parent, ConcretSubCommand *concretSubCommand, const std::string &group, bool final=true)
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 = ConfigAddressTypeT<net::un::SocketAddress>

Private Member Functions

SocketAddressinit () final

Private Attributes

CLI::Option * sunPathOpt = nullptr

Additional Inherited Members

Static Protected Member Functions inherited from utils::SubCommand
static CLI::App * getHelpTriggerApp ()
static CLI::App * getShowConfigTriggerApp ()
static CLI::App * getCommandlineTriggerApp ()
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

template<template< typename SocketAddressT > typename ConfigAddressTypeT>
class net::un::config::ConfigAddress< ConfigAddressTypeT >

Definition at line 75 of file ConfigAddress.h.

Member Typedef Documentation

◆ Super

template<template< typename SocketAddressT > typename ConfigAddressTypeT>
using net::un::config::ConfigAddress< ConfigAddressTypeT >::Super = ConfigAddressTypeT<net::un::SocketAddress>
private

Definition at line 79 of file ConfigAddress.h.

Constructor & Destructor Documentation

◆ ConfigAddress()

template<template< typename SocketAddress > typename ConfigAddressType>
net::un::config::ConfigAddress< ConfigAddressType >::ConfigAddress ( net::config::ConfigInstance * instance,
const std::string & addressOptionName,
const std::string & addressOptionDescription )
protected

Definition at line 70 of file ConfigAddress.cpp.

73 : ConfigSection(instance, this)
76 "--sun-path",
77 "Unix domain bind path",
78 "filename",
79 std::string('\0' + instance->getInstanceName() + std::to_string(getpid()) + "_" + utils::Uuid::getUuid()),
81 }
ConfigSection(ConfigInstance *instance, T *sectionPtr, const std::string &group="Sections")
CLI::Option * addOption(const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const

References net::config::ConfigInstance::getInstanceName(), utils::Uuid::getUuid(), and sunPathOpt.

Here is the call graph for this function:

Member Function Documentation

◆ configurable()

template<template< typename SocketAddressT > typename ConfigAddressTypeT>
void net::un::config::ConfigAddress< ConfigAddressTypeT >::configurable ( bool configurable = true)
final

Definition at line 122 of file ConfigAddress.cpp.

122 {
124 }
void configurable(bool configurable=true) final
CLI::Option * setConfigurable(CLI::Option *option, bool configurable) const

References sunPathOpt.

◆ getSunPath()

template<template< typename SocketAddress > typename ConfigAddressType>
std::string net::un::config::ConfigAddress< ConfigAddressType >::getSunPath ( ) const

Definition at line 117 of file ConfigAddress.cpp.

117 {
118 return sunPathOpt->as<std::string>();
119 }

References sunPathOpt.

◆ init()

template<template< typename SocketAddress > typename ConfigAddressType>
SocketAddress * net::un::config::ConfigAddress< ConfigAddressType >::init ( )
finalprivate

Definition at line 84 of file ConfigAddress.cpp.

84 {
86
87 try {
90 delete socketAddress;
91 socketAddress = nullptr;
92
93 throw;
94 }
95
96 return socketAddress;
97 }
SocketAddress * init() final

References net::un::SocketAddress::SocketAddress(), and sunPathOpt.

Here is the call graph for this function:

◆ setSocketAddress()

template<template< typename SocketAddress > typename ConfigAddressType>
ConfigAddress< ConfigAddressType > & net::un::config::ConfigAddress< ConfigAddressType >::setSocketAddress ( const SocketAddress & socketAddress)

Definition at line 100 of file ConfigAddress.cpp.

100 {
102
103 return *this;
104 }
ConfigAddress & setSunPath(const std::string &sunPath)

References net::un::SocketAddress::getSunPath(), and setSunPath().

Here is the call graph for this function:

◆ setSunPath()

template<template< typename SocketAddress > typename ConfigAddressType>
ConfigAddress< ConfigAddressType > & net::un::config::ConfigAddress< ConfigAddressType >::setSunPath ( const std::string & sunPath)

Definition at line 107 of file ConfigAddress.cpp.

107 {
109
111 required(sunPathOpt, false);
112
113 return *this;
114 }
SubCommand * required(bool required=true, bool force=true)
CLI::Option * setDefaultValue(CLI::Option *option, const ValueTypeT &value, bool clear=true) const
Definition SubCommand.h:347

References sunPathOpt.

Referenced by setSocketAddress().

Here is the caller graph for this function:

◆ sunPathRequired()

template<template< typename SocketAddress > typename ConfigAddressType>
ConfigAddress< ConfigAddressType > & net::un::config::ConfigAddress< ConfigAddressType >::sunPathRequired ( bool required = true)
protected

Definition at line 127 of file ConfigAddress.cpp.

127 {
129
130 return *this;
131 }

References sunPathOpt.

Referenced by net::un::stream::config::ConfigSocketClient::ConfigSocketClient(), and net::un::stream::config::ConfigSocketServer::ConfigSocketServer().

Here is the caller graph for this function:

Member Data Documentation

◆ sunPathOpt

template<template< typename SocketAddressT > typename ConfigAddressTypeT>
CLI::Option* net::un::config::ConfigAddress< ConfigAddressTypeT >::sunPathOpt = nullptr
private

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