Music Hub
..
A session-wide music playback service
client_death_observer.h
Go to the documentation of this file.
1
/*
2
* Copyright © 2014 Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by: Thomas Voß <thomas.voss@canonical.com>
17
*/
18
19
#ifndef CORE_UBUNTU_MEDIA_CLIENT_DEATH_OBSERVER_H_
20
#define CORE_UBUNTU_MEDIA_CLIENT_DEATH_OBSERVER_H_
21
22
#include <
core/media/player.h
>
23
24
#include <core/signal.h>
25
26
#include <memory>
27
28
namespace
core
29
{
30
namespace
ubuntu
31
{
32
namespace
media
33
{
34
// Models functionality to be notified whenever a client
35
// of the service goes away, and thus allows us to clean
36
// up in that case.
37
struct
ClientDeathObserver
38
{
39
// To save us some typing.
40
typedef
std::shared_ptr<ClientDeathObserver>
Ptr
;
41
42
ClientDeathObserver
() =
default
;
43
ClientDeathObserver
(
const
ClientDeathObserver
&) =
delete
;
44
virtual
~ClientDeathObserver
() =
default
;
45
46
ClientDeathObserver
&
operator=
(
const
ClientDeathObserver
&) =
delete
;
47
48
// Registers the client with the given key for death notifications.
49
virtual
void
register_for_death_notifications_with_key
(
const
Player::PlayerKey
&) = 0;
50
51
// Emitted whenever a client dies, reporting the key under which the
52
// respective client was known.
53
virtual
const
core::Signal<Player::PlayerKey>&
on_client_with_key_died
()
const
= 0;
54
};
55
56
// Accesses the default client death observer implementation for the platform.
57
ClientDeathObserver::Ptr
platform_default_client_death_observer
();
58
}
59
}
60
}
61
62
#endif // CORE_UBUNTU_MEDIA_CLIENT_DEATH_OBSERVER_H_
core::ubuntu::media::Player::PlayerKey
uint32_t PlayerKey
Definition:
player.h:46
player.h
core
Definition:
player.h:32
core::ubuntu::media::ClientDeathObserver::operator=
ClientDeathObserver & operator=(const ClientDeathObserver &)=delete
core::ubuntu::media::ClientDeathObserver
Definition:
client_death_observer.h:37
core::ubuntu::media::ClientDeathObserver::ClientDeathObserver
ClientDeathObserver()=default
core::ubuntu::media::ClientDeathObserver::Ptr
std::shared_ptr< ClientDeathObserver > Ptr
Definition:
client_death_observer.h:40
core::ubuntu::media::ClientDeathObserver::on_client_with_key_died
virtual const core::Signal< Player::PlayerKey > & on_client_with_key_died() const =0
core::ubuntu::media::ClientDeathObserver::register_for_death_notifications_with_key
virtual void register_for_death_notifications_with_key(const Player::PlayerKey &)=0
core::ubuntu::media
Definition:
player.h:36
core::ubuntu::media::ClientDeathObserver::~ClientDeathObserver
virtual ~ClientDeathObserver()=default
core::ubuntu::media::platform_default_client_death_observer
ClientDeathObserver::Ptr platform_default_client_death_observer()
Definition:
client_death_observer.cpp:35
src
core
media
client_death_observer.h
Generated on Fri Mar 20 2015 13:30:41 for Music Hub by
1.8.9.1