summaryrefslogtreecommitdiff
path: root/src/bindings/eina_cxx/eina_integer_sequence.hh
diff options
context:
space:
mode:
authorvitor.sousa <vitorsousasilva@gmail.com>2014-06-04 22:34:42 +0200
committerCedric BAIL <c.bail@partner.samsung.com>2014-06-04 22:34:47 +0200
commit0902b6a6f8ce10aefc9c19d455fd5c176e2bd53a (patch)
tree33d4493ae8d0519886bbb7c487a88fafbef8ce59 /src/bindings/eina_cxx/eina_integer_sequence.hh
parent5e7a9b1225f792a6a7e60e96cf402440ad1adfff (diff)
eina_cxx: add documentation to the Eina C++ header files.
Summary: Added documentation to almost all classes that are intended for direct use by the library users. Marked classes/functions used by the library itself as @internal. Modified the Doxyfile.in to enable the generation of documentation to the bindings. Reviewers: felipealmeida, cedric, woohyun, smohanty, raster CC: savio, cedric Differential Revision: https://phab.enlightenment.org/D947 Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
Diffstat (limited to 'src/bindings/eina_cxx/eina_integer_sequence.hh')
-rw-r--r--src/bindings/eina_cxx/eina_integer_sequence.hh46
1 files changed, 44 insertions, 2 deletions
diff --git a/src/bindings/eina_cxx/eina_integer_sequence.hh b/src/bindings/eina_cxx/eina_integer_sequence.hh
index 4ec1762..b1f98a0 100644
--- a/src/bindings/eina_cxx/eina_integer_sequence.hh
+++ b/src/bindings/eina_cxx/eina_integer_sequence.hh
@@ -1,18 +1,42 @@
1#ifndef EINA_CXX_EINA_INTEGER_SEQUENCE_HH 1#ifndef EINA_CXX_EINA_INTEGER_SEQUENCE_HH
2#define EINA_CXX_EINA_INTEGER_SEQUENCE_HH 2#define EINA_CXX_EINA_INTEGER_SEQUENCE_HH
3 3
4/**
5 * @addtogroup Eina_Cxx_Data_Types_Group
6 *
7 * @{
8 */
9
4namespace efl { namespace eina { 10namespace efl { namespace eina {
5 11
12/**
13 * @defgroup Eina_Cxx_Integer_Sequence_Group Integer Sequence
14 * @ingroup Eina_Cxx_Data_Types_Group
15 *
16 * @{
17 */
18
19/**
20 * Compile-time sequence of integers.
21 */
6template <typename T, T... Ints> 22template <typename T, T... Ints>
7struct integer_sequence 23struct integer_sequence
8{ 24{
9 typedef T value_type; 25 typedef T value_type; /**< Type of the integers. */
26
27 /**
28 * @brief Get the number of elements in the sequence.
29 * @return <tt>std::size_t</tt> representing the sequence size.
30 */
10 static constexpr std::size_t size() { return sizeof...(Ints); } 31 static constexpr std::size_t size() { return sizeof...(Ints); }
11 typedef integer_sequence<T, Ints...> type; 32 typedef integer_sequence<T, Ints...> type; /**< Type for the sequence instantiation. */
12}; 33};
13 34
14template<class S1, class S2> struct concat; 35template<class S1, class S2> struct concat;
15 36
37/**
38 * Compile-time concatenation of two integer sequences.
39 */
16template<typename T, T... I1, T... I2> 40template<typename T, T... I1, T... I2>
17struct concat<integer_sequence<T, I1...>, integer_sequence<T, I2...> > 41struct concat<integer_sequence<T, I1...>, integer_sequence<T, I2...> >
18 : integer_sequence<T, I1..., (sizeof...(I1)+I2)...> {}; 42 : integer_sequence<T, I1..., (sizeof...(I1)+I2)...> {};
@@ -21,6 +45,10 @@ template<class S1, class S2>
21using Concat = typename concat<S1, S2>::type; 45using Concat = typename concat<S1, S2>::type;
22 46
23template<typename T, T N> struct gen_seq; 47template<typename T, T N> struct gen_seq;
48
49/**
50 * Make a compile time sequence of integers from @c 0 to <tt>N-1</tt>.
51 */
24template<typename T, T N> using make_integer_sequence = typename gen_seq<T, N>::type; 52template<typename T, T N> using make_integer_sequence = typename gen_seq<T, N>::type;
25 53
26template<typename T, T N> 54template<typename T, T N>
@@ -30,12 +58,26 @@ struct gen_seq : Concat<make_integer_sequence<T, N/2>
30template<> struct gen_seq<std::size_t, 0> : integer_sequence<std::size_t>{}; 58template<> struct gen_seq<std::size_t, 0> : integer_sequence<std::size_t>{};
31template<> struct gen_seq<std::size_t, 1> : integer_sequence<std::size_t, 0>{}; 59template<> struct gen_seq<std::size_t, 1> : integer_sequence<std::size_t, 0>{};
32 60
61/**
62 * Compile time sequence of indexes.
63 */
33template <std::size_t... I> 64template <std::size_t... I>
34using index_sequence = integer_sequence<std::size_t, I...>; 65using index_sequence = integer_sequence<std::size_t, I...>;
35 66
67/**
68 * Make a compile time sequence of indexes from @c 0 to <tt>N-1</tt>.
69 */
36template <std::size_t I> 70template <std::size_t I>
37using make_index_sequence = make_integer_sequence<std::size_t, I>; 71using make_index_sequence = make_integer_sequence<std::size_t, I>;
38 72
73/**
74 * @}
75 */
76
39} } 77} }
40 78
79/**
80 * @}
81 */
82
41#endif 83#endif