adaptor_interfaces.h revision 49739c08a76187fae6494c61e960eec315960715
1// 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_ADAPTOR_INTERFACES_
6#define SHILL_ADAPTOR_INTERFACES_
7
8#include <string>
9#include <vector>
10
11#include <base/basictypes.h>
12
13#include "shill/accessor_interface.h"
14
15namespace shill {
16
17class Error;
18
19// These are the functions that a Device adaptor must support
20class DeviceAdaptorInterface {
21 public:
22  virtual ~DeviceAdaptorInterface() {}
23
24  // Getter for the opaque identifier that represents this object on the
25  // RPC interface to which the implementation is adapting.
26  virtual const std::string &GetRpcIdentifier() = 0;
27
28  // Getter for the opaque identifier that represents this object's
29  // connection to the RPC interface to which the implementation is adapting.
30  virtual const std::string &GetRpcConnectionIdentifier() = 0;
31
32  virtual void UpdateEnabled() = 0;
33
34  virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
35  virtual void EmitUintChanged(const std::string &name, uint32 value) = 0;
36  virtual void EmitIntChanged(const std::string &name, int value) = 0;
37  virtual void EmitStringChanged(const std::string &name,
38                                 const std::string &value) = 0;
39  virtual void EmitStringmapsChanged(const std::string &name,
40                                     const Stringmaps &value) = 0;
41  virtual void EmitKeyValueStoreChanged(const std::string &name,
42                                        const KeyValueStore &value) = 0;
43};
44
45// These are the functions that an IPConfig adaptor must support
46class IPConfigAdaptorInterface {
47 public:
48  virtual ~IPConfigAdaptorInterface() {}
49
50  // Getter for the opaque identifier that represents this object on the
51  // RPC interface to which the implementation is adapting.
52  virtual const std::string &GetRpcIdentifier() = 0;
53
54  virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
55  virtual void EmitUintChanged(const std::string &name, uint32 value) = 0;
56  virtual void EmitIntChanged(const std::string &name, int value) = 0;
57  virtual void EmitStringChanged(const std::string &name,
58                                 const std::string &value) = 0;
59};
60
61// These are the functions that a Manager adaptor must support
62class ManagerAdaptorInterface {
63 public:
64  virtual ~ManagerAdaptorInterface() {}
65
66  // Getter for the opaque identifier that represents this object on the
67  // RPC interface to which the implementation is adapting.
68  virtual const std::string &GetRpcIdentifier() = 0;
69
70  virtual void UpdateRunning() = 0;
71
72  virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
73  virtual void EmitUintChanged(const std::string &name, uint32 value) = 0;
74  virtual void EmitIntChanged(const std::string &name, int value) = 0;
75  virtual void EmitStringChanged(const std::string &name,
76                                 const std::string &value) = 0;
77  virtual void EmitStringsChanged(const std::string &name,
78                                  const std::vector<std::string> &value) = 0;
79  virtual void EmitRpcIdentifierChanged(
80      const std::string &name,
81      const std::string &value) = 0;
82  virtual void EmitRpcIdentifierArrayChanged(
83      const std::string &name,
84      const std::vector<std::string> &value) = 0;
85
86  virtual void EmitStateChanged(const std::string &new_state) = 0;
87};
88
89// These are the functions that a Profile adaptor must support
90class ProfileAdaptorInterface {
91 public:
92  virtual ~ProfileAdaptorInterface() {}
93
94  // Getter for the opaque identifier that represents this object on the
95  // RPC interface to which the implementation is adapting.
96  virtual const std::string &GetRpcIdentifier() = 0;
97
98  virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
99  virtual void EmitUintChanged(const std::string &name, uint32 value) = 0;
100  virtual void EmitIntChanged(const std::string &name, int value) = 0;
101  virtual void EmitStringChanged(const std::string &name,
102                                 const std::string &value) = 0;
103};
104
105// These are the functions that a RPCTask adaptor must support.
106class RPCTaskAdaptorInterface {
107 public:
108  virtual ~RPCTaskAdaptorInterface() {}
109
110  // Getter for the opaque identifier that represents this object on the
111  // RPC interface to which the implementation is adapting.
112  virtual const std::string &GetRpcIdentifier() = 0;
113
114  virtual const std::string &GetRpcInterfaceIdentifier() = 0;
115
116  // Getter for the opaque identifier that represents this object's
117  // connection to the RPC interface to which the implementation is adapting.
118  virtual const std::string &GetRpcConnectionIdentifier() = 0;
119};
120
121// These are the functions that a Service adaptor must support
122class ServiceAdaptorInterface {
123 public:
124  virtual ~ServiceAdaptorInterface() {}
125
126  // Getter for the opaque identifier that represents this object on the
127  // RPC interface to which the implementation is adapting.
128  virtual const std::string &GetRpcIdentifier() = 0;
129
130  virtual void UpdateConnected() = 0;
131
132  virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
133  virtual void EmitUint8Changed(const std::string &name, uint8 value) = 0;
134  virtual void EmitUint16Changed(const std::string &name, uint16 value) = 0;
135  virtual void EmitUintChanged(const std::string &name, uint32 value) = 0;
136  virtual void EmitIntChanged(const std::string &name, int value) = 0;
137  virtual void EmitStringChanged(const std::string &name,
138                                 const std::string &value) = 0;
139  virtual void EmitStringmapChanged(const std::string &name,
140                                    const Stringmap &value) = 0;
141};
142
143}  // namespace shill
144#endif  // SHILL_ADAPTOR_INTERFACES_
145