adaptor_interfaces.h revision e7c7e65bba9e964aa500ef53cc79215426acf50c
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 virtual void EmitStringsChanged(const std::string &name, 60 const std::vector<std::string> &value) = 0; 61}; 62 63// These are the functions that a Manager adaptor must support 64class ManagerAdaptorInterface { 65 public: 66 virtual ~ManagerAdaptorInterface() {} 67 68 // Getter for the opaque identifier that represents this object on the 69 // RPC interface to which the implementation is adapting. 70 virtual const std::string &GetRpcIdentifier() = 0; 71 72 virtual void UpdateRunning() = 0; 73 74 virtual void EmitBoolChanged(const std::string &name, bool value) = 0; 75 virtual void EmitUintChanged(const std::string &name, uint32 value) = 0; 76 virtual void EmitIntChanged(const std::string &name, int value) = 0; 77 virtual void EmitStringChanged(const std::string &name, 78 const std::string &value) = 0; 79 virtual void EmitStringsChanged(const std::string &name, 80 const std::vector<std::string> &value) = 0; 81 virtual void EmitRpcIdentifierChanged( 82 const std::string &name, 83 const std::string &value) = 0; 84 virtual void EmitRpcIdentifierArrayChanged( 85 const std::string &name, 86 const std::vector<std::string> &value) = 0; 87 88 virtual void EmitStateChanged(const std::string &new_state) = 0; 89}; 90 91// These are the functions that a Profile adaptor must support 92class ProfileAdaptorInterface { 93 public: 94 virtual ~ProfileAdaptorInterface() {} 95 96 // Getter for the opaque identifier that represents this object on the 97 // RPC interface to which the implementation is adapting. 98 virtual const std::string &GetRpcIdentifier() = 0; 99 100 virtual void EmitBoolChanged(const std::string &name, bool value) = 0; 101 virtual void EmitUintChanged(const std::string &name, uint32 value) = 0; 102 virtual void EmitIntChanged(const std::string &name, int value) = 0; 103 virtual void EmitStringChanged(const std::string &name, 104 const std::string &value) = 0; 105}; 106 107// These are the functions that a RPCTask adaptor must support. 108class RPCTaskAdaptorInterface { 109 public: 110 virtual ~RPCTaskAdaptorInterface() {} 111 112 // Getter for the opaque identifier that represents this object on the 113 // RPC interface to which the implementation is adapting. 114 virtual const std::string &GetRpcIdentifier() = 0; 115 116 virtual const std::string &GetRpcInterfaceIdentifier() = 0; 117 118 // Getter for the opaque identifier that represents this object's 119 // connection to the RPC interface to which the implementation is adapting. 120 virtual const std::string &GetRpcConnectionIdentifier() = 0; 121}; 122 123// These are the functions that a Service adaptor must support 124class ServiceAdaptorInterface { 125 public: 126 virtual ~ServiceAdaptorInterface() {} 127 128 // Getter for the opaque identifier that represents this object on the 129 // RPC interface to which the implementation is adapting. 130 virtual const std::string &GetRpcIdentifier() = 0; 131 132 virtual void UpdateConnected() = 0; 133 134 virtual void EmitBoolChanged(const std::string &name, bool value) = 0; 135 virtual void EmitUint8Changed(const std::string &name, uint8 value) = 0; 136 virtual void EmitUint16Changed(const std::string &name, uint16 value) = 0; 137 virtual void EmitUint16sChanged(const std::string &name, 138 const Uint16s &value) = 0; 139 virtual void EmitUintChanged(const std::string &name, uint32 value) = 0; 140 virtual void EmitIntChanged(const std::string &name, int value) = 0; 141 virtual void EmitRpcIdentifierChanged(const std::string &name, 142 const std::string &value) = 0; 143 virtual void EmitStringChanged(const std::string &name, 144 const std::string &value) = 0; 145 virtual void EmitStringmapChanged(const std::string &name, 146 const Stringmap &value) = 0; 147}; 148 149} // namespace shill 150#endif // SHILL_ADAPTOR_INTERFACES_ 151