xtd 0.2.0
multicast_option.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../ip_address.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;
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;
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
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...
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
uint32 interface_index() const noexcept
Gets the interface index that is associated with a multicast group.
const xtd::net::ip_address & local_address() const noexcept
Gets the local IP address associated with a multicast group.
multicast_option()=default
Initializes a new instance of the xtd::net::sockets::multicast_option class.
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
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
Contains core_export_ keyword.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
@ none
none of the socket operations.
Definition socket_async_operation.hpp:34
@ other
The operating system is other.
Definition platform_id.hpp:58
The xtd::net::sockets namespace provides a managed implementation of the Berkeley Sockets interface f...
Definition address_family.hpp:16
The xtd::net namespace provides a simple programming interface for many of the protocols used on netw...
Definition cookie_exception.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::net::ip_address class.
Contains xtd::object class.
Contains xtd::string alias.
Contains xtd fundamental types.