xtd 0.2.0
ip_end_point.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "end_point.hpp"
6#include "ip_address.hpp"
7#include "../iequatable.hpp"
8
10namespace xtd {
12 namespace net {
28 class core_export_ ip_end_point : public xtd::net::end_point, public xtd::iequatable<xtd::net::ip_end_point> {
29 public:
31
34 static constexpr uint16 min_port = 0x0000;
36 static constexpr uint16 max_port = 0xFFFF;
38
40
46
52
54 ip_end_point() = default;
55 ip_end_point(ip_end_point&&) = default;
56 ip_end_point(const ip_end_point&) = default;
57 ip_end_point& operator =(const ip_end_point&) = default;
59
61
65 const xtd::net::ip_address& address() const noexcept;
70
73 uint16 port() const noexcept;
78
80
87
91 bool equals(const object& obj) const noexcept override;
95 bool equals(const ip_end_point& other) const noexcept override;
96
99 xtd::size get_hash_code() const noexcept override;
100
103 xtd::net::socket_address serialize() const override;
104
107 xtd::string to_string() const noexcept override;
109
110 private:
111 xtd::net::ip_address address_;
112 uint16 port_ = 0;
113 };
114 }
115}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Identifies a network address. This is an abstract class.
Definition end_point.hpp:27
end_point(sockets::address_family address_family)
Initializes a new instance of the xtd::net::end_point class.
Definition end_point.hpp:66
Provides an Internet Protocol (IP) address.
Definition ip_address.hpp:42
xtd::uptr< end_point > create(const xtd::net::socket_address &socket_address) const override
Creates an xtd::net::end_point instance from a xtd::net::socket_address instance.
xtd::net::socket_address serialize() const override
Serializes endpoint information into a socket_address instance.
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
uint16 port() const noexcept
Gets or sets the port number of the endpoint.
static constexpr uint16 min_port
Specifies the minimum value that can be assigned to the port property. The min_port value is set to 0...
Definition ip_end_point.hpp:34
ip_end_point(const xtd::net::ip_address &address, uint16 port)
Initializes a new instance of the xtd::net::ip_end_point class.
xtd::string to_string() const noexcept override
Returns a string that represents the current object.
static constexpr uint16 max_port
Specifies the maximum value that can be assigned to the port property. The max_port value is set to 0...
Definition ip_end_point.hpp:36
const xtd::net::ip_address & address() const noexcept
Gets the IP address of the endpoint.
ip_end_point(uint32 address, uint16 port)
Initializes a new instance of the xtd::net::ip_end_point class.
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
Stores serialized information from end_point derived classes. #par Deinition.
Definition socket_address.hpp:36
Contains xtd::net::end_point class.
#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
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
Contains xtd::iequatable interface.
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.