-typedef struct AreaState {
- std::string name;
- std::string category;
- std::string role;
-} AreaState;
-
-typedef std::vector<AreaState> AreaList;
-typedef struct LayoutState {
- std::string name;
- std::map<std::string, int> category_num;
- AreaList area_list;
- std::map<std::string, std::vector<std::string>> role_history;
-} LayoutState;
-
-typedef struct LayerState {
- std::string name;
- LayoutState layout_state;
- int changed;
-} LayerState;
-
-typedef struct CarElement {
- std::string state;
- int changed;
-} CarElement;
-
-struct sd_event* event_loop;
-std::map<int, struct sd_event_source*> event_source_list;
-std::map<int, std::string> g_req_role_list;
-PolicyManager::CallbackTable callback;
-
-std::unordered_map<std::string, CarElement> g_prv_car_elements;
-std::unordered_map<std::string, CarElement> g_crr_car_elements;
-
-std::unordered_map<std::string, LayerState> g_prv_layers;
-std::unordered_map<std::string, LayerState> g_crr_layers;
-
-std::unordered_map<std::string, LayerState> g_prv_layers_car_stop;
-
-std::unordered_map<std::string, LayoutState> g_default_layouts;
+static PolicyManager *g_context;
+
+static int transitionStateWrapper(sd_event_source *source, void *data) {
+ int ret = pm::g_context->transitionState(source, data);
+ return ret;
+}
+
+static int timerEventWrapper(sd_event_source *source, uint64_t usec, void *data) {
+ int ret = pm::g_context->timerEvent(source, usec, data);
+ return ret;
+}
+