Qt:Документация 4.3.2/qnetworkaddressentry

Материал из Wiki.crossplatform.ru

Версия от 10:52, 12 января 2009; Root (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QNetworkAddressEntry Class Reference
[модуль QtNetwork ]

The QNetworkAddressEntry class stores one IP address supported by a network interface, along with its associated netmask and broadcast address. Далее...

 #include <QNetworkAddressEntry>

Примечание: все функции в этом классе реентерабельны.

Класс был добавлен в Qt 4.2.

[править] Открытые функции


[править] Подробное описание

The QNetworkAddressEntry class stores one IP address supported by a network interface, along with its associated netmask and broadcast address.

Each network interface can contain zero or more IP addresses, which in turn can be associated with a netmask and/or a broadcast address (depending on support from the operating system).

This class represents one such group.


[править] Описание функций-членов

[править]
QNetworkAddressEntry::QNetworkAddressEntry ()

Constructs an empty QNetworkAddressEntry object.

[править]
QNetworkAddressEntry::QNetworkAddressEntry ( const QNetworkAddressEntry & other )

Constructs a QNetworkAddressEntry object that is a copy of the object other.

[править]
QNetworkAddressEntry::~QNetworkAddressEntry ()

Destroys this QNetworkAddressEntry object.

[править]
QHostAddress QNetworkAddressEntry::broadcast () const

Returns the broadcast address associated with the IPv4 address and netmask. It can usually be derived from those two by setting to 1 the bits of the IP address where the netmask contains a 0. (In other words, by bitwise-OR'ing the IP address with the inverse of the netmask)

This member is always empty for IPv6 addresses, since the concept of broadcast has been abandoned in that system in favor of multicast. In particular, the group of hosts corresponding to all the nodes in the local network can be reached by the "all-nodes" special multicast group (address FF02::1).

See also setBroadcast().

[править]
QHostAddress QNetworkAddressEntry::ip () const

This function returns one IPv4 or IPv6 address found, that was found in a network interface.

See also setIp().

[править]
QHostAddress QNetworkAddressEntry::netmask () const

Returns the netmask associated with the IP address. The netmask is expressed in the form of an IP address, such as 255.255.0.0.

For IPv6 addresses, the prefix length is converted to an address where the number of bits set to 1 is equal to the prefix length. For a prefix length of 64 bits (the most common value), the netmask will be expressed as a QHostAddress holding the address FFFF:FFFF:FFFF:FFFF::

See also setNetmask().

[править]
void QNetworkAddressEntry::setBroadcast ( const QHostAddress & newBroadcast )

Sets the broadcast IP address of this QNetworkAddressEntry object to newBroadcast.

See also broadcast().

[править]
void QNetworkAddressEntry::setIp ( const QHostAddress & newIp )

Sets the IP address the QNetworkAddressEntry object contains to newIp.

See also ip().

[править]
void QNetworkAddressEntry::setNetmask ( const QHostAddress & newNetmask )

Sets the netmask that this QNetworkAddressEntry object contains to newNetmask.

See also netmask().

[править]
QNetworkAddressEntry & QNetworkAddressEntry::operator= ( const QNetworkAddressEntry & other )

Makes a copy of the QNetworkAddressEntry object other.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2