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-------------------------------------------------------------------------------
11License
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
27Primitive
28 uint
29
30Description
31 System unsigned integer
32
33SourceFiles
34 uintIO.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_primitives_uint_H
39#define Foam_primitives_uint_H
40
41#include "uint8.H"
42#include "uint16.H"
43#include "uint32.H"
44#include "uint64.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51#define MAXMIN(retType, type1, type2) \
52 \
53 \
54inline retType min(const type1 s1, const type2 s2) \
55{ \
56 return (s1 < s2) ? s1 : s2; \
57} \
58 \
59 \
60inline retType max(const type1 s1, const type2 s2) \
61{ \
62 return (s2 < s1) ? s1 : s2; \
63}
64
65MAXMIN(uint8_t, uint8_t, uint8_t)
66MAXMIN(uint16_t, uint16_t, uint16_t)
67
68MAXMIN(uint32_t, uint32_t, uint32_t)
69MAXMIN(uint64_t, uint64_t, uint32_t)
70MAXMIN(uint64_t, uint32_t, uint64_t)
71MAXMIN(uint64_t, uint64_t, uint64_t)
72
73
74// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
75
76//- Read unsigned int from stream
77unsigned int readUint(Istream& is);
78
79
80// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81
82} // End namespace Foam
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86#endif
87
88// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
#define MAXMIN(retType, type1, type2)
Definition: int.H:49
Namespace for OpenFOAM.
unsigned int readUint(Istream &is)
Read unsigned int from stream.
Definition: uintIO.C:33
16bit unsigned integer. I/O is done via an int32.
32bit unsigned integer
64bit unsigned integer
8bit unsigned integer