blob: 5096c7562e98683f7b339b2fbaf52cdc998ba5eb [file] [log] [blame]
Darin Petkova9b1fed2012-02-29 11:49:05 +01001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_RPC_TASK_DBUS_ADAPTOR_H_
6#define SHILL_RPC_TASK_DBUS_ADAPTOR_H_
7
8#include <base/basictypes.h>
9
10#include "shill/adaptor_interfaces.h"
11#include "shill/dbus_adaptor.h"
12#include "shill/dbus_bindings/flimflam-task.h"
13
14namespace shill {
15
16class RPCTask;
17
18// Subclass of DBusAdaptor for RPCTask objects. There is a 1:1 mapping between
19// RPCTask and RPCTaskDBusAdaptor instances. Furthermore, the RPCTask owns the
20// RPCTaskDBusAdaptor and manages its lifetime, so we're OK with
21// RPCTaskDBusAdaptor having a bare pointer to its owner task.
22class RPCTaskDBusAdaptor : public org::chromium::flimflam::Task_adaptor,
23 public DBusAdaptor,
24 public RPCTaskAdaptorInterface {
25 public:
Darin Petkova9b1fed2012-02-29 11:49:05 +010026 static const char kPath[];
27
28 RPCTaskDBusAdaptor(DBus::Connection *conn, RPCTask *task);
29 virtual ~RPCTaskDBusAdaptor();
30
31 // Implementation of RPCTaskAdaptorInterface.
32 virtual const std::string &GetRpcIdentifier();
33 virtual const std::string &GetRpcInterfaceIdentifier();
34 virtual const std::string &GetRpcConnectionIdentifier();
35
36 // Implementation of Task_adaptor
Darin Petkov209e6292012-04-20 11:33:32 +020037 virtual void getsec(
38 std::string &user, std::string &password, DBus::Error &error);
Darin Petkova9b1fed2012-02-29 11:49:05 +010039 virtual void notify(const std::string &reason,
40 const std::map<std::string, std::string> &dict,
41 DBus::Error &error);
42
43 private:
44 RPCTask *task_;
45 const std::string interface_name_;
46 const std::string connection_name_;
47
48 DISALLOW_COPY_AND_ASSIGN(RPCTaskDBusAdaptor);
49};
50
51} // namespace shill
52
53#endif // SHILL_RPC_TASK_DBUS_ADAPTOR_H_