2
* Copyright © 2015 Canonical Ltd.
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.
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.
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/>.
16
* Authored by: Scott Sweeny <scott.sweeny@canonical.com>
19
#include <com/ubuntu/location/logging.h>
24
#include "delayed_provider.h"
26
namespace location = com::ubuntu::location;
27
namespace dummy = com::ubuntu::location::providers::dummy;
29
std::string dummy::DelayedProvider::class_name()
31
return "dummy::DelayedProvider";
34
location::Provider::Ptr dummy::DelayedProvider::create_instance(const ProviderFactory::Configuration& config)
36
int delay = config.get(dummy::DelayConfiguration::Keys::delay, 0);
37
VLOG(1) << __PRETTY_FUNCTION__ << ": delay for " << delay << "ms";
39
std::this_thread::sleep_for(std::chrono::milliseconds{delay});
41
return dummy::Provider::create_instance(config);