-
Notifications
You must be signed in to change notification settings - Fork 1
/
planemanager.h
72 lines (60 loc) · 1.49 KB
/
planemanager.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* Copyright (C) 2018 Microchip Technology Inc. All rights reserved.
* Joshua Henderson <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef PLANEMANAGER_H
#define PLANEMANAGER_H
#include <planes/plane.h>
#include <string>
#include <memory>
#include <vector>
/**
* @brief The PlaneManager class
*
* This is a central manager for planes. It uses libplanes to configure and manage planes.
*
* When using this class, you can choose to use the built in config and/or the engine provided
* by libplanes, or chose not to use it.
*/
class PlaneManager
{
public:
PlaneManager();
/**
* @brief Load a config file to configure the planes.
* @param configfile
* @return
*/
virtual bool load(const std::string& configfile = "screen.config");
/**
* @brief step
*
* Perform an engine step if the engine is to be used.
*/
virtual void step();
/**
* @brief Get a plane by name.
* @param name
* @return
*/
virtual struct plane_data* get(const std::string& name);
/**
* @brief Get a plane by index.
* @param index
* @return
*/
virtual struct plane_data* get(unsigned int index);
virtual ~PlaneManager();
protected:
/**
* @brief The KMS device used to manage planes.
*/
std::shared_ptr<kms_device> m_device;
/**
* @brief List of configured planes based on config file.
*/
std::vector<plane_data*> m_planes;
};
#endif // PLANEMANAGER_H