1 //
2 // Copyright (C) 2014 The Android Open Source Project
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef UPDATE_ENGINE_UPDATE_MANAGER_STATE_H_
18 #define UPDATE_ENGINE_UPDATE_MANAGER_STATE_H_
19 
20 #include "update_engine/update_manager/config_provider.h"
21 #include "update_engine/update_manager/device_policy_provider.h"
22 #include "update_engine/update_manager/random_provider.h"
23 #include "update_engine/update_manager/shill_provider.h"
24 #include "update_engine/update_manager/system_provider.h"
25 #include "update_engine/update_manager/time_provider.h"
26 #include "update_engine/update_manager/updater_provider.h"
27 
28 namespace chromeos_update_manager {
29 
30 // The State class is an interface to the ensemble of providers. This class
31 // gives visibility of the state providers to policy implementations.
32 class State {
33  public:
34   virtual ~State() {}
35 
36   // These methods return the given provider.
37   virtual ConfigProvider* config_provider() = 0;
38   virtual DevicePolicyProvider* device_policy_provider() = 0;
39   virtual RandomProvider* random_provider() = 0;
40   virtual ShillProvider* shill_provider() = 0;
41   virtual SystemProvider* system_provider() = 0;
42   virtual TimeProvider* time_provider() = 0;
43   virtual UpdaterProvider* updater_provider() = 0;
44 
45  protected:
46   State() {}
47 
48  private:
49   DISALLOW_COPY_AND_ASSIGN(State);
50 };
51 
52 }  // namespace chromeos_update_manager
53 
54 #endif  // UPDATE_ENGINE_UPDATE_MANAGER_STATE_H_
55