~ci-train-bot/media-hub/media-hub-ubuntu-yakkety-1823

« back to all changes in this revision

Viewing changes to src/com/ubuntu/music/connection.cpp

  • Committer: Thomas Voß
  • Date: 2013-08-13 14:07:37 UTC
  • Revision ID: thomas.voss@canonical.com-20130813140737-ke081xhuotug54hd
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2013 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
#include "com/ubuntu/music/connection.h"
 
20
 
 
21
#include "connection_private.h"
 
22
 
 
23
#include <functional>
 
24
#include <memory>
 
25
 
 
26
namespace music = com::ubuntu::music;
 
27
 
 
28
music::Connection::Connection(const std::shared_ptr<music::Connection::Private>& p) : d(p)
 
29
{
 
30
}
 
31
 
 
32
music::Connection::Connection(const music::Connection& rhs) : d(rhs.d)
 
33
{
 
34
}
 
35
    
 
36
music::Connection::~Connection()
 
37
{
 
38
}
 
39
 
 
40
music::Connection& music::Connection::operator=(const music::Connection& rhs)
 
41
{
 
42
    d = rhs.d;
 
43
    return *this;
 
44
}
 
45
 
 
46
bool music::Connection::operator==(const music::Connection& rhs) const
 
47
{
 
48
    return d == rhs.d;
 
49
}
 
50
 
 
51
bool music::Connection::is_connected() const
 
52
{
 
53
    return d->connection.connected();
 
54
}
 
55
 
 
56
void music::Connection::disconnect()
 
57
{
 
58
    d->connection.disconnect();
 
59
}