Audacity 3.2.0
|
RAII-style socket wrapper. Since socket is closed on wrapper destruction, initializing multiple guards with same(valid) socket descriptor is considered UB. For same reason wrapper isn't copyable. More...
#include <socket_guard.h>
Public Member Functions | |
socket_guard (const socket_guard &)=delete | |
socket_guard & | operator= (const socket_guard &)=delete |
socket_guard (SOCKET sock=INVALID_SOCKET) noexcept | |
socket_guard (socket_guard &&rhs) noexcept | |
operator bool () const noexcept | |
socket_guard & | operator= (socket_guard &&rhs) noexcept |
SOCKET | operator* () const noexcept |
Alias for socket_guard::get. More... | |
SOCKET | get () const noexcept |
SOCKET | release () noexcept |
Returns the socket descriptor and releases ownership. More... | |
void | reset () noexcept |
Closes the socket. More... | |
~socket_guard () noexcept | |
Private Attributes | |
SOCKET | mSocket {INVALID_SOCKET} |
RAII-style socket wrapper. Since socket is closed on wrapper destruction, initializing multiple guards with same(valid) socket descriptor is considered UB. For same reason wrapper isn't copyable.
Definition at line 23 of file socket_guard.h.
|
explicitdelete |
|
inlineexplicitnoexcept |
Definition at line 30 of file socket_guard.h.
|
inlineexplicitnoexcept |
|
inlinenoexcept |
Definition at line 80 of file socket_guard.h.
References reset().
|
inlinenoexcept |
Definition at line 60 of file socket_guard.h.
References mSocket.
|
inlineexplicitnoexcept |
Definition at line 38 of file socket_guard.h.
References INVALID_SOCKET, and mSocket.
|
inlinenoexcept |
|
delete |
|
inlinenoexcept |
Definition at line 43 of file socket_guard.h.
References INVALID_SOCKET, mSocket, and anonymous_namespace{NoteTrack.cpp}::swap().
|
inlinenoexcept |
Returns the socket descriptor and releases ownership.
Definition at line 63 of file socket_guard.h.
References INVALID_SOCKET, mSocket, SOCKET, and anonymous_namespace{NoteTrack.cpp}::swap().
Referenced by IPCServer::Impl::Impl().
|
inlinenoexcept |
Closes the socket.
Definition at line 71 of file socket_guard.h.
References CLOSE_SOCKET, INVALID_SOCKET, and mSocket.
Referenced by IPCServer::Impl::Impl(), IPCServer::Impl::~Impl(), and ~socket_guard().
|
private |
Definition at line 25 of file socket_guard.h.
Referenced by get(), operator bool(), operator*(), operator=(), release(), and reset().