blob: 2dadda95b4511c4ed0ab79162899c23cb10af308 [file] [log] [blame]
Darin Petkovd78ee7e2012-01-12 11:21:10 +01001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masoned7732e42011-05-20 11:08:56 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_ADAPTOR_INTERFACES_H_
6#define SHILL_ADAPTOR_INTERFACES_H_
Chris Masoned7732e42011-05-20 11:08:56 -07007
8#include <string>
mukesh agrawal32399322011-09-01 10:53:43 -07009#include <vector>
Chris Masoned7732e42011-05-20 11:08:56 -070010
Darin Petkov3cfbf212011-11-21 16:02:09 +010011#include "shill/accessor_interface.h"
12
Chris Masoned7732e42011-05-20 11:08:56 -070013namespace shill {
14
Darin Petkove5bc2cb2011-12-07 14:47:32 +010015class Error;
16
Chris Masone4e851612011-07-01 10:46:53 -070017// These are the functions that a Device adaptor must support
18class DeviceAdaptorInterface {
19 public:
20 virtual ~DeviceAdaptorInterface() {}
21
22 // Getter for the opaque identifier that represents this object on the
23 // RPC interface to which the implementation is adapting.
24 virtual const std::string &GetRpcIdentifier() = 0;
25
26 // Getter for the opaque identifier that represents this object's
27 // connection to the RPC interface to which the implementation is adapting.
28 virtual const std::string &GetRpcConnectionIdentifier() = 0;
29
Darin Petkov3cfbf212011-11-21 16:02:09 +010030 virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
Ben Chan7fab8972014-08-10 17:14:46 -070031 virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0;
32 virtual void EmitUint16Changed(const std::string &name, uint16_t value) = 0;
Darin Petkov3cfbf212011-11-21 16:02:09 +010033 virtual void EmitIntChanged(const std::string &name, int value) = 0;
34 virtual void EmitStringChanged(const std::string &name,
35 const std::string &value) = 0;
Prathmesh Prabhu9f06c872013-11-21 14:08:23 -080036 virtual void EmitStringmapChanged(const std::string &name,
37 const Stringmap &value) = 0;
Darin Petkov3cfbf212011-11-21 16:02:09 +010038 virtual void EmitStringmapsChanged(const std::string &name,
39 const Stringmaps &value) = 0;
Prathmesh Prabhu700ff4d2014-01-16 15:59:33 -080040 virtual void EmitStringsChanged(const std::string &name,
41 const Strings &value) = 0;
Darin Petkov63138a92012-02-06 14:09:15 +010042 virtual void EmitKeyValueStoreChanged(const std::string &name,
43 const KeyValueStore &value) = 0;
Paul Stewartd4f26482014-04-25 19:12:03 -070044 virtual void EmitRpcIdentifierArrayChanged(
45 const std::string &name, const std::vector<std::string> &value) = 0;
Chris Masone4e851612011-07-01 10:46:53 -070046};
47
48// These are the functions that an IPConfig adaptor must support
49class IPConfigAdaptorInterface {
50 public:
51 virtual ~IPConfigAdaptorInterface() {}
52
53 // Getter for the opaque identifier that represents this object on the
54 // RPC interface to which the implementation is adapting.
55 virtual const std::string &GetRpcIdentifier() = 0;
56
Gaurav Shah435de2c2011-11-17 19:01:07 -080057 virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
Ben Chan7fab8972014-08-10 17:14:46 -070058 virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0;
Gaurav Shah435de2c2011-11-17 19:01:07 -080059 virtual void EmitIntChanged(const std::string &name, int value) = 0;
60 virtual void EmitStringChanged(const std::string &name,
61 const std::string &value) = 0;
mukesh agrawal7aed61c2013-04-22 16:01:24 -070062 virtual void EmitStringsChanged(const std::string &name,
63 const std::vector<std::string> &value) = 0;
Chris Masone4e851612011-07-01 10:46:53 -070064};
65
Chris Masoned7732e42011-05-20 11:08:56 -070066// These are the functions that a Manager adaptor must support
67class ManagerAdaptorInterface {
68 public:
Chris Masoned7732e42011-05-20 11:08:56 -070069 virtual ~ManagerAdaptorInterface() {}
Chris Masone95207da2011-06-29 16:50:49 -070070
71 // Getter for the opaque identifier that represents this object on the
72 // RPC interface to which the implementation is adapting.
73 virtual const std::string &GetRpcIdentifier() = 0;
74
Chris Masoned0ceb8c2011-06-02 10:05:39 -070075 virtual void UpdateRunning() = 0;
76
Gaurav Shah435de2c2011-11-17 19:01:07 -080077 virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
Ben Chan7fab8972014-08-10 17:14:46 -070078 virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0;
Gaurav Shah435de2c2011-11-17 19:01:07 -080079 virtual void EmitIntChanged(const std::string &name, int value) = 0;
80 virtual void EmitStringChanged(const std::string &name,
81 const std::string &value) = 0;
82 virtual void EmitStringsChanged(const std::string &name,
83 const std::vector<std::string> &value) = 0;
Paul Stewart49739c02012-08-08 17:24:03 -070084 virtual void EmitRpcIdentifierChanged(
85 const std::string &name,
86 const std::string &value) = 0;
mukesh agrawal32399322011-09-01 10:53:43 -070087 virtual void EmitRpcIdentifierArrayChanged(
88 const std::string &name,
89 const std::vector<std::string> &value) = 0;
Chris Masoned0ceb8c2011-06-02 10:05:39 -070090
Gaurav Shah435de2c2011-11-17 19:01:07 -080091 virtual void EmitStateChanged(const std::string &new_state) = 0;
Chris Masoned7732e42011-05-20 11:08:56 -070092};
93
Chris Masone52cd19b2011-06-29 17:23:04 -070094// These are the functions that a Profile adaptor must support
95class ProfileAdaptorInterface {
96 public:
97 virtual ~ProfileAdaptorInterface() {}
98
Chris Masonec6c6c132011-06-30 11:29:52 -070099 // Getter for the opaque identifier that represents this object on the
100 // RPC interface to which the implementation is adapting.
101 virtual const std::string &GetRpcIdentifier() = 0;
102
Gaurav Shah435de2c2011-11-17 19:01:07 -0800103 virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
Ben Chan7fab8972014-08-10 17:14:46 -0700104 virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0;
Gaurav Shah435de2c2011-11-17 19:01:07 -0800105 virtual void EmitIntChanged(const std::string &name, int value) = 0;
106 virtual void EmitStringChanged(const std::string &name,
107 const std::string &value) = 0;
Chris Masonec6c6c132011-06-30 11:29:52 -0700108};
109
Darin Petkova9b1fed2012-02-29 11:49:05 +0100110// These are the functions that a RPCTask adaptor must support.
111class RPCTaskAdaptorInterface {
112 public:
113 virtual ~RPCTaskAdaptorInterface() {}
114
115 // Getter for the opaque identifier that represents this object on the
116 // RPC interface to which the implementation is adapting.
117 virtual const std::string &GetRpcIdentifier() = 0;
118
119 virtual const std::string &GetRpcInterfaceIdentifier() = 0;
120
121 // Getter for the opaque identifier that represents this object's
122 // connection to the RPC interface to which the implementation is adapting.
123 virtual const std::string &GetRpcConnectionIdentifier() = 0;
124};
125
Chris Masone4e851612011-07-01 10:46:53 -0700126// These are the functions that a Service adaptor must support
127class ServiceAdaptorInterface {
Chris Masonec6c6c132011-06-30 11:29:52 -0700128 public:
Chris Masone4e851612011-07-01 10:46:53 -0700129 virtual ~ServiceAdaptorInterface() {}
Chris Masonec6c6c132011-06-30 11:29:52 -0700130
131 // Getter for the opaque identifier that represents this object on the
132 // RPC interface to which the implementation is adapting.
133 virtual const std::string &GetRpcIdentifier() = 0;
134
Chris Masone4e851612011-07-01 10:46:53 -0700135 virtual void UpdateConnected() = 0;
136
Gaurav Shah435de2c2011-11-17 19:01:07 -0800137 virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
Ben Chan7fab8972014-08-10 17:14:46 -0700138 virtual void EmitUint8Changed(const std::string &name, uint8_t value) = 0;
139 virtual void EmitUint16Changed(const std::string &name, uint16_t value) = 0;
mukesh agrawale7c7e652013-06-18 17:19:39 -0700140 virtual void EmitUint16sChanged(const std::string &name,
141 const Uint16s &value) = 0;
Ben Chan7fab8972014-08-10 17:14:46 -0700142 virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0;
Gaurav Shah435de2c2011-11-17 19:01:07 -0800143 virtual void EmitIntChanged(const std::string &name, int value) = 0;
Paul Stewart1e3bc4962012-09-14 12:20:22 -0700144 virtual void EmitRpcIdentifierChanged(const std::string &name,
145 const std::string &value) = 0;
Gaurav Shah435de2c2011-11-17 19:01:07 -0800146 virtual void EmitStringChanged(const std::string &name,
147 const std::string &value) = 0;
Darin Petkov9cb02682012-01-28 00:17:38 +0100148 virtual void EmitStringmapChanged(const std::string &name,
149 const Stringmap &value) = 0;
Chris Masone52cd19b2011-06-29 17:23:04 -0700150};
151
Chris Masoned7732e42011-05-20 11:08:56 -0700152} // namespace shill
Ben Chanc45688b2014-07-02 23:50:45 -0700153
154#endif // SHILL_ADAPTOR_INTERFACES_H_