ATLAS Offline Software
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 
12 public:
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 
48 inline
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 
75 inline 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 
103 inline std::ostream&
104 TestClassPrimitives::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 
132 inline 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 
161 inline bool
163 {
164  return ( ( (*this) == rhs ) ? false : true );
165 }
166 
167 
168 #endif
TestClassPrimitives::m_slongint
signed long int m_slongint
Definition: TestClassPrimitives.h:41
TestClassPrimitives::m_sint
signed int m_sint
Definition: TestClassPrimitives.h:33
TestClassPrimitives::m_s
signed m_s
Definition: TestClassPrimitives.h:34
TestClassPrimitives::m_uint
unsigned int m_uint
Definition: TestClassPrimitives.h:32
TestClassPrimitives::m_double
double m_double
Definition: TestClassPrimitives.h:43
TestClassPrimitives::m_ushort
unsigned short m_ushort
Definition: TestClassPrimitives.h:26
TestClassPrimitives::m_char
char m_char
Definition: TestClassPrimitives.h:22
TestClassPrimitives::operator!=
bool operator!=(const TestClassPrimitives &rhs) const
Definition: TestClassPrimitives.h:162
TestClassPrimitives::m_u
unsigned m_u
Definition: TestClassPrimitives.h:35
TestClassPrimitives::m_float
float m_float
Definition: TestClassPrimitives.h:42
TestClassPrimitives::m_longint
long int m_longint
Definition: TestClassPrimitives.h:39
TestClassPrimitives::m_long
long m_long
Definition: TestClassPrimitives.h:36
TestClassPrimitives::m_short
short m_short
Definition: TestClassPrimitives.h:25
TestClassPrimitives::setNonZero
void setNonZero()
Definition: TestClassPrimitives.h:76
TestClassPrimitives::m_bool
bool m_bool
Definition: TestClassPrimitives.h:21
TestClassPrimitives::m_ushortint
unsigned short int m_ushortint
Definition: TestClassPrimitives.h:29
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TestClassPrimitives::m_sshort
signed short m_sshort
Definition: TestClassPrimitives.h:27
TestClassPrimitives::m_sshortint
signed short int m_sshortint
Definition: TestClassPrimitives.h:30
TestClassPrimitives::m_schar
signed char m_schar
Definition: TestClassPrimitives.h:24
TestClassPrimitives::m_ulongint
unsigned long int m_ulongint
Definition: TestClassPrimitives.h:40
TestClassPrimitives::operator==
bool operator==(const TestClassPrimitives &rhs) const
Definition: TestClassPrimitives.h:133
TestClassPrimitives::m_ulong
unsigned long m_ulong
Definition: TestClassPrimitives.h:37
TestClassPrimitives::m_uchar
unsigned char m_uchar
Definition: TestClassPrimitives.h:23
TestClassPrimitives::m_slong
signed long m_slong
Definition: TestClassPrimitives.h:38
TestClassPrimitives
Definition: TestClassPrimitives.h:10
TestClassPrimitives::m_shortint
short int m_shortint
Definition: TestClassPrimitives.h:28
TestClassPrimitives::~TestClassPrimitives
~TestClassPrimitives()
Definition: TestClassPrimitives.h:14
TestClassPrimitives::TestClassPrimitives
TestClassPrimitives()
Definition: TestClassPrimitives.h:49
TestClassPrimitives::streamOut
std::ostream & streamOut(std::ostream &os) const
Definition: TestClassPrimitives.h:104
TestClassPrimitives::m_int
int m_int
Definition: TestClassPrimitives.h:31