Documentation 6b54b78464
Loading...
Searching...
No Matches
classes_multiple_integers.hpp
Go to the documentation of this file.
1/*!
2 * \file classes_multiple_integers.hpp
3 * \brief Header file for the classes that consists of multiple integer types.
4 * \author E. van der Weide
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include <iostream>
31
32/*!
33 * \struct CUnsignedLong2T
34 * \brief Helper struct used to store two integral types as one entity.
35 */
37 unsigned long long0; /*!< \brief First integer to store in this class. */
38 unsigned long long1; /*!< \brief Second integer to store in this class. */
39
40 CUnsignedLong2T(unsigned long a = 0, unsigned long b = 0) : long0(a), long1(b) {}
41
42 inline bool operator<(const CUnsignedLong2T& other) const {
43 if (long0 != other.long0) return (long0 < other.long0);
44 return (long1 < other.long1);
45 }
46
47 inline bool operator==(const CUnsignedLong2T& other) const {
48 return (long0 == other.long0) && (long1 == other.long1);
49 }
50};
51
52/*!
53 * \struct CUnsignedShort2T
54 * \brief Help struct used to store two integral types as one entity.
55 */
57 unsigned short short0; /*!< \brief First integer to store in this class. */
58 unsigned short short1; /*!< \brief Second integer to store in this class. */
59
60 CUnsignedShort2T(unsigned short a = 0, unsigned short b = 0) : short0(a), short1(b) {}
61
62 inline bool operator<(const CUnsignedShort2T& other) const {
63 if (short0 != other.short0) return (short0 < other.short0);
64 return (short1 < other.short1);
65 }
66
67 inline bool operator==(const CUnsignedShort2T& other) const {
68 return (short0 == other.short0) && (short1 == other.short1);
69 }
70};
71
72/*!
73 * \class CLong3T
74 * \brief Help class used to store three longs as one entity.
75 * \version 8.5.0 "Harrier"
76 */
77struct CLong3T {
78 long long0 = 0; /*!< \brief First long to store in this class. */
79 long long1 = 0; /*!< \brief Second long to store in this class. */
80 long long2 = 0; /*!< \brief Third long to store in this class. */
81
82 CLong3T() = default;
83
84 CLong3T(const long a, const long b, const long c) {
85 long0 = a;
86 long1 = b;
87 long2 = c;
88 }
89
90 bool operator<(const CLong3T& other) const {
91 if (long0 != other.long0) return (long0 < other.long0);
92 if (long1 != other.long1) return (long1 < other.long1);
93 if (long2 != other.long2) return (long2 < other.long2);
94
95 return false;
96 }
97};
Help class used to store three longs as one entity.
Definition classes_multiple_integers.hpp:77
long long2
Third long to store in this class.
Definition classes_multiple_integers.hpp:80
CLong3T(const long a, const long b, const long c)
Definition classes_multiple_integers.hpp:84
long long0
First long to store in this class.
Definition classes_multiple_integers.hpp:78
bool operator<(const CLong3T &other) const
Definition classes_multiple_integers.hpp:90
CLong3T()=default
long long1
Second long to store in this class.
Definition classes_multiple_integers.hpp:79
Helper struct used to store two integral types as one entity.
Definition classes_multiple_integers.hpp:36
CUnsignedLong2T(unsigned long a=0, unsigned long b=0)
Definition classes_multiple_integers.hpp:40
unsigned long long0
First integer to store in this class.
Definition classes_multiple_integers.hpp:37
bool operator<(const CUnsignedLong2T &other) const
Definition classes_multiple_integers.hpp:42
bool operator==(const CUnsignedLong2T &other) const
Definition classes_multiple_integers.hpp:47
unsigned long long1
Second integer to store in this class.
Definition classes_multiple_integers.hpp:38
Help struct used to store two integral types as one entity.
Definition classes_multiple_integers.hpp:56
unsigned short short0
First integer to store in this class.
Definition classes_multiple_integers.hpp:57
unsigned short short1
Second integer to store in this class.
Definition classes_multiple_integers.hpp:58
bool operator==(const CUnsignedShort2T &other) const
Definition classes_multiple_integers.hpp:67
CUnsignedShort2T(unsigned short a=0, unsigned short b=0)
Definition classes_multiple_integers.hpp:60
bool operator<(const CUnsignedShort2T &other) const
Definition classes_multiple_integers.hpp:62