Nektar++
NektarUnivTypeDefs.hpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: NektarUnivTypeDefs.hpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Scientific Computing and Imaging Institute,
10// University of Utah (USA) and Department of Aeronautics, Imperial
11// College London (UK).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Universal type defines in the Nektar Library
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTARUNIVTYPEDEF_HPP
36#define NEKTARUNIVTYPEDEF_HPP
37
38#include <cstdint>
39#include <map>
40
41namespace Nektar
42{
43typedef double NekDouble;
44typedef float NekSingle;
45
46typedef std::int32_t NekInt;
47typedef std::int32_t NekInt32;
48typedef std::int64_t NekInt64;
49typedef std::uint32_t NekUInt;
50typedef std::uint32_t NekUInt32;
51typedef std::uint64_t NekUInt64;
52
53struct OneD
54{
55 static const unsigned int Value = 1;
56};
57struct TwoD
58{
59 static const unsigned int Value = 2;
60};
61struct ThreeD
62{
63 static const unsigned int Value = 3;
64};
65
66struct FourD
67{
68 static const unsigned int Value = 4;
69};
70
72{
73 xDir = 0,
74 yDir = 1,
75 zDir = 2
76};
77
78/// Enumeration a flags for output format.
80{
86};
87
88/// Enumeration of flags for passing a list of options.
90{
92};
93
94/// String map for FlagType enumeration.
95const char *const FlagTypeMap[] = {"UseGlobal"};
96
97/// Defines a list of flags.
99{
100public:
101 void set(const FlagType &key, bool value)
102 {
103 m_data[key] = value;
104 }
105 bool isSet(const FlagType &key) const
106 {
107 auto x = m_data.find(key);
108 return x != m_data.end() && x->second;
109 }
110
111private:
112 std::map<FlagType, bool> m_data;
113};
114
115} // namespace Nektar
116
117#endif
Defines a list of flags.
void set(const FlagType &key, bool value)
bool isSet(const FlagType &key) const
std::map< FlagType, bool > m_data
std::int64_t NekInt64
std::int32_t NekInt
std::uint32_t NekUInt
std::int32_t NekInt32
FlagType
Enumeration of flags for passing a list of options.
std::uint32_t NekUInt32
std::uint64_t NekUInt64
OutputFormat
Enumeration a flags for output format.
const char *const FlagTypeMap[]
String map for FlagType enumeration.
double NekDouble
static const unsigned int Value
static const unsigned int Value
static const unsigned int Value
static const unsigned int Value