BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
component.hpp
1#pragma once
2#include <bugui/concepts/device.hpp>
3#include <bugui/concepts/color.hpp>
4#include <bugui/concepts/protocol.hpp>
5
6namespace bugui
7{
8// Color
11template <typename Device, typename Component>
12struct color_t final
13{
14 using type = void;
15};
16
20template <typename Device, typename Component>
23{
24 using type = class Device::color;
25};
26
29template <typename Device, has_color Component>
30struct color_t<Device, Component> final
31{
32 using type = class Component::color;
33};
34
35// protocol
39template <typename Device, typename Component>
40struct protocol_t final
41{
42 using type = Device;
43};
44
47template <typename Device, has_protocol Component>
48struct protocol_t<Device, Component> final
49{
50 using type = Component;
51};
52
53// clear
55template <typename Device, typename Component>
56struct clear_t;
57
61template <has_clear Device, typename Component>
62 requires (!has_clear<Component>)
64{
65 using type = class Device::clear;
66};
67
70template <typename Device, has_clear Component>
71struct clear_t<Device, Component> final
72{
73 using type = class Component::clear;
74};
75
76// init
79template <typename Device, typename Component>
80 requires (has_init<Device> || !has_init<Component>)
81struct init_t final
82{
83 using type = class Component::init;
84};
85
89template <typename Device, typename Component>
92{
93 using type = class Device::init;
94};
95
96// component
98template <typename Device, typename Component>
99struct component;
100
101// template <typename Device, typename Component>
102// struct component final
103// {
104// using color_t = color_t<Device, Component>::type;
105// using protocol_t = protocol_t<Device, Component>::type;
106// using init_t = init_t<Device, Component>::type;
107// using clear_t = clear_t<Device, Component>::type;
108// };
109
110} // namespace bugui
Definition device.hpp:41
Definition color.hpp:10
Definition device.hpp:34
Primary template. To be specialized.
Definition component.hpp:56
Primary template for a Device and a Component that do not feature a color nested type.
Definition component.hpp:13
Primary template. To be specialized.
Definition component.hpp:99
Provides a type alias for the init nested type of the Component.
Definition component.hpp:82
Primary template providing a type alias for the Device only if the Component type does not feature a ...
Definition component.hpp:41