uint.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Primitive
28  uint
29 
30 Description
31  System unsigned integer
32 
33 SourceFiles
34  uintIO.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef uint_H
39 #define uint_H
40 
41 #include "uint8.H"
42 #include "uint16.H"
43 #include "uint32.H"
44 #include "uint64.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 #define MAXMIN(retType, type1, type2) \
52  \
53  \
54 inline retType min(const type1 s1, const type2 s2) \
55 { \
56  return (s1 < s2) ? s1 : s2; \
57 } \
58  \
59  \
60 inline retType max(const type1 s1, const type2 s2) \
61 { \
62  return (s2 < s1) ? s1 : s2; \
63 }
64 
65 MAXMIN(uint8_t, uint8_t, uint8_t)
66 MAXMIN(uint16_t, uint16_t, uint16_t)
67 
68 MAXMIN(uint32_t, uint32_t, uint32_t)
69 MAXMIN(uint64_t, uint64_t, uint32_t)
70 MAXMIN(uint64_t, uint32_t, uint64_t)
71 MAXMIN(uint64_t, uint64_t, uint64_t)
72 
73 
74 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
75 
76 //- Read unsigned int from stream
77 unsigned int readUint(Istream& is);
78 
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 } // End namespace Foam
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 #endif
87 
88 // ************************************************************************* //
Foam::readUint
unsigned int readUint(Istream &is)
Read unsigned int from stream.
Definition: uintIO.C:33
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
uint8.H
8bit unsigned integer
uint16.H
16bit unsigned integer. I/O is done via an int32.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
uint32.H
32bit unsigned integer
Foam::MAXMIN
MAXMIN(double, double, double) inline double pow(const double base
Raise base to the power expon.
uint64.H
64bit unsigned integer