xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
multicast_option.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include "../../core_export.h"
7 #include "../../object.h"
8 #include "../../types.h"
9 #include "../../ustring.h"
10 #include "../ip_address.h"
11 
13 namespace xtd {
15  namespace net {
17  namespace sockets {
31  class core_export_ multicast_option : public xtd::object {
32  public:
34  multicast_option() = default;
38  multicast_option(const xtd::net::ip_address& group, const xtd::net::ip_address& local_address);
46  multicast_option(const xtd::net::ip_address& group, uint32_t interface_index);
47 
51  multicast_option& operator=(const multicast_option&) = default;
52  friend std::ostream& operator <<(std::ostream& os, const multicast_option& mo) noexcept {return os << mo.to_string();}
54 
57  const xtd::net::ip_address& group() const noexcept;
61  multicast_option& group(const xtd::net::ip_address& value) noexcept;
62 
66  uint32_t interface_index() const noexcept;
72  multicast_option& interface_index(uint32_t value);
73 
76  const xtd::net::ip_address& local_address() const noexcept;
80  multicast_option& local_address(const xtd::net::ip_address& value) noexcept;
81 
82  private:
84  uint32_t interface_index_ = 0;
86  };
87  }
88  }
89 }
virtual xtd::ustring to_string() const noexcept
Returns a std::string that represents the current object.
Provides an Internet Protocol (IP) address.
Definition: ip_address.h:30
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Contains IPAddress values used to join and drop multicast groups.
Definition: multicast_option.h:31
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:26
static ip_address none
Provides an IP address that indicates that no network interface should be used. This field is constan...
Definition: ip_address.h:53