ATLAS Offline Software
Loading...
Searching...
No Matches
TestClassPrimitives.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TESTCLASSPRIMITIVES_H
6#define TESTCLASSPRIMITIVES_H
7
8#include <ostream>
9
11
12public:
15
16 void setNonZero();
17 bool operator==( const TestClassPrimitives& rhs ) const;
18 bool operator!=( const TestClassPrimitives& rhs ) const;
19 std::ostream& streamOut( std::ostream& os ) const;
20
21 bool m_bool;
22 char m_char;
23 unsigned char m_uchar;
24 signed char m_schar;
25 short m_short;
26 unsigned short m_ushort;
27 signed short m_sshort;
28 short int m_shortint;
29 unsigned short int m_ushortint;
30 signed short int m_sshortint;
31 int m_int;
32 unsigned int m_uint;
33 signed int m_sint;
34 signed m_s;
35 unsigned m_u;
36 long m_long;
37 unsigned long m_ulong;
38 signed long m_slong;
39 long int m_longint;
40 unsigned long int m_ulongint;
41 signed long int m_slongint;
42 float m_float;
43 double m_double;
44 // long double m_longdouble;
45};
46
47
48inline
50 m_bool( false ),
51 m_char( 0 ),
52 m_uchar( 0 ),
53 m_schar( 0 ),
54 m_short( 0 ),
55 m_ushort( 0 ),
56 m_sshort( 0 ),
57 m_shortint( 0 ),
58 m_ushortint( 0 ),
59 m_sshortint( 0 ),
60 m_int( 0 ),
61 m_uint( 0 ),
62 m_sint( 0 ),
63 m_s( 0 ),
64 m_u( 0 ),
65 m_long( 0 ),
66 m_ulong( 0 ),
67 m_slong( 0 ),
68 m_longint( 0 ),
69 m_ulongint( 0 ),
70 m_slongint( 0 ),
71 m_float( 0 ),
72 m_double( 0 )
73{}
74
75inline void
77{
78 m_bool = true;
79 m_char = 1;
80 m_uchar = 2;
81 m_schar = 3;
82 m_short = 4;
83 m_ushort = 5;
84 m_sshort = 6;
85 m_shortint = 7;
86 m_ushortint = 8;
87 m_sshortint = 9;
88 m_int = 10;
89 m_uint = 11;
90 m_sint = 12;
91 m_s = 13;
92 m_u = 14;
93 m_long = 15;
94 m_ulong = 16;
95 m_slong = 17;
96 m_longint = 18;
97 m_ulongint = 19;
98 m_slongint = 20;
99 m_float = 21;
100 m_double = 22;
101}
102
103inline std::ostream&
104TestClassPrimitives::streamOut( std::ostream& os ) const
105{
106 os << "m_bool = " << static_cast<int>( m_bool ) << std::endl
107 << "m_char = " << static_cast<int>( m_char ) << std::endl
108 << "m_uchar = " << static_cast<int>( m_uchar ) << std::endl
109 << "m_schar = " << static_cast<int>( m_schar ) << std::endl
110 << "m_short = " << m_short << std::endl
111 << "m_ushort = " << m_ushort << std::endl
112 << "m_sshort = " << m_sshort << std::endl
113 << "m_shortint = " << m_shortint << std::endl
114 << "m_ushortint = " << m_ushortint << std::endl
115 << "m_sshortint = " << m_sshortint << std::endl
116 << "m_int = " << m_int << std::endl
117 << "m_uint = " << m_uint << std::endl
118 << "m_sint = " << m_sint << std::endl
119 << "m_s = " << m_s << std::endl
120 << "m_u = " << m_u << std::endl
121 << "m_long = " << m_long << std::endl
122 << "m_ulong = " << m_ulong << std::endl
123 << "m_slong = " << m_slong << std::endl
124 << "m_longint = " << m_longint << std::endl
125 << "m_ulongint = " << m_ulongint << std::endl
126 << "m_slongint = " << m_slongint << std::endl
127 << "m_float = " << m_float << std::endl
128 << "m_double = " << m_double;
129 return os;
130}
131
132inline bool
134{
135 return
136 ( m_bool == rhs.m_bool &&
137 m_char == rhs.m_char &&
138 m_uchar == rhs.m_uchar &&
139 m_schar == rhs.m_schar &&
140 m_short == rhs.m_short &&
141 m_ushort == rhs.m_ushort &&
142 m_sshort == rhs.m_sshort &&
143 m_shortint == rhs.m_shortint &&
144 m_ushortint == rhs.m_ushortint &&
145 m_sshortint == rhs.m_sshortint &&
146 m_int == rhs.m_int &&
147 m_uint == rhs.m_uint &&
148 m_sint == rhs.m_sint &&
149 m_s == rhs.m_s &&
150 m_u == rhs.m_u &&
151 m_long == rhs.m_long &&
152 m_ulong == rhs.m_ulong &&
153 m_slong == rhs.m_slong &&
154 m_longint == rhs.m_longint &&
155 m_ulongint == rhs.m_ulongint &&
156 m_slongint == rhs.m_slongint &&
157 m_float == rhs.m_float &&
158 m_double == rhs.m_double );
159}
160
161inline bool
163{
164 return ( ( (*this) == rhs ) ? false : true );
165}
166
167
168#endif
std::ostream & streamOut(std::ostream &os) const
signed short int m_sshortint
unsigned long int m_ulongint
unsigned short int m_ushortint
bool operator==(const TestClassPrimitives &rhs) const
signed long int m_slongint
bool operator!=(const TestClassPrimitives &rhs) const