shill: Start moving tehnology-specific functionality to capability delegates.
This basic patch demonstrates the intent to move CDMA/GSM-specific functionality
into capability delegates. This should reduce the conditional code in the
Cellular class and make it more readable and easier to maintain.
BUG=chromium-os:18735
TEST=unit tests
Change-Id: I80ee8682ff34810cf4a723119274450de4ae95a9
Reviewed-on: https://gerrit.chromium.org/gerrit/10775
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/cellular_capability.h b/cellular_capability.h
new file mode 100644
index 0000000..32dd661
--- /dev/null
+++ b/cellular_capability.h
@@ -0,0 +1,38 @@
+// 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_CELLULAR_CAPABILITY_
+#define SHILL_CELLULAR_CAPABILITY_
+
+#include <base/basictypes.h>
+
+namespace shill {
+
+class Cellular;
+class ProxyFactory;
+
+// Cellular devices instantiate subclasses of CellularCapability that handle the
+// specific modem technologies and capabilities.
+class CellularCapability {
+ public:
+ // |cellular| is the parent Cellular device.
+ CellularCapability(Cellular *cellular);
+ virtual ~CellularCapability();
+
+ Cellular *cellular() const { return cellular_; }
+ ProxyFactory *proxy_factory() const { return proxy_factory_; }
+
+ // Initialize RPC proxies.
+ virtual void InitProxies() = 0;
+
+ private:
+ Cellular *cellular_;
+ ProxyFactory *proxy_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(CellularCapability);
+};
+
+} // namespace shill
+
+#endif // SHILL_CELLULAR_CAPABILITY_