[shill] Begin wiring SetProperty
Create a PropertyStoreInterface that can be implemented by Device,
Service, Manager, etc to handle getting/setting of properties. The
various DBusAdaptor subclasses can dispatch incoming calls to their
associated implementation object based on the names of the properties
and/or the types of the arguments.
BUG=chromium-os:16343
TEST=unit tests
Change-Id: If7abb0ffa623e59288943b4ed1f49832a92524ea
Reviewed-on: http://gerrit.chromium.org/gerrit/2408
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/error.h b/error.h
new file mode 100644
index 0000000..6548467
--- /dev/null
+++ b/error.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 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_ERROR_
+#define SHILL_ERROR_
+
+#include <string>
+
+#include <base/basictypes.h>
+
+namespace DBus {
+class Error;
+} // namespace DBus
+
+namespace shill {
+
+class Error {
+ public:
+ enum Type {
+ kAlreadyExists,
+ kInProgress,
+ kInternalError,
+ kInvalidArguments,
+ kInvalidNetworkName,
+ kInvalidPassphrase,
+ kInvalidProperty,
+ kNotFound,
+ kNotSupported,
+ kPermissionDenied,
+ kPinError,
+ kNumErrors
+ };
+
+ Error(Type type, const std::string& message);
+ virtual ~Error();
+
+ void Populate(Type type, const std::string& message);
+
+ void ToDBusError(::DBus::Error *error);
+
+ private:
+ static const char * const kErrorNames[kNumErrors];
+
+ Type type_;
+ std::string message_;
+
+ DISALLOW_COPY_AND_ASSIGN(Error);
+};
+
+} // namespace shill
+
+#endif // SHILL_ERROR_