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.
end_point.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include <memory>
7 #include "../core_export.h"
8 #include "../object.h"
9 #include "../types.h"
10 #include "../ustring.h"
11 #include "socket_address.h"
12 #include "sockets/address_family.h"
13 
15 namespace xtd {
17  namespace net {
24  class core_export_ end_point : public xtd::object {
25  public:
27  end_point(end_point&& end_point) = default;
28  end_point(const end_point& end_point) = default;
29  end_point& operator=(const end_point&) = default;
30  friend std::ostream& operator <<(std::ostream& os, const end_point& end_point) noexcept {return os << end_point.to_string();}
32 
37  virtual std::unique_ptr<end_point> create(const socket_address& socket_address) const;
38 
41  sockets::address_family address_family() const noexcept;
42 
45  virtual socket_address serialize() const;
46 
49  ustring to_string() const noexcept override;
50 
51  protected:
53  explicit end_point(sockets::address_family address_family) : address_family_(address_family) {}
54 
56  end_point() = default;
57 
60  };
61  }
62 }
Identifies a network address. This is an abstract class.
Definition: end_point.h:24
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Contains xtd::net::socket_address class.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Stores serialized information from end_point derived classes.
Definition: socket_address.h:28
end_point(sockets::address_family address_family)
Initializes a new instance of the xtd::net::end_point class.
Definition: end_point.h:53
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:26
Contains xtd::net::sockets::address_family enum.
ustring to_string() const noexcept override
Returns a string that represents the current object.
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use...
Definition: address_family.h:24
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37