Project
Loading...
Searching...
No Matches
TestClasses.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#ifndef O2_FRAMEWORK_TEST_CLASSES_H_
12#define O2_FRAMEWORK_TEST_CLASSES_H_
13
14#include <Rtypes.h>
16
17namespace o2::test
18{
19
21{
22 public:
23 TriviallyCopyable() = default;
24 TriviallyCopyable(unsigned x, unsigned y, unsigned secret)
25 : mX(x), mY(y), mSecret(secret)
26 {
27 }
28
29 bool operator==(const TriviallyCopyable& rhs) const
30 {
31 return mX == rhs.mX && mY == rhs.mY && mSecret == rhs.mSecret;
32 }
33
34 unsigned mX = 0;
35 unsigned mY = 0;
36
37 private:
38 unsigned mSecret = ~((decltype(mSecret))0);
39
40 ClassDefNV(TriviallyCopyable, 1);
41};
42
43class Base
44{
45 public:
46 Base() = default;
47 virtual ~Base() = default;
48 virtual void f() {}
49
50 private:
51 int mMember = 0;
52
53 ClassDef(Base, 1);
54};
55
56class Polymorphic : public Base
57{
58 public:
59 Polymorphic() = default;
60 Polymorphic(unsigned secret) : mSecret(secret) {}
61 ~Polymorphic() override = default;
62
63 bool operator==(const Polymorphic& rhs) const { return mSecret == rhs.mSecret; }
64
65 bool isDefault() const { return mSecret == ~(decltype(mSecret))0; }
66
67 unsigned get() const { return mSecret; }
68
69 void f() override {}
70
71 private:
72 unsigned mSecret = ~((decltype(mSecret))0);
73
74 ClassDefOverride(Polymorphic, 1);
75};
76
78{
79 public:
80 int x = 1;
81 float y = 2.f;
82
83 private:
84 ClassDefNV(SimplePODClass, 1);
85};
86
87} // namespace o2::test
88#endif // O2_FRAMEWORK_TEST_CLASSES_H_
virtual void f()
Definition TestClasses.h:48
Base()=default
virtual ~Base()=default
~Polymorphic() override=default
bool operator==(const Polymorphic &rhs) const
Definition TestClasses.h:63
unsigned get() const
Definition TestClasses.h:67
bool isDefault() const
Definition TestClasses.h:65
void f() override
Definition TestClasses.h:69
Polymorphic(unsigned secret)
Definition TestClasses.h:60
bool operator==(const TriviallyCopyable &rhs) const
Definition TestClasses.h:29
TriviallyCopyable(unsigned x, unsigned y, unsigned secret)
Definition TestClasses.h:24
GLint GLenum GLint x
Definition glcorearb.h:403