SNode.C
Loading...
Searching...
No Matches
net::config::ConfigAddress< SocketAddressT > Class Template Referenceabstract

#include <ConfigAddress.h>

Inheritance diagram for net::config::ConfigAddress< SocketAddressT >:
Collaboration diagram for net::config::ConfigAddress< SocketAddressT >:

Public Member Functions

SocketAddressgetSocketAddress ()
 
void renew ()
 
SocketAddressT getSocketAddress (const typename SocketAddressT::SockAddr &sockAddr, typename SocketAddressT::SockLen sockAddrLen)
 
- Public Member Functions inherited from net::config::ConfigAddressBase< SocketAddressT >
SocketAddressT getSocketAddress (const typename SocketAddressT::SockAddr &sockAddr, typename SocketAddressT::SockLen sockAddrLen)
 

Protected Member Functions

 ConfigAddress (ConfigInstance *instance, const std::string &addressOptionName, const std::string &addressOptionDescription)
 
 ~ConfigAddress () override
 
- Protected Member Functions inherited from net::config::ConfigAddressBase< SocketAddressT >
 ConfigAddressBase (ConfigInstance *instance, const std::string &addressOptionName="", const std::string &addressOptionDescription="")
 
virtual ~ConfigAddressBase ()=default
 
- Protected Member Functions inherited from net::config::ConfigSection
 ConfigSection (ConfigInstance *instance, const std::string &name, const std::string &description)
 
 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)
 
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)
 
void required (CLI::Option *opt, bool req=true)
 
bool required () 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)
 

Private Types

using Super = ConfigAddressBase<SocketAddressT>
 
using SocketAddress = SocketAddressT
 

Private Member Functions

virtual SocketAddressinit ()=0
 

Private Attributes

SocketAddresssocketAddress = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from net::config::ConfigSection
CLI::App * section = nullptr
 

Detailed Description

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

Definition at line 62 of file ConfigAddress.h.

Member Typedef Documentation

◆ SocketAddress

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

Definition at line 65 of file ConfigAddress.h.

◆ Super

template<typename SocketAddressT >
using net::config::ConfigAddress< SocketAddressT >::Super = ConfigAddressBase<SocketAddressT>
private

Definition at line 64 of file ConfigAddress.h.

Constructor & Destructor Documentation

◆ ConfigAddress()

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

Definition at line 55 of file ConfigAddress.hpp.

58 : Super(instance, addressOptionName, addressOptionDescription) {
59 }
ConfigAddressBase< SocketAddressT > Super

◆ ~ConfigAddress()

template<typename SocketAddress >
net::config::ConfigAddress< SocketAddress >::~ConfigAddress ( )
overrideprotected

Definition at line 62 of file ConfigAddress.hpp.

62 {
63 delete socketAddress;
64 }
SocketAddress * socketAddress

Member Function Documentation

◆ getSocketAddress() [1/2]

template<typename SocketAddress >
SocketAddress & net::config::ConfigAddress< SocketAddress >::getSocketAddress ( )

Definition at line 67 of file ConfigAddress.hpp.

67 {
68 if (socketAddress == nullptr) {
70 }
71
72 return *socketAddress;
73 }
virtual SocketAddress * init()=0

◆ getSocketAddress() [2/2]

template<typename SocketAddressT >
SocketAddress net::config::ConfigAddressBase< SocketAddress >::getSocketAddress ( const typename SocketAddressT::SockAddr & sockAddr,
typename SocketAddressT::SockLen sockAddrLen )

Definition at line 70 of file ConfigAddressBase.hpp.

59 {
60 return SocketAddress(sockAddr, sockAddrLen);
61 }

◆ init()

◆ renew()

template<typename SocketAddress >
void net::config::ConfigAddress< SocketAddress >::renew ( )

Definition at line 76 of file ConfigAddress.hpp.

76 {
77 if (socketAddress != nullptr) {
78 delete socketAddress;
79 socketAddress = nullptr;
80 }
81 }

Member Data Documentation

◆ socketAddress

template<typename SocketAddressT >
SocketAddress* net::config::ConfigAddress< SocketAddressT >::socketAddress = nullptr
private

Definition at line 80 of file ConfigAddress.h.


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