aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/complex.h
blob: 54fb99ed16bb9e653b17a9c9fd350cff7cc96f91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#ifndef COMPLEX_H
#define COMPLEX_H

#include "libsamplemacros.h"

class LIBSAMPLE_API Complex
{
public:
    Complex(double real = 0.0, double imag = 0.0);
    ~Complex() {}

    inline double real() const { return m_real; }
    inline void setReal(double real) { m_real = real; }
    inline double imag() const { return m_imag; }
    inline void setImaginary(double imag) { m_imag = imag; }

    Complex operator+(Complex& other);

    void show();

private:
    double m_real;
    double m_imag;
};

#endif // COMPLEX_H