◆ IpcFileDescriptor() [1/3]
IpcFileDescriptor::IpcFileDescriptor |
( |
| ) |
|
Constructs a DBusFileDescriptor without a wrapped file descriptor. This is equivalent to constructing the object with an invalid file descriptor (like -1).
- See also
- fd() and isValid()
◆ IpcFileDescriptor() [2/3]
IpcFileDescriptor::IpcFileDescriptor |
( |
int |
fd_ | ) |
|
|
explicit |
Constructs a DBusFileDescriptor object by copying the fileDescriptor parameter. The original file descriptor is not touched and must be closed by the user.
Note that the value returned by fd() will be different from the fd parameter passed.
If the fd parameter is not valid, isValid() will returnfalse
and fd() will return -1
.
- See also
- fd().
◆ IpcFileDescriptor() [3/3]
Constructs a DBusFileDescriptor object by copying other.
◆ ~IpcFileDescriptor()
IpcFileDescriptor::~IpcFileDescriptor |
( |
| ) |
|
Destroys this DBusFileDescriptor object and disposes of the Unix file descriptor that it contained.
- See also
- reset() and clear()
◆ clear()
void IpcFileDescriptor::clear |
( |
| ) |
|
Same as reset, added to match c++11 naming convention.
- See also
- reset()
◆ fd()
int IpcFileDescriptor::fd |
( |
| ) |
const |
Returns the Unix file descriptor contained by this DBusFileDescriptor object. An invalid file descriptor is represented by the value -1.
Note that the file descriptor returned by this function is owned by the IpcFileDescriptor object and must not be stored past the lifetime of this object. It is ok to use it while this object is valid, but if one wants to store it for longer use you should use the IpcFileDescriptor::dup() function.
- See also
- isValid(), dup()
◆ isValid()
bool IpcFileDescriptor::isValid |
( |
| ) |
const |
Returns true
if this Unix file descriptor is valid. A valid Unix file descriptor is greater than or equal to 0.
- See also
- fd()
◆ operator=() [1/2]
Copies the Unix file descriptor from the other DBusFileDescriptor object. If the current object contained a file descriptor, it will be properly disposed of beforehand.
◆ operator=() [2/2]
Move-assigns other to this DBusFileDescriptor.
◆ operator==()
◆ reset()
void IpcFileDescriptor::reset |
( |
int |
fd_ = -1 | ) |
|
Closes the file descriptor contained by this DBusFileDescriptor object. And dup's a copy of the supplied fd if not -1.
- See also
- clear()
The documentation for this class was generated from the following files:
- AppInfrastructure/IpcService/include/IpcFileDescriptor.h
- AppInfrastructure/IpcService/source/common/IpcFileDescriptor.cpp