|
myTinySQL v0.2.0-2-g5000098
A tiny SQL interpreter over fixed-width text files
|
Owns a socket descriptor and closes it when it goes out of scope (RAII). More...
Public Member Functions | |
| Socket (int fd) | |
| Takes ownership of a descriptor. | |
| ~Socket () | |
| Closes the descriptor, if there is one. | |
| Socket (const Socket &)=delete | |
| Not copyable: two copies would close the same descriptor. | |
| Socket & | operator= (const Socket &)=delete |
| Not copyable. | |
| Socket (Socket &&other) noexcept | |
| Takes over another Socket's descriptor, here to hand a connection to its thread. | |
| Socket & | operator= (Socket &&)=delete |
| Not needed: a Socket is only ever moved into a new Socket, never assigned. | |
| int | fd () const |
| The descriptor, for system calls. | |
Private Attributes | |
| int | fd_ |
| The descriptor, or -1 for none. | |
Owns a socket descriptor and closes it when it goes out of scope (RAII).
Definition at line 46 of file Server.cpp.
|
inlineexplicit |
Takes ownership of a descriptor.
| fd | The descriptor, or -1 for none. |
Definition at line 50 of file Server.cpp.
|
inline |
Closes the descriptor, if there is one.
Definition at line 53 of file Server.cpp.
|
inlinenoexcept |
Takes over another Socket's descriptor, here to hand a connection to its thread.
| other | The Socket to take from; it is left empty, so the descriptor is closed exactly once. |
Definition at line 65 of file Server.cpp.
|
inline |
The descriptor, for system calls.
Definition at line 70 of file Server.cpp.
|
private |
The descriptor, or -1 for none.
Definition at line 73 of file Server.cpp.