|
DBus-1-TQt
1.0
|
#include <tqdbusunixfd.h>
Collaboration diagram for TQT_DBusUnixFd:Classes | |
| struct | TQT_DBusUnixFdPrivate |
Public Member Functions | |
| TQT_DBusUnixFd () | |
| TQT_DBusUnixFd (const TQT_DBusUnixFd &other) | |
| TQT_DBusUnixFd (int other) | |
| virtual | ~TQT_DBusUnixFd () |
| bool | isValid () const |
| int | fileDescriptor () const |
| void | setFileDescriptor (int fileDescriptor) |
| void | giveFileDescriptor (int fileDescriptor) |
| TQT_DBusUnixFd & | operator= (const TQT_DBusUnixFd &other) |
| bool | operator== (const TQT_DBusUnixFd &other) const |
| bool | operator!= (const TQT_DBusUnixFd &other) const |
Protected Attributes | |
| TQT_DBusUnixFd::TQT_DBusUnixFdPrivate * | d |
Class for representing D-Bus unix file handles.
This data type is necessary to correctly represent unix file handles in the context of D-Bus messages, since normal strings have a different D-Bus signature than unix file handles.
Definition at line 51 of file tqdbusunixfd.h.
Creates an empty and invalid unix file handle.
Definition at line 27 of file tqdbusunixfd.cpp.
References d, and TQT_DBusUnixFd::TQT_DBusUnixFdPrivate::fd.
| TQT_DBusUnixFd::TQT_DBusUnixFd | ( | const TQT_DBusUnixFd & | other | ) |
| TQT_DBusUnixFd::TQT_DBusUnixFd | ( | int | other | ) |
Creates copy of the given other unix file handle.
| other | the unix file handle to copy |
Definition at line 38 of file tqdbusunixfd.cpp.
References setFileDescriptor().
: d(0) { setFileDescriptor(other); }
Here is the call graph for this function:| TQT_DBusUnixFd::~TQT_DBusUnixFd | ( | ) | [virtual] |
| int TQT_DBusUnixFd::fileDescriptor | ( | ) | const |
Get unix file handle.
Definition at line 58 of file tqdbusunixfd.cpp.
References d, and TQT_DBusUnixFd::TQT_DBusUnixFdPrivate::fd.
Here is the caller graph for this function:| void TQT_DBusUnixFd::giveFileDescriptor | ( | int | fileDescriptor | ) |
Give unix file handle.
Definition at line 68 of file tqdbusunixfd.cpp.
References d, TQT_DBusUnixFd::TQT_DBusUnixFdPrivate::fd, fileDescriptor(), and isValid().
{
if ( d && d->deref() ) {
if ( isValid() ) {
close(d->fd);
}
}
else {
d = new TQT_DBusUnixFdPrivate;
}
d->ref();
d->fd = fileDescriptor;
}
Here is the call graph for this function:
Here is the caller graph for this function:| bool TQT_DBusUnixFd::isValid | ( | ) | const |
Returns whether the current content is considered a valid unix file handle.
true if the object's content describe a valid unix file handle, otherwise false Definition at line 53 of file tqdbusunixfd.cpp.
References d, and TQT_DBusUnixFd::TQT_DBusUnixFdPrivate::fd.
Here is the caller graph for this function:| bool TQT_DBusUnixFd::operator!= | ( | const TQT_DBusUnixFd & | other | ) | const [inline] |
Checks if the given other variant is not equal to this one.
| other | unix file handle to compare with |
true if both use different file handle, otherwise false Definition at line 137 of file tqdbusunixfd.h.
References d.
| TQT_DBusUnixFd & TQT_DBusUnixFd::operator= | ( | const TQT_DBusUnixFd & | other | ) |
Copy unix file handle from TQT_DBusUnixFd.
Definition at line 82 of file tqdbusunixfd.cpp.
References d, TQT_DBusUnixFd::TQT_DBusUnixFdPrivate::fd, and isValid().
{
if (other.d) {
other.d->ref();
}
if ( d && d->deref() ) {
if ( isValid() ) {
close(d->fd);
}
delete d;
}
d = other.d;
return *this;
}
Here is the call graph for this function:| bool TQT_DBusUnixFd::operator== | ( | const TQT_DBusUnixFd & | other | ) | const [inline] |
Checks if the given other variant is equal to this one.
| other | unix file handle to compare with |
true if both use same file handle, otherwise false Definition at line 124 of file tqdbusunixfd.h.
References d.
| void TQT_DBusUnixFd::setFileDescriptor | ( | int | fileDescriptor | ) |
Set new unix file handle.
Definition at line 63 of file tqdbusunixfd.cpp.
References giveFileDescriptor().
{
giveFileDescriptor(fileDescriptor != -1 ? dup(fileDescriptor) : -1);
}
Here is the call graph for this function:
Here is the caller graph for this function: TQT_DBusUnixFd::TQT_DBusUnixFdPrivate * TQT_DBusUnixFd::d [protected] |