μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | Friends | List of all members
Vector2 Class Reference

Public Member Functions

 Vector2 (float x, float y)
 
 Vector2 (const Vector2 &v)
 
 Vector2 (Vector2 &&v) noexcept
 
Vector2operator= (const Vector2 &v)
 
Vector2operator= (Vector2 &&v) noexcept
 
 ~Vector2 ()
 
std::string toString () const
 
Vector2 operator- () const
 
Vector2 operator+ (const Vector2 &v) const
 
Vector2 operator- (const Vector2 &v) const
 
Vector2 operator- (float value) const
 
Vector2 operator+ (float value) const
 
Vector2 operator* (float value) const
 
Vector2 operator/ (float value) const
 
Vector2 operator* (const Vector2 &v) const
 
Vector2 operator/ (const Vector2 &v) const
 
Vector2operator+= (const Vector2 &v)
 
Vector2operator-= (const Vector2 &v)
 
Vector2operator*= (float v)
 
Vector2operator/= (float v)
 
Vector2operator*= (const Vector2 &v)
 
Vector2operator/= (const Vector2 &v)
 
bool operator== (const Vector2 &v) const
 
bool operator!= (const Vector2 &v) const
 
 Vector2 (float x, float y)
 
 Vector2 (const Vector2 &v)
 
 Vector2 (Vector2 &&v) noexcept
 
Vector2operator= (const Vector2 &v)
 
Vector2operator= (Vector2 &&v) noexcept
 
 ~Vector2 ()
 
std::string toString () const
 
Vector2 operator- () const
 
Vector2 operator+ (const Vector2 &v) const
 
Vector2 operator- (const Vector2 &v) const
 
Vector2 operator- (float value) const
 
Vector2 operator+ (float value) const
 
Vector2 operator* (float value) const
 
Vector2 operator/ (float value) const
 
Vector2 operator* (const Vector2 &v) const
 
Vector2 operator/ (const Vector2 &v) const
 
Vector2operator+= (const Vector2 &v)
 
Vector2operator-= (const Vector2 &v)
 
Vector2operator*= (float v)
 
Vector2operator/= (float v)
 
Vector2operator*= (const Vector2 &v)
 
Vector2operator/= (const Vector2 &v)
 
bool operator== (const Vector2 &v) const
 
bool operator!= (const Vector2 &v) const
 

Private Attributes

float x
 
float y
 

Friends

Vector2 operator+ (float f, const Vector2 &v)
 
Vector2 operator- (float f, const Vector2 &v)
 
Vector2 operator* (float f, const Vector2 &v)
 
Vector2 operator/ (float f, const Vector2 &v)
 
Vector2 operator+ (float f, const Vector2 &v)
 
Vector2 operator- (float f, const Vector2 &v)
 
Vector2 operator* (float f, const Vector2 &v)
 
Vector2 operator/ (float f, const Vector2 &v)
 

Detailed Description

Definition at line 18 of file test_operator_overloading.cpp.

Constructor & Destructor Documentation

◆ Vector2() [1/6]

Vector2::Vector2 ( float  x,
float  y 
)
inline

Definition at line 20 of file test_operator_overloading.cpp.

References print_created(), and toString().

◆ Vector2() [2/6]

Vector2::Vector2 ( const Vector2 v)
inline

Definition at line 21 of file test_operator_overloading.cpp.

References print_copy_created().

◆ Vector2() [3/6]

Vector2::Vector2 ( Vector2 &&  v)
inlinenoexcept

Definition at line 22 of file test_operator_overloading.cpp.

References print_move_created().

◆ ~Vector2() [1/2]

Vector2::~Vector2 ( )
inline

Definition at line 39 of file test_operator_overloading.cpp.

References print_destroyed().

◆ Vector2() [4/6]

Vector2::Vector2 ( float  x,
float  y 
)
inline

Definition at line 20 of file test_operator_overloading.cpp.

References print_created(), and toString().

◆ Vector2() [5/6]

Vector2::Vector2 ( const Vector2 v)
inline

Definition at line 21 of file test_operator_overloading.cpp.

References print_copy_created().

◆ Vector2() [6/6]

Vector2::Vector2 ( Vector2 &&  v)
inlinenoexcept

Definition at line 22 of file test_operator_overloading.cpp.

References print_move_created().

◆ ~Vector2() [2/2]

Vector2::~Vector2 ( )
inline

Definition at line 39 of file test_operator_overloading.cpp.

References print_destroyed().

Member Function Documentation

◆ operator!=() [1/2]

bool Vector2::operator!= ( const Vector2 v) const
inline

Definition at line 91 of file test_operator_overloading.cpp.

References x, and y.

◆ operator!=() [2/2]

bool Vector2::operator!= ( const Vector2 v) const
inline

Definition at line 91 of file test_operator_overloading.cpp.

References x, and y.

◆ operator*() [1/4]

Vector2 Vector2::operator* ( const Vector2 v) const
inline

Definition at line 52 of file test_operator_overloading.cpp.

References x, and y.

◆ operator*() [2/4]

Vector2 Vector2::operator* ( const Vector2 v) const
inline

Definition at line 52 of file test_operator_overloading.cpp.

References x, and y.

◆ operator*() [3/4]

Vector2 Vector2::operator* ( float  value) const
inline

Definition at line 50 of file test_operator_overloading.cpp.

References x, and y.

◆ operator*() [4/4]

Vector2 Vector2::operator* ( float  value) const
inline

Definition at line 50 of file test_operator_overloading.cpp.

References x, and y.

◆ operator*=() [1/4]

Vector2 & Vector2::operator*= ( const Vector2 v)
inline

Definition at line 74 of file test_operator_overloading.cpp.

References x, and y.

◆ operator*=() [2/4]

Vector2 & Vector2::operator*= ( const Vector2 v)
inline

Definition at line 74 of file test_operator_overloading.cpp.

References x, and y.

◆ operator*=() [3/4]

Vector2 & Vector2::operator*= ( float  v)
inline

Definition at line 64 of file test_operator_overloading.cpp.

References x, and y.

◆ operator*=() [4/4]

Vector2 & Vector2::operator*= ( float  v)
inline

Definition at line 64 of file test_operator_overloading.cpp.

References x, and y.

◆ operator+() [1/4]

Vector2 Vector2::operator+ ( const Vector2 v) const
inline

Definition at line 46 of file test_operator_overloading.cpp.

References x, and y.

◆ operator+() [2/4]

Vector2 Vector2::operator+ ( const Vector2 v) const
inline

Definition at line 46 of file test_operator_overloading.cpp.

References x, and y.

◆ operator+() [3/4]

Vector2 Vector2::operator+ ( float  value) const
inline

Definition at line 49 of file test_operator_overloading.cpp.

References x, and y.

◆ operator+() [4/4]

Vector2 Vector2::operator+ ( float  value) const
inline

Definition at line 49 of file test_operator_overloading.cpp.

References x, and y.

◆ operator+=() [1/2]

Vector2 & Vector2::operator+= ( const Vector2 v)
inline

Definition at line 54 of file test_operator_overloading.cpp.

References x, and y.

◆ operator+=() [2/2]

Vector2 & Vector2::operator+= ( const Vector2 v)
inline

Definition at line 54 of file test_operator_overloading.cpp.

References x, and y.

◆ operator-() [1/6]

Vector2 Vector2::operator- ( ) const
inline

Definition at line 45 of file test_operator_overloading.cpp.

References x, and y.

◆ operator-() [2/6]

Vector2 Vector2::operator- ( ) const
inline

Definition at line 45 of file test_operator_overloading.cpp.

References x, and y.

◆ operator-() [3/6]

Vector2 Vector2::operator- ( const Vector2 v) const
inline

Definition at line 47 of file test_operator_overloading.cpp.

References x, and y.

◆ operator-() [4/6]

Vector2 Vector2::operator- ( const Vector2 v) const
inline

Definition at line 47 of file test_operator_overloading.cpp.

References x, and y.

◆ operator-() [5/6]

Vector2 Vector2::operator- ( float  value) const
inline

Definition at line 48 of file test_operator_overloading.cpp.

References x, and y.

◆ operator-() [6/6]

Vector2 Vector2::operator- ( float  value) const
inline

Definition at line 48 of file test_operator_overloading.cpp.

References x, and y.

◆ operator-=() [1/2]

Vector2 & Vector2::operator-= ( const Vector2 v)
inline

Definition at line 59 of file test_operator_overloading.cpp.

References x, and y.

◆ operator-=() [2/2]

Vector2 & Vector2::operator-= ( const Vector2 v)
inline

Definition at line 59 of file test_operator_overloading.cpp.

References x, and y.

◆ operator/() [1/4]

Vector2 Vector2::operator/ ( const Vector2 v) const
inline

Definition at line 53 of file test_operator_overloading.cpp.

References x, and y.

◆ operator/() [2/4]

Vector2 Vector2::operator/ ( const Vector2 v) const
inline

Definition at line 53 of file test_operator_overloading.cpp.

References x, and y.

◆ operator/() [3/4]

Vector2 Vector2::operator/ ( float  value) const
inline

Definition at line 51 of file test_operator_overloading.cpp.

References x, and y.

◆ operator/() [4/4]

Vector2 Vector2::operator/ ( float  value) const
inline

Definition at line 51 of file test_operator_overloading.cpp.

References x, and y.

◆ operator/=() [1/4]

Vector2 & Vector2::operator/= ( const Vector2 v)
inline

Definition at line 79 of file test_operator_overloading.cpp.

References x, and y.

◆ operator/=() [2/4]

Vector2 & Vector2::operator/= ( const Vector2 v)
inline

Definition at line 79 of file test_operator_overloading.cpp.

References x, and y.

◆ operator/=() [3/4]

Vector2 & Vector2::operator/= ( float  v)
inline

Definition at line 69 of file test_operator_overloading.cpp.

References x, and y.

◆ operator/=() [4/4]

Vector2 & Vector2::operator/= ( float  v)
inline

Definition at line 69 of file test_operator_overloading.cpp.

References x, and y.

◆ operator=() [1/4]

Vector2 & Vector2::operator= ( const Vector2 v)
inline

Definition at line 26 of file test_operator_overloading.cpp.

References print_copy_assigned(), x, and y.

◆ operator=() [2/4]

Vector2 & Vector2::operator= ( const Vector2 v)
inline

Definition at line 26 of file test_operator_overloading.cpp.

References print_copy_assigned(), x, and y.

◆ operator=() [3/4]

Vector2 & Vector2::operator= ( Vector2 &&  v)
inlinenoexcept

Definition at line 32 of file test_operator_overloading.cpp.

References print_move_assigned(), x, and y.

◆ operator=() [4/4]

Vector2 & Vector2::operator= ( Vector2 &&  v)
inlinenoexcept

Definition at line 32 of file test_operator_overloading.cpp.

References print_move_assigned(), x, and y.

◆ operator==() [1/2]

bool Vector2::operator== ( const Vector2 v) const
inline

Definition at line 90 of file test_operator_overloading.cpp.

References x, and y.

◆ operator==() [2/2]

bool Vector2::operator== ( const Vector2 v) const
inline

Definition at line 90 of file test_operator_overloading.cpp.

References x, and y.

◆ toString() [1/2]

std::string Vector2::toString ( ) const
inline

Definition at line 41 of file test_operator_overloading.cpp.

References x, and y.

Referenced by TEST_SUBMODULE(), and Vector2().

◆ toString() [2/2]

std::string Vector2::toString ( ) const
inline

Definition at line 41 of file test_operator_overloading.cpp.

References x, and y.

Friends And Related Function Documentation

◆ operator* [1/2]

Vector2 operator* ( float  f,
const Vector2 v 
)
friend

Definition at line 87 of file test_operator_overloading.cpp.

◆ operator* [2/2]

Vector2 operator* ( float  f,
const Vector2 v 
)
friend

Definition at line 87 of file test_operator_overloading.cpp.

◆ operator+ [1/2]

Vector2 operator+ ( float  f,
const Vector2 v 
)
friend

Definition at line 85 of file test_operator_overloading.cpp.

◆ operator+ [2/2]

Vector2 operator+ ( float  f,
const Vector2 v 
)
friend

Definition at line 85 of file test_operator_overloading.cpp.

◆ operator- [1/2]

Vector2 operator- ( float  f,
const Vector2 v 
)
friend

Definition at line 86 of file test_operator_overloading.cpp.

◆ operator- [2/2]

Vector2 operator- ( float  f,
const Vector2 v 
)
friend

Definition at line 86 of file test_operator_overloading.cpp.

◆ operator/ [1/2]

Vector2 operator/ ( float  f,
const Vector2 v 
)
friend

Definition at line 88 of file test_operator_overloading.cpp.

◆ operator/ [2/2]

Vector2 operator/ ( float  f,
const Vector2 v 
)
friend

Definition at line 88 of file test_operator_overloading.cpp.

Member Data Documentation

◆ x

float Vector2::x
private

◆ y

float Vector2::y
private

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