Comm::Descriptor Class Reference

#include <fd.h>

Collaboration diagram for Comm::Descriptor:

Public Member Functions

 Descriptor (int fd, unsigned int type, const char *description)
 Descriptor (Descriptor &&)=delete
 ~Descriptor ()
 Closes and calls legacy fd_close() unless release() was called earlier. More...
 operator int () const
 A copy of the descriptor for use in system calls and such. More...
int release ()
 Forgets the descriptor and prevents its automatic closure (by us). More...

Private Attributes

int fd_

Detailed Description

An open Comm-registered file descriptor guard that, upon creation, registers the descriptor with Comm and, upon destruction, unregisters and closes the descriptor (unless the descriptor has been release()d by then).

Definition at line 19 of file fd.h.

Constructor & Destructor Documentation

◆ Descriptor() [1/2]

Comm::Descriptor::Descriptor ( int  fd,
unsigned int  type,
const char *  description 

Starts owning the given FD of a given type, with a given description. Assumes the given descriptor is open and calls legacy fd_open().

Definition at line 325 of file

References fd_, fd_open(), and type.

◆ Descriptor() [2/2]

Comm::Descriptor::Descriptor ( Descriptor &&  )

◆ ~Descriptor()

Comm::Descriptor::~Descriptor ( )

Definition at line 330 of file

References debugs, and fd_close().

Member Function Documentation

◆ operator int()

Comm::Descriptor::operator int ( ) const

Definition at line 31 of file fd.h.

References fd_.

◆ release()

int Comm::Descriptor::release ( )

Definition at line 34 of file fd.h.

References fd_.

Referenced by Comm::TcpAcceptor::oldAccept().

Member Data Documentation

◆ fd_

int Comm::Descriptor::fd_

Definition at line 37 of file fd.h.

Referenced by Descriptor(), operator int(), and release().

The documentation for this class was generated from the following files:






Web Site Translations