libzypp: zypp-core/ng/base/autodisconnect.h Source File

libzypp 17.38.14

autodisconnect.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* You have been warned!
12*
13*/
14
15#include <zypp-core/ng/base/Signals>
16
17namespace zyppng
18{
23 struct AutoDisconnect
24 {
25 AutoDisconnect( connection &&conn ) : _conn ( std::move(conn) ) {}
26 AutoDisconnect( AutoDisconnect &&other ) noexcept : _conn ( std::move(other._conn) ) {}
27
28 AutoDisconnect( const AutoDisconnect &other ) = delete;
29 AutoDisconnect & operator=( const AutoDisconnect & ) = delete;
30
31 ~AutoDisconnect( ) { _conn.disconnect(); }
32 connection _conn;
33 };
34
35}
std
Definition ansi.h:855
zyppng
Definition MediaNetworkRequestExecutor.h:16
zyppng::connection
sigc::connection connection
Definition signals.h:180
zyppng::AutoDisconnect::operator=
AutoDisconnect & operator=(const AutoDisconnect &)=delete
zyppng::AutoDisconnect::AutoDisconnect
AutoDisconnect(connection &&conn)
Definition autodisconnect.h:25
zyppng::AutoDisconnect::~AutoDisconnect
~AutoDisconnect()
Definition autodisconnect.h:31
zyppng::AutoDisconnect::AutoDisconnect
AutoDisconnect(AutoDisconnect &&other) noexcept
Definition autodisconnect.h:26
zyppng::AutoDisconnect::AutoDisconnect
AutoDisconnect(const AutoDisconnect &other)=delete
zyppng::AutoDisconnect::_conn
connection _conn
Definition autodisconnect.h:32