E-MailRelay

ginterfaces_none.cpp
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2024 Graeme Walker <graeme_walker@users.sourceforge.net>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16// ===
17///
18/// \file ginterfaces_none.cpp
19///
20
21#include "gdef.h"
22#include "ginterfaces.h"
23#include "gstr.h"
24#include "gassert.h"
25
26 GNet::Interfaces::Interfaces( EventState es ) :
27 m_es(es)
28{
29}
30
31 GNet::Interfaces::Interfaces( EventState es , InterfacesHandler & ) :
32 m_es(es)
33{
34}
35
36 GNet::Interfaces::~Interfaces()
37= default;
38
39 bool GNet::Interfaces::supported()
40{
41 return false ;
42}
43
44 bool GNet::Interfaces::active()
45{
46 return false ;
47}
48
49 void GNet::Interfaces::load()
50{
51}
52
53 bool GNet::Interfaces::loaded() const
54{
55 return true ;
56}
57
58 G::StringArray GNet::Interfaces::names( bool ) const
59{
60 return G::StringArray() ;
61}
62
63GNet::Interfaces::const_iterator GNet::Interfaces::begin() const
64{
65 return m_list.begin() ;
66}
67
68GNet::Interfaces::const_iterator GNet::Interfaces::end() const
69{
70 return m_list.end() ;
71}
72
73std::size_t GNet::Interfaces::addresses( std::vector<GNet::Address> & , const std::string & , unsigned int , int ) const
74{
75 return 0U ;
76}
77
78std::vector<GNet::Address> GNet::Interfaces::addresses( const std::string & , unsigned int , int ) const
79{
80 return {} ;
81}
82
83 void GNet::Interfaces::readEvent()
84{
85}
86
87 void GNet::Interfaces::onFutureEvent()
88{
89}
90
91// ==
92
93GNet::Interfaces::Item::Item() :
94 address(Address::defaultAddress())
95{
96}
97
GNet::Interfaces::Interfaces
Interfaces(EventState)
Constructor resulting in an empty list.
Definition: ginterfaces_common.cpp:28
GNet::Interfaces::addresses
std::vector< Address > addresses(const std::string &name, unsigned int port, int af=AF_UNSPEC) const
Returns addresses bound to the given interface.
Definition: ginterfaces_common.cpp:65
GNet::Interfaces::load
void load()
Loads or reloads the list.
Definition: ginterfaces_common.cpp:43
GNet::Interfaces::active
static bool active()
Returns true if the implementation can raise InterfacesHandler events.
Definition: ginterfaces_none.cpp:44
GNet::Interfaces::loaded
bool loaded() const
Returns true if load()ed.
Definition: ginterfaces_common.cpp:59
GNet::Interfaces::~Interfaces
~Interfaces() override
Destructor.
GNet::Interfaces::supported
static bool supported()
Returns false if a stubbed-out implementation.
Definition: ginterfaces_common.cpp:53
GNet::Interfaces::begin
const_iterator begin() const
Returns a begin iterator.
Definition: ginterfaces_common.cpp:111
GNet::Interfaces::end
const_iterator end() const
Returns a one-off-the-end iterator.
Definition: ginterfaces_common.cpp:116
GNet::Interfaces::names
G::StringArray names(bool all=false) const
Returns the interface names, optionally including interfaces that are not up.
Definition: ginterfaces_common.cpp:97
gassert.h
ginterfaces.h
gstr.h
G::StringArray
std::vector< std::string > StringArray
A std::vector of std::strings.
Definition: gstringarray.h:30