forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamepad_data_fetcher_manager.h
47 lines (32 loc) · 1.27 KB
/
gamepad_data_fetcher_manager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2016 The Chromium 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 DEVICE_GAMEPAD_GAMEPAD_DATA_FETCHER_MANAGER_H_
#define DEVICE_GAMEPAD_GAMEPAD_DATA_FETCHER_MANAGER_H_
#include <memory>
#include <utility>
#include <vector>
#include "device/gamepad/gamepad_export.h"
#include "device/gamepad/gamepad_provider.h"
namespace device {
class GamepadDataFetcherFactory;
class DEVICE_GAMEPAD_EXPORT GamepadDataFetcherManager {
public:
~GamepadDataFetcherManager();
// Returns the GamepadDataFetcherManager singleton.
static GamepadDataFetcherManager* GetInstance();
void AddFactory(GamepadDataFetcherFactory* factory);
void RemoveSourceFactory(GamepadSource source);
// Must be called on the providers polling thread
void InitializeProvider(GamepadProvider* provider);
void ClearProvider();
private:
GamepadDataFetcherManager();
void CreateDataFetcherFromFactory(GamepadDataFetcherFactory* factory);
void RemoveSourceDataFetcher(GamepadSource* source);
typedef std::vector<GamepadDataFetcherFactory*> FactoryVector;
FactoryVector factories_;
GamepadProvider* provider_;
};
} // namespace device
#endif // DEVICE_GAMEPAD_GAMEPAD_DATA_FETCHER_MANAGER_H_