glibmm: Gio::InetAddress Class Reference
An IPv4/IPv6 address. More...
#include <giomm/inetaddress.h>

Public Member Functions | |
InetAddress (InetAddress&& src) noexcept | |
InetAddress& | operator= (InetAddress&& src) noexcept |
~InetAddress () noexcept override | |
GInetAddress* | gobj () |
Provides access to the underlying C GObject. More... | |
const GInetAddress* | gobj () const |
Provides access to the underlying C GObject. More... | |
GInetAddress* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
bool | address_equal (const Glib::RefPtr< const InetAddress >& other_address) const |
Checks if two InetAddress instances are equal, e.g. the same address. More... | |
const guint8* | to_bytes () const |
Gets the raw binary address data from address. More... | |
Glib::ustring | to_string () const |
Converts address to string form. More... | |
SocketFamily | get_family () const |
Gets address's family. More... | |
bool | get_is_any () const |
Tests whether address is the "any" address for its family. More... | |
bool | get_is_link_local () const |
Tests whether address is a link-local address (that is, if it identifies a host on a local network that is not connected to the Internet). More... | |
bool | get_is_loopback () const |
Tests whether address is the loopback address for its family. More... | |
bool | get_is_mc_global () const |
Tests whether address is a global multicast address. More... | |
bool | get_is_mc_link_local () const |
Tests whether address is a link-local multicast address. More... | |
bool | get_is_mc_node_local () const |
Tests whether address is a node-local multicast address. More... | |
bool | get_is_mc_org_local () const |
Tests whether address is an organization-local multicast address. More... | |
bool | get_is_mc_site_local () const |
Tests whether address is a site-local multicast address. More... | |
bool | get_is_multicast () const |
Tests whether address is a multicast address. More... | |
bool | get_is_site_local () const |
Tests whether address is a site-local address such as 10.0.0.1 (that is, the address identifies a host on a local network that can not be reached directly from the Internet, but which may have outgoing Internet connectivity via a NAT or firewall). More... | |
gsize | get_native_size () const |
Gets the size of the native raw binary address for address. More... | |
Glib::PropertyProxy_ReadOnly< void* > | property_bytes () const |
The raw address data. More... | |
Glib::PropertyProxy_ReadOnly< SocketFamily > | property_family () const |
The address family (IPv4 or IPv6). More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_any () const |
Whether this is the "any" address for its family. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_link_local () const |
Whether this is a link-local address. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_loopback () const |
Whether this is the loopback address for its family. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_mc_global () const |
Whether this is a global multicast address. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_mc_link_local () const |
Whether this is a link-local multicast address. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_mc_node_local () const |
Whether this is a node-local multicast address. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_mc_org_local () const |
Whether this is an organization-local multicast address. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_mc_site_local () const |
Whether this is a site-local multicast address. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_multicast () const |
Whether this is a multicast address. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_site_local () const |
Whether this is a site-local address. More... | |
![]() | |
Object (const Object&)=delete | |
Object& | operator= (const Object&)=delete |
Object (Object&& src) noexcept | |
Object& | operator= (Object&& src) noexcept |
void* | get_data (const QueryQuark& key) |
void | set_data (const Quark& key, void* data) |
void | set_data (const Quark& key, void* data, DestroyNotify notify) |
void | remove_data (const QueryQuark& quark) |
void* | steal_data (const QueryQuark& quark) |
![]() | |
ObjectBase (const ObjectBase&)=delete | |
ObjectBase& | operator= (const ObjectBase&)=delete |
void | set_property_value (const Glib::ustring& property_name, const Glib::ValueBase& value) |
You probably want to use a specific property_*() accessor method instead. More... | |
void | get_property_value (const Glib::ustring& property_name, Glib::ValueBase& value) const |
You probably want to use a specific property_*() accessor method instead. More... | |
template<class PropertyType > | |
void | set_property (const Glib::ustring& property_name, const PropertyType& value) |
You probably want to use a specific property_*() accessor method instead. More... | |
template<class PropertyType > | |
void | get_property (const Glib::ustring& property_name, PropertyType& value) const |
You probably want to use a specific property_*() accessor method instead. More... | |
template<class PropertyType > | |
PropertyType | get_property (const Glib::ustring& property_name) const |
You probably want to use a specific property_*() accessor method instead. More... | |
sigc::connection | connect_property_changed (const Glib::ustring& property_name, const sigc::slot< void()>& slot) |
You can use the signal_changed() signal of the property proxy instead. More... | |
sigc::connection | connect_property_changed (const Glib::ustring& property_name, sigc::slot< void()>&& slot) |
You can use the signal_changed() signal of the property proxy instead. More... | |
void | freeze_notify () |
Increases the freeze count on object. More... | |
void | thaw_notify () |
Reverts the effect of a previous call to freeze_notify(). More... | |
virtual void | reference () const |
Increment the reference count for this object. More... | |
virtual void | unreference () const |
Decrement the reference count for this object. More... | |
GObject* | gobj () |
Provides access to the underlying C GObject. More... | |
const GObject* | gobj () const |
Provides access to the underlying C GObject. More... | |
GObject* | gobj_copy () const |
Give a ref-ed copy to someone. Use for direct struct access. More... | |
![]() | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) noexcept | |
~trackable () | |
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) noexcept |
void | remove_destroy_notify_callback (notifiable *data) const |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< InetAddress > | create (const Glib::ustring&string) |
static Glib::RefPtr< InetAddress > | create (const guint8* bytes, SocketFamily family) |
static Glib::RefPtr< InetAddress > | create_any (SocketFamily family) |
static Glib::RefPtr< InetAddress > | create_loopback (SocketFamily family) |
Protected Member Functions | |
InetAddress (const guint8* bytes, SocketFamily family) | |
![]() | |
Object () | |
Object (const Glib::ConstructParams& construct_params) | |
Object (GObject* castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. More... | |
ObjectBase (const char* custom_type_name) | |
A derived constructor always overrides this choice. More... | |
ObjectBase (const std::type_info& custom_type_info) | |
This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. More... | |
ObjectBase (ObjectBase&& src) noexcept | |
ObjectBase& | operator= (ObjectBase&& src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject* castitem) |
void | initialize_move (GObject* castitem, Glib::ObjectBase* previous_wrapper) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gio::InetAddress > | wrap (GInetAddress* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
Glib::RefPtr< Glib::Object > | wrap (GObject* object, bool take_copy=false) |
Additional Inherited Members | |
![]() | |
using | DestroyNotify = void(*)(gpointer data) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
Detailed Description
An IPv4/IPv6 address.
InetAddress represents an IPv4 or IPv6 internet address. Use Resolver::lookup_by_name() or Resolver::lookup_by_name_async() to look up the InetAddress for a hostname. Use Resolver::lookup_by_address() or Resolver::lookup_by_address_async() to look up the hostname for a InetAddress.
To actually connect to a remote host, you will need a InetSocketAddress (which includes a InetAddress as well as a port number).
Constructor & Destructor Documentation
|
noexcept |
|
overridenoexcept |
|
explicitprotected |
Member Function Documentation
bool Gio::InetAddress::address_equal | ( | const Glib::RefPtr< const InetAddress >& | other_address | ) | const |
Checks if two InetAddress instances are equal, e.g. the same address.
- Parameters
-
other_address Another InetAddress.
- Returns
true
if address and other_address are equal,false
otherwise.
|
static |
|
static |
|
static |
|
static |
SocketFamily Gio::InetAddress::get_family | ( | ) | const |
bool Gio::InetAddress::get_is_any | ( | ) | const |
Tests whether address is the "any" address for its family.
- Returns
true
if address is the "any" address for its family.
bool Gio::InetAddress::get_is_link_local | ( | ) | const |
Tests whether address is a link-local address (that is, if it identifies a host on a local network that is not connected to the Internet).
- Returns
true
if address is a link-local address.
bool Gio::InetAddress::get_is_loopback | ( | ) | const |
Tests whether address is the loopback address for its family.
- Returns
true
if address is the loopback address for its family.
bool Gio::InetAddress::get_is_mc_global | ( | ) | const |
Tests whether address is a global multicast address.
- Returns
true
if address is a global multicast address.
bool Gio::InetAddress::get_is_mc_link_local | ( | ) | const |
Tests whether address is a link-local multicast address.
- Returns
true
if address is a link-local multicast address.
bool Gio::InetAddress::get_is_mc_node_local | ( | ) | const |
Tests whether address is a node-local multicast address.
- Returns
true
if address is a node-local multicast address.
bool Gio::InetAddress::get_is_mc_org_local | ( | ) | const |
Tests whether address is an organization-local multicast address.
- Returns
true
if address is an organization-local multicast address.
bool Gio::InetAddress::get_is_mc_site_local | ( | ) | const |
Tests whether address is a site-local multicast address.
- Returns
true
if address is a site-local multicast address.
bool Gio::InetAddress::get_is_multicast | ( | ) | const |
Tests whether address is a multicast address.
- Returns
true
if address is a multicast address.
bool Gio::InetAddress::get_is_site_local | ( | ) | const |
Tests whether address is a site-local address such as 10.0.0.1 (that is, the address identifies a host on a local network that can not be reached directly from the Internet, but which may have outgoing Internet connectivity via a NAT or firewall).
- Returns
true
if address is a site-local address.
gsize Gio::InetAddress::get_native_size | ( | ) | const |
Gets the size of the native raw binary address for address.
This is the size of the data that you get from g_inet_address_to_bytes().
- Returns
- The number of bytes used for the native version of address.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GInetAddress* Gio::InetAddress::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
Glib::PropertyProxy_ReadOnly< void* > Gio::InetAddress::property_bytes | ( | ) | const |
The raw address data.
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< SocketFamily > Gio::InetAddress::property_family | ( | ) | const |
The address family (IPv4 or IPv6).
Default value: Gio::SocketFamily::INVALID
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_any | ( | ) | const |
Whether this is the "any" address for its family.
See g_inet_address_get_is_any().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_link_local | ( | ) | const |
Whether this is a link-local address.
See g_inet_address_get_is_link_local().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_loopback | ( | ) | const |
Whether this is the loopback address for its family.
See g_inet_address_get_is_loopback().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_mc_global | ( | ) | const |
Whether this is a global multicast address.
See g_inet_address_get_is_mc_global().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_mc_link_local | ( | ) | const |
Whether this is a link-local multicast address.
See g_inet_address_get_is_mc_link_local().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_mc_node_local | ( | ) | const |
Whether this is a node-local multicast address.
See g_inet_address_get_is_mc_node_local().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_mc_org_local | ( | ) | const |
Whether this is an organization-local multicast address.
See g_inet_address_get_is_mc_org_local().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_mc_site_local | ( | ) | const |
Whether this is a site-local multicast address.
See g_inet_address_get_is_mc_site_local().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_multicast | ( | ) | const |
Whether this is a multicast address.
See g_inet_address_get_is_multicast().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gio::InetAddress::property_is_site_local | ( | ) | const |
Whether this is a site-local address.
See g_inet_address_get_is_loopback().
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
const guint8* Gio::InetAddress::to_bytes | ( | ) | const |
Gets the raw binary address data from address.
- Returns
- A pointer to an internal array of the bytes in address, which should not be modified, stored, or freed. The size of this array can be gotten with g_inet_address_get_native_size().
Glib::ustring Gio::InetAddress::to_string | ( | ) | const |
Converts address to string form.
- Returns
- A representation of address as a string, which should be freed after use.
Friends And Related Function Documentation
|
related |
A Glib::wrap() method for this object.
- Parameters
-
object The C instance. take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
- Returns
- A C++ instance that wraps this C instance.