libcosmos
Linux C++ System Programming Library
Loading...
Searching...
No Matches
InterfaceAddressList.hxx
1
#pragma once
2
3
// cosmos
4
#include <cosmos/dso_export.h>
5
#include <cosmos/net/InterfaceAddress.hxx>
6
#include <cosmos/net/InterfaceAddressIterator.hxx>
7
8
namespace
cosmos {
9
11
19
class
COSMOS_API
InterfaceAddressList
{
20
public
:
// functions
21
22
~InterfaceAddressList
() {
23
clear();
24
}
25
27
void
fetch();
28
30
34
void
clear();
35
37
bool
valid
()
const
{
38
return
m_addrs !=
nullptr
;
39
}
40
41
InterfaceAddressIterator
begin()
const
{
42
return
InterfaceAddressIterator
{m_addrs};
43
}
44
45
InterfaceAddressIterator end()
const
{
46
return
InterfaceAddressIterator{
nullptr
};
47
}
48
49
protected
:
// data
50
51
struct
ifaddrs *m_addrs =
nullptr
;
52
};
53
54
}
// end ns
cosmos::InterfaceAddressIterator
Iterator helper type for InterfaceAddressList.
Definition
InterfaceAddressIterator.hxx:14
cosmos::InterfaceAddressList
Access to the list of local network interface addresses.
Definition
InterfaceAddressList.hxx:19
cosmos::InterfaceAddressList::valid
bool valid() const
Returns whether currently a list of network interface addresses is available.
Definition
InterfaceAddressList.hxx:37
include
net
InterfaceAddressList.hxx
Generated by
1.12.0