xtd 0.2.0
multicast_option.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../ip_address.hpp"
6#include "../../core_export.hpp"
7#include "../../object.hpp"
8#include "../../types.hpp"
9#include "../../string.hpp"
10
12namespace xtd {
14 namespace net {
16 namespace sockets {
39 class core_export_ multicast_option : public xtd::object, public xtd::iequatable<xtd::net::sockets::multicast_option> {
40 public:
42
45 multicast_option() = default;
49 multicast_option(const xtd::net::ip_address& group, const xtd::net::ip_address& local_address);
52 explicit multicast_option(const xtd::net::ip_address& group);
57 multicast_option(const xtd::net::ip_address& group, uint32 interface_index);
59
63 multicast_option& operator =(const multicast_option&) = default;
65
67
71 const xtd::net::ip_address& group() const noexcept;
75 multicast_option& group(const xtd::net::ip_address& value) noexcept;
76
80 uint32 interface_index() const noexcept;
85 multicast_option& interface_index(uint32 value) noexcept;
86
89 const xtd::net::ip_address& local_address() const noexcept;
93 multicast_option& local_address(const xtd::net::ip_address& value) noexcept;
95
97
102 bool equals(const object& obj) const noexcept override;
106 bool equals(const multicast_option& other) const noexcept override;
107
110 xtd::size get_hash_code() const noexcept override;
112
113 private:
114 xtd::net::ip_address group_ = xtd::net::ip_address::none;
115 uint32 interface_index_ = 0;
116 xtd::net::ip_address local_address_ = xtd::net::ip_address::none;
117 };
118 }
119 }
120}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Provides an Internet Protocol (IP) address.
Definition ip_address.hpp:42
Contains IPAddress values used to join and drop multicast groups.
Definition multicast_option.hpp:39
const xtd::net::ip_address & group() const noexcept
Gets the IP address of a multicast group.
multicast_option(const xtd::net::ip_address &group, const xtd::net::ip_address &local_address)
Initializes a new instance of the xtd::net::sockets::multicast_option class with the specified IP mul...
multicast_option()=default
Initializes a new instance of the xtd::net::sockets::multicast_option class.
multicast_option(const xtd::net::ip_address &group)
Initializes a new version of the xtd::net::sockets::multicast_option class for the specified IP multi...
multicast_option(const xtd::net::ip_address &group, uint32 interface_index)
Initializes a new instance of the xtd::net::sockets::multicast_option class with the specified IP mul...
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
#define core_export_
Define shared library export.
Definition core_export.hpp:13
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10