NSVD Reader
0.0.1
vattr.hpp
Go to the documentation of this file.
1
5
#ifndef __NODAMUSHI_SVD_VATTR_HPP__
6
#define __NODAMUSHI_SVD_VATTR_HPP__
7
8
# include <tuple>
9
# include <type_traits>
10
# include <initializer_list>
11
12
namespace
nodamushi
{
13
namespace
svd{
14
15
template
<
typename
t,
typename
... types>
struct
contains
16
{
17
private
:
18
static
constexpr
bool
calc(){
19
using
swallow = std::initializer_list<int>;
20
bool
b =
false
;
21
(void)swallow{(void(b |= std::is_same<t,types>::value),0)...};
22
return
b;
23
}
24
public
:
25
static
constexpr
bool
value
= calc();
26
};
27
28
29
template
<
typename
value
,
typename
... attributes>
struct
vattr
{};
30
31
template
<
typename
v>
32
struct
vattr_unwrap
33
{
34
using
type
= v;
35
using
attr
= std::tuple<>;
36
template
<
typename
t>
37
using
contains
= ::std::false_type;
38
};
39
40
template
<
typename
v,
typename
... attributes>
41
struct
vattr_unwrap
<
vattr
<v,attributes...>>
42
{
43
using
type
= v;
44
using
attribute
= std::tuple<attributes...>;
45
template
<
typename
t>
46
using
contains
=
::nodamushi::svd::contains
<t,attributes...>;
47
};
48
49
50
}
// end namespace svd
51
}
// end namespace nodamushi
52
53
// include attributes
54
#include "
nodamushi/svd/vattr/hex.hpp
"
55
56
57
#endif // __NODAMUSHI_SVD_VATTR_HPP__
nodamushi::svd::contains
Definition:
vattr.hpp:15
hex.hpp
hex attribute
nodamushi::svd::vattr
Definition:
vattr.hpp:29
nodamushi::svd::vattr_unwrap
Definition:
vattr.hpp:32
nodamushi::svd::value
This class reperesents SVD(xml) element / attribute.
Definition:
value.hpp:53
nodamushi::svd::vattr_unwrap::attr
std::tuple<> attr
Definition:
vattr.hpp:35
nodamushi
Definition:
box.hpp:14
nodamushi::svd::vattr_unwrap::type
v type
Definition:
vattr.hpp:34
nodamushi::svd::vattr_unwrap< vattr< v, attributes... > >::attribute
std::tuple< attributes... > attribute
Definition:
vattr.hpp:44
nodamushi::svd::vattr_unwrap< vattr< v, attributes... > >::type
v type
Definition:
vattr.hpp:43
nodamushi::svd::vattr_unwrap::contains
::std::false_type contains
Definition:
vattr.hpp:37
include
nodamushi
svd
vattr.hpp
Generated by
1.8.15