mukesh agrawal | 0414747 | 2015-08-18 13:25:28 -0700 | [diff] [blame^] | 1 | // Copyright 2015 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_STORE_FACTORY_H_ |
| 6 | #define SHILL_STORE_FACTORY_H_ |
| 7 | |
| 8 | #include <base/lazy_instance.h> |
| 9 | |
| 10 | namespace shill { |
| 11 | |
| 12 | class GLib; |
| 13 | class StoreInterface; |
| 14 | |
| 15 | class StoreFactory { |
| 16 | public: |
| 17 | // This is a singleton. Use StoreFactory::GetInstance()->Foo(). |
| 18 | static StoreFactory* GetInstance(); |
| 19 | |
| 20 | void set_glib(GLib* glib) { glib_ = glib; } |
| 21 | StoreInterface* CreateStore(); |
| 22 | |
| 23 | protected: |
| 24 | StoreFactory(); |
| 25 | |
| 26 | private: |
| 27 | friend struct base::DefaultLazyInstanceTraits<StoreFactory>; |
| 28 | GLib *glib_; |
| 29 | |
| 30 | DISALLOW_COPY_AND_ASSIGN(StoreFactory); |
| 31 | }; |
| 32 | |
| 33 | } // namespace shill |
| 34 | |
| 35 | #endif // SHILL_STORE_FACTORY_H_ |