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
26GNet::Interfaces::Interfaces( EventState es ) :
27 m_es(es)
28{
29}
30
31GNet::Interfaces::Interfaces( EventState es , InterfacesHandler & ) :
32 m_es(es)
33{
34}
35
37= default;
38
40{
41 return false ;
42}
43
45{
46 return false ;
47}
48
50{
51}
52
53bool GNet::Interfaces::loaded() const
54{
55 return true ;
56}
57
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
83void GNet::Interfaces::readEvent()
84{
85}
86
87void GNet::Interfaces::onFutureEvent()
88{
89}
90
91// ==
92
93GNet::Interfaces::Item::Item() :
94 address(Address::defaultAddress())
95{
96}
97
Interfaces(EventState)
Constructor resulting in an empty list.
std::vector< Address > addresses(const std::string &name, unsigned int port, int af=AF_UNSPEC) const
Returns addresses bound to the given interface.
void load()
Loads or reloads the list.
static bool active()
Returns true if the implementation can raise InterfacesHandler events.
bool loaded() const
Returns true if load()ed.
~Interfaces() override
Destructor.
static bool supported()
Returns false if a stubbed-out implementation.
const_iterator begin() const
Returns a begin iterator.
const_iterator end() const
Returns a one-off-the-end iterator.
G::StringArray names(bool all=false) const
Returns the interface names, optionally including interfaces that are not up.
std::vector< std::string > StringArray
A std::vector of std::strings.
Definition: gstringarray.h:30