-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonitor_setup.h
More file actions
43 lines (33 loc) · 954 Bytes
/
monitor_setup.h
File metadata and controls
43 lines (33 loc) · 954 Bytes
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
#ifndef MONITOR_SETUP_H_
#define MONITOR_SETUP_H_
#include <vector>
#include <string>
#include <algorithm>
#include "edid.h"
namespace schrandr {
class MonitorSetup {
public:
std::string print_setup();
void add_edid(Edid e);
std::vector<Edid> get_edids()const;
private:
std::vector<Edid> edids_;
};
inline bool operator==(const MonitorSetup& lhs, const MonitorSetup& rhs)
{
auto copyL = lhs.get_edids();
auto copyR = rhs.get_edids();
std::sort(copyL.begin(), copyL.end());
std::sort(copyR.begin(), copyR.end());
return (copyL == copyR);
};
inline bool operator!=(const MonitorSetup& lhs, const MonitorSetup& rhs)
{
return !operator==(lhs,rhs);
};
inline bool operator<(const MonitorSetup &lhs, const MonitorSetup &rhs)
{
return (lhs.get_edids() < rhs.get_edids());
}
}
#endif