Template class Komplex with type_traits
Komplex< T > Class Template Reference

#include <komplex.h>

Public Member Functions

 Komplex ()
 
 Komplex (T re, T im=0.0)
 
 Komplex (const Komplex< T > &org)=default
 
 Komplex (Komplex< T > &&org)=default
 
Komplex< T > & operator= (const Komplex< T > &rhs)=default
 
Komplex< T > & operator= (Komplex< T > &&rhs)=default
 
 ~Komplex ()=default
 
Get_re () const
 
void Set_re (T val)
 
Get_im () const
 
void Set_im (T val)
 
Komplex< T > & operator+= (const Komplex< T > &rhs)
 
Komplex< T > operator+ (const Komplex< T > &rhs) const
 
bool operator< (const Komplex< T > &rhs) const
 
bool operator== (const Komplex< T > &rhs) const
 
bool operator> (const Komplex< T > &rhs) const
 

Detailed Description

template<class T>
class Komplex< T >

Template Klasse fuer komplexe Zahlen zur Demonstration.

Template Parameters
Tfloating point type
Warning
Bei Templateklassen (und -funktionen) muss der Implementierungsteil, hier im File komplex.tpp, im Headerfile inkludiert werden. Das Implementierungsfile darf nicht noch einmal ueberstzt werden!

Definition at line 16 of file komplex.h.

Constructor & Destructor Documentation

◆ Komplex() [1/4]

template<class T >
Komplex< T >::Komplex ( )
inline

Default constructor initializes both components by zero.

Definition at line 22 of file komplex.h.

◆ Komplex() [2/4]

template<class T >
Komplex< T >::Komplex ( re,
im = 0.0 
)
inline

Parameter constructor

Parameters
[in]reRealteil
[in]imImaginaerteil (default value: 0.0)

Definition at line 29 of file komplex.h.

◆ Komplex() [3/4]

template<class T >
Komplex< T >::Komplex ( const Komplex< T > &  org)
default

◆ Komplex() [4/4]

template<class T >
Komplex< T >::Komplex ( Komplex< T > &&  org)
default

◆ ~Komplex()

template<class T >
Komplex< T >::~Komplex ( )
default

Member Function Documentation

◆ Get_im()

template<class T >
T Komplex< T >::Get_im ( ) const
inline

Abfrage des Imaginaerteils

Returns
Imaginaerteil

Definition at line 59 of file komplex.h.

Here is the caller graph for this function:

◆ Get_re()

template<class T >
T Komplex< T >::Get_re ( ) const
inline

Abfrage des Realteils

Returns
Realteil

Definition at line 44 of file komplex.h.

Here is the caller graph for this function:

◆ operator+()

template<class T >
Komplex<T> Komplex< T >::operator+ ( const Komplex< T > &  rhs) const

Addiert die aktuelle Instanz mit einer zweiten komplexen Zahl

Parameters
[in]rhszweite komplexe Zahl
Returns
*this + rhs

◆ operator+=()

template<class T >
Komplex<T>& Komplex< T >::operator+= ( const Komplex< T > &  rhs)

Addiert zur aktuellen Instanz eine zweite komplexe Zahl

Parameters
[in]rhszweite komplexe Zahl
Returns
*this += rhs

◆ operator<()

template<class T >
bool Komplex< T >::operator< ( const Komplex< T > &  rhs) const
inline

Definition at line 84 of file komplex.h.

◆ operator=() [1/2]

template<class T >
Komplex<T>& Komplex< T >::operator= ( const Komplex< T > &  rhs)
default

◆ operator=() [2/2]

template<class T >
Komplex<T>& Komplex< T >::operator= ( Komplex< T > &&  rhs)
default

◆ operator==()

template<class T >
bool Komplex< T >::operator== ( const Komplex< T > &  rhs) const
inline

Definition at line 89 of file komplex.h.

◆ operator>()

template<class T >
bool Komplex< T >::operator> ( const Komplex< T > &  rhs) const
inline

Definition at line 94 of file komplex.h.

◆ Set_im()

template<class T >
void Komplex< T >::Set_im ( val)
inline

Setzen des Realteils

Parameters
[in]valNew value to set

Definition at line 66 of file komplex.h.

◆ Set_re()

template<class T >
void Komplex< T >::Set_re ( val)
inline

Abfrage des Realteils

Parameters
[in]valNew value to set

Definition at line 51 of file komplex.h.


The documentation for this class was generated from the following file: