blob: 2b03faab36c3a8a37b6c93a1f556b6b7891131c6 [file] [log] [blame]
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SHILL_DBUS_DBUS_SERVICE_WATCHER_FACTORY_H_
#define SHILL_DBUS_DBUS_SERVICE_WATCHER_FACTORY_H_
#include <memory>
#include <string>
#include <base/callback.h>
#include <base/macros.h>
#include <base/no_destructor.h>
#include <dbus/bus.h>
namespace shill {
class DBusServiceWatcher;
class DBusServiceWatcherFactory {
public:
virtual ~DBusServiceWatcherFactory();
// This is a singleton. Use DBusServiceWatcherFactory::GetInstance()->Foo().
static DBusServiceWatcherFactory* GetInstance();
virtual std::unique_ptr<DBusServiceWatcher> CreateDBusServiceWatcher(
scoped_refptr<dbus::Bus> bus,
const std::string& connection_name,
const base::Closure& on_connection_vanish);
protected:
DBusServiceWatcherFactory();
private:
friend class base::NoDestructor<DBusServiceWatcherFactory>;
DISALLOW_COPY_AND_ASSIGN(DBusServiceWatcherFactory);
};
} // namespace shill
#endif // SHILL_DBUS_DBUS_SERVICE_WATCHER_FACTORY_H_