summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/unittests/mockDevices.cpp
blob: f0ec930ab5b128647eabb41a8b68f4321e8f414d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "mockDevices.h"
#include <mockTuner.h>
#include <Ice/ObjectAdapter.h>

namespace P2PVR {
namespace Testing {
TunerPrx MockDevices::GetTunerSpecific(const DVBSI::DeliveryPtr&, const Ice::Current & ice)
{
	return PrivateTunerPrx::checkedCast(ice.adapter->addWithUUID(new MockTuner()));
}

TunerPrx MockDevices::GetTunerAny(const DVBSI::DeliveryPtr&, const Ice::Current & ice)
{
	return PrivateTunerPrx::checkedCast(ice.adapter->addWithUUID(new MockTuner()));
}

PrivateTunerPrx MockDevices::GetPrivateTuner(Ice::Short, const Ice::Current & ice)
{
	return PrivateTunerPrx::checkedCast(ice.adapter->addWithUUID(new MockTuner()));
}

void MockDevices::ReleaseTuner(const TunerPrx & tuner, const Ice::Current & ice)
{
	ice.adapter->remove(tuner->ice_getIdentity());
}

Ice::Int MockDevices::TunerCount(const Ice::Current&)
{
	return 1;
}
}
}