Skip to content

Commit b370ad0

Browse files
committed
documenting layers and decks
1 parent 1aec0f0 commit b370ad0

File tree

1 file changed

+57
-6
lines changed

1 file changed

+57
-6
lines changed

lib/include/elements/element/layer.hpp

+57-6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@
1111

1212
namespace cycfi::elements
1313
{
14-
////////////////////////////////////////////////////////////////////////////
15-
// Layer
16-
////////////////////////////////////////////////////////////////////////////
14+
/**
15+
* @class layer_element
16+
*
17+
* @brief
18+
* A class which represents an element in a layer. The layer_element is
19+
* a composite that allows groups of elements to be placed in the
20+
* z-axis. Higher-level elements obscure or hide lower-level elements.
21+
*/
1722
class layer_element : public composite_base
1823
{
1924
public:
@@ -32,8 +37,29 @@ namespace cycfi::elements
3237
point _previous_size;
3338
};
3439

40+
/**
41+
* @brief
42+
* `layer_composite` is a composite with indeterminate (dynamic)
43+
* number of elements
44+
*/
3545
using layer_composite = vector_composite<layer_element>;
3646

47+
/**
48+
* @brief
49+
* Create a layer from provided elements. The layer contains group of
50+
* elements placed in z-axis. Higher-level elements obscure or hide
51+
* lower-level elements.
52+
*
53+
* @tparam E
54+
* Variadic template parameter for the types of the elements.
55+
*
56+
* @param elements
57+
* The elements to be added to the layer (a parameter pack).
58+
*
59+
* @return
60+
* A reverse layer composite of the provided elements (top-most element
61+
* last).
62+
*/
3763
template <typename... E>
3864
inline auto layer(E&&... elements)
3965
{
@@ -45,9 +71,14 @@ namespace cycfi::elements
4571
return r;
4672
}
4773

48-
////////////////////////////////////////////////////////////////////////////
49-
// Deck
50-
////////////////////////////////////////////////////////////////////////////
74+
/**
75+
* @class deck_element
76+
*
77+
* @brief
78+
* Represents an element in a deck, which inherits from the
79+
* `layer_element` class. Elements are placed in the z-axis. Unlike
80+
* layers, only the selected element is active (top-most by default).
81+
*/
5182
class deck_element : public layer_element
5283
{
5384
public:
@@ -72,8 +103,28 @@ namespace cycfi::elements
72103
std::size_t _selected_index;
73104
};
74105

106+
/**
107+
* @brief
108+
* `deck_composite` is a composite with indeterminate (dynamic)
109+
* number of elements
110+
*/
75111
using deck_composite = vector_composite<deck_element>;
76112

113+
/**
114+
* @brief
115+
* Create a deck from provided elements. The deck contains a group of
116+
* elements placed in z-axis. Unlike layers, only the selected element
117+
* is active (top-most by default).
118+
*
119+
* @tparam E
120+
* Variadic template parameter for the types of the elements.
121+
*
122+
* @param elements
123+
* The elements to be added to the deck (a parameter pack).
124+
*
125+
* @return
126+
* A deck composite of the provided elements.
127+
*/
77128
template <typename... E>
78129
inline auto deck(E&&... elements)
79130
{

0 commit comments

Comments
 (0)