mc2lib
types.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2016, Marco Elver
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * * Neither the name of the software nor the names of its contributors
18  * may be used to endorse or promote products derived from this
19  * software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33 
34 #ifndef MC2LIB_TYPES_HPP_
35 #define MC2LIB_TYPES_HPP_
36 
37 #include <cstdint>
38 
39 namespace mc2lib {
40 
45 namespace types {
46 
54 template <bool use_specialized>
55 struct Types {
56  typedef std::uint64_t Addr;
57  typedef std::uint16_t Pid;
58  typedef std::uint16_t Poi;
59  typedef Addr InstPtr;
60  typedef std::uint8_t WriteID;
61 };
62 
66 typedef typename Types<true>::Addr Addr;
67 
71 typedef typename Types<true>::Pid Pid;
72 
76 typedef typename Types<true>::Poi Poi;
77 
81 typedef typename Types<true>::InstPtr InstPtr;
82 
86 typedef typename Types<true>::WriteID WriteID;
87 
88 } // namespace types
89 } // namespace mc2lib
90 
91 #endif /* MC2LIB_TYPES_HPP_ */
92 
93 /* vim: set ts=2 sts=2 sw=2 et : */
Template class of common types, permitting specialization.
Definition: types.hpp:55
Definition: cats.hpp:47
std::uint16_t Pid
Definition: types.hpp:57
std::uint16_t Poi
Definition: types.hpp:58
Addr InstPtr
Definition: types.hpp:59
std::uint8_t WriteID
Definition: types.hpp:60
std::uint64_t Addr
Definition: types.hpp:56