Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Private Attributes | List of all members
AI_IPC::IpcFileDescriptor Class Reference

Public Member Functions

 IpcFileDescriptor ()
 
 IpcFileDescriptor (int fd)
 
 IpcFileDescriptor (const IpcFileDescriptor &other)
 
IpcFileDescriptoroperator= (IpcFileDescriptor &&other)
 
IpcFileDescriptoroperator= (const IpcFileDescriptor &other)
 
 ~IpcFileDescriptor ()
 
bool operator== (const IpcFileDescriptor &rhs) const
 
bool isValid () const
 
int fd () const
 
int dup () const
 
void reset (int fd=-1)
 
void clear ()
 

Private Attributes

int mFd
 

Constructor & Destructor Documentation

◆ 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]

IpcFileDescriptor::IpcFileDescriptor ( const IpcFileDescriptor other)

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()

Member Function Documentation

◆ 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]

IpcFileDescriptor & IpcFileDescriptor::operator= ( const IpcFileDescriptor other)

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]

IpcFileDescriptor & IpcFileDescriptor::operator= ( IpcFileDescriptor &&  other)

Move-assigns other to this DBusFileDescriptor.

◆ operator==()

bool IpcFileDescriptor::operator== ( const IpcFileDescriptor rhs) const

FIXME

◆ 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: