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 40 of file ConfigAddress.h.

Member Typedef Documentation

◆ SocketAddress

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

Definition at line 43 of file ConfigAddress.h.

◆ Super

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

Definition at line 42 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 33 of file ConfigAddress.hpp.

36 : Super(instance, addressOptionName, addressOptionDescription) {
37 }
ConfigAddressBase< SocketAddressT > Super

◆ ~ConfigAddress()

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

Definition at line 40 of file ConfigAddress.hpp.

40 {
41 delete socketAddress;
42 }
SocketAddress * socketAddress

Member Function Documentation

◆ getSocketAddress() [1/2]

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

Definition at line 45 of file ConfigAddress.hpp.

45 {
46 if (socketAddress == nullptr) {
48 }
49
50 return *socketAddress;
51 }
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 48 of file ConfigAddressBase.hpp.

37 {
38 return SocketAddress(sockAddr, sockAddrLen);
39 }

◆ init()

◆ renew()

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

Definition at line 54 of file ConfigAddress.hpp.

54 {
55 if (socketAddress != nullptr) {
56 delete socketAddress;
57 socketAddress = nullptr;
58 }
59 }

Member Data Documentation

◆ socketAddress

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

Definition at line 58 of file ConfigAddress.h.


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