CPP02 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Fixed クラス

ex00 Fixed Class [詳解]

#include <Fixed.hpp>

Fixed 連携図
Collaboration graph

公開メンバ関数

 Fixed ()
 Default constructor.
 
 Fixed (const Fixed &other)
 Copy constructor.
 
Fixedoperator= (const Fixed &other)
 Copy assignment operator.
 
 ~Fixed ()
 Destructor.
 
int getRawBits (void) const
 Gets the raw value of the fixed-point number.
 
void setRawBits (int const raw)
 Sets the raw value of the fixed-point number.
 
 Fixed ()
 
 Fixed (const int raw)
 Constructor taking an integer.
 
 Fixed (const float raw)
 Constructor taking a float.
 
 Fixed (const Fixed &other)
 
Fixedoperator= (const Fixed &other)
 Copy assignment operator.
 
 ~Fixed ()
 
int getRawBits (void) const
 
void setRawBits (int const raw)
 
float toFloat (void) const
 Converts the fixed-point value to a floating-point value.
 
int toInt (void) const
 Converts the fixed-point value to an integer value (truncates the fractional part).
 
 Fixed ()
 
 Fixed (const int raw)
 
 Fixed (const float raw)
 
 Fixed (const Fixed &other)
 
Fixedoperator= (const Fixed &other)
 
 ~Fixed ()
 
int getRawBits (void) const
 
void setRawBits (int const raw)
 
float toFloat (void) const
 
int toInt (void) const
 
bool operator> (const Fixed &other) const
 Overloads the greater-than operator.
 
bool operator< (const Fixed &other) const
 Overloads the less-than operator.
 
bool operator>= (const Fixed &other) const
 Overloads the greater-than-or-equal-to operator.
 
bool operator<= (const Fixed &other) const
 Overloads the less-than-or-equal-to operator.
 
bool operator== (const Fixed &other) const
 Overloads the equality operator.
 
bool operator!= (const Fixed &other) const
 Overloads the inequality operator.
 
Fixed operator+ (const Fixed &other) const
 Overloads the addition operator.
 
Fixed operator- (const Fixed &other) const
 Overloads the subtraction operator.
 
Fixed operator* (const Fixed &other) const
 Overloads the multiplication operator.
 
Fixed operator/ (const Fixed &other) const
 Overloads the division operator.
 
Fixedoperator++ ()
 Overloads the pre-increment operator.
 
Fixed operator++ (int)
 Overloads the post-increment operator.
 
Fixedoperator-- ()
 Overloads the pre-decrement operator.
 
Fixed operator-- (int)
 Overloads the post-decrement operator.
 
 Fixed ()
 
 Fixed (const int raw)
 
 Fixed (const float raw)
 
 Fixed (const Fixed &other)
 
Fixedoperator= (const Fixed &other)
 
 ~Fixed ()
 
int getRawBits (void) const
 
void setRawBits (int const raw)
 
float toFloat (void) const
 
int toInt (void) const
 
bool operator> (const Fixed &other) const
 
bool operator< (const Fixed &other) const
 
bool operator>= (const Fixed &other) const
 
bool operator<= (const Fixed &other) const
 
bool operator== (const Fixed &other) const
 
bool operator!= (const Fixed &other) const
 
Fixed operator+ (const Fixed &other) const
 
Fixed operator- (const Fixed &other) const
 
Fixed operator* (const Fixed &other) const
 
Fixed operator/ (const Fixed &other) const
 
Fixedoperator++ ()
 
Fixed operator++ (int)
 
Fixedoperator-- ()
 
Fixed operator-- (int)
 

静的公開メンバ関数

static Fixedmin (Fixed &a, Fixed &b)
 Static member function to find the minimum of two Fixed objects (non-const).
 
static const Fixedmin (const Fixed &a, const Fixed &b)
 Static member function to find the minimum of two constant Fixed objects.
 
static Fixedmax (Fixed &a, Fixed &b)
 Static member function to find the maximum of two Fixed objects (non-const).
 
static const Fixedmax (const Fixed &a, const Fixed &b)
 Static member function to find the maximum of two constant Fixed objects.
 
static Fixedmin (Fixed &a, Fixed &b)
 
static const Fixedmin (const Fixed &a, const Fixed &b)
 
static Fixedmax (Fixed &a, Fixed &b)
 
static const Fixedmax (const Fixed &a, const Fixed &b)
 

詳解

ex00 Fixed Class

ex01 Fixed Class

Fixed.hpp28 行目に定義があります。

構築子と解体子

◆ Fixed() [1/14]

Fixed::Fixed ( )

Default constructor.

Initializes the fixed-point number value to 0 and prints a message.

Fixed.cpp33 行目に定義があります。

◆ Fixed() [2/14]

Fixed::Fixed ( const Fixed other)

Copy constructor.

Initializes a new Fixed object by copying the value from another Fixed object and prints a message.

引数
otherThe Fixed object to copy from.

Fixed.cpp41 行目に定義があります。

◆ ~Fixed() [1/4]

Fixed::~Fixed ( )

Destructor.

Prints a message indicating the destruction of the Fixed object.

Fixed.cpp65 行目に定義があります。

◆ Fixed() [3/14]

Fixed::Fixed ( )

◆ Fixed() [4/14]

Fixed::Fixed ( const int  raw)

Constructor taking an integer.

Converts the integer to the corresponding fixed-point value and prints a message.

引数
rawThe integer value to convert.

< [int_constructor] [int_constructor]

Fixed.cpp39 行目に定義があります。

◆ Fixed() [5/14]

Fixed::Fixed ( const float  raw)

Constructor taking a float.

Converts the float to the corresponding fixed-point value using rounding and prints a message.

引数
rawThe float value to convert.

< [float_constructor] [float_constructor]

Fixed.cpp51 行目に定義があります。

◆ Fixed() [6/14]

Fixed::Fixed ( const Fixed other)

◆ ~Fixed() [2/4]

Fixed::~Fixed ( )

◆ Fixed() [7/14]

Fixed::Fixed ( )

◆ Fixed() [8/14]

Fixed::Fixed ( const int  raw)

◆ Fixed() [9/14]

Fixed::Fixed ( const float  raw)

◆ Fixed() [10/14]

Fixed::Fixed ( const Fixed other)

◆ ~Fixed() [3/4]

Fixed::~Fixed ( )

◆ Fixed() [11/14]

Fixed::Fixed ( )

◆ Fixed() [12/14]

Fixed::Fixed ( const int  raw)

◆ Fixed() [13/14]

Fixed::Fixed ( const float  raw)

◆ Fixed() [14/14]

Fixed::Fixed ( const Fixed other)

◆ ~Fixed() [4/4]

Fixed::~Fixed ( )

関数詳解

◆ getRawBits() [1/4]

int Fixed::getRawBits ( void  ) const

Gets the raw value of the fixed-point number.

Prints a message and returns the integer representation of the fixed-point value.

戻り値
The raw integer value.

Fixed.cpp73 行目に定義があります。

◆ getRawBits() [2/4]

int Fixed::getRawBits ( void  ) const

◆ getRawBits() [3/4]

int Fixed::getRawBits ( void  ) const

◆ getRawBits() [4/4]

int Fixed::getRawBits ( void  ) const

◆ max() [1/4]

const Fixed & Fixed::max ( const Fixed a,
const Fixed b 
)
static

Static member function to find the maximum of two constant Fixed objects.

引数
aThe first constant Fixed object.
bThe second constant Fixed object.
戻り値
A constant reference to the larger Fixed object.

Fixed.cpp223 行目に定義があります。

◆ max() [2/4]

static const Fixed & Fixed::max ( const Fixed a,
const Fixed b 
)
static

◆ max() [3/4]

Fixed & Fixed::max ( Fixed a,
Fixed b 
)
static

Static member function to find the maximum of two Fixed objects (non-const).

引数
aThe first Fixed object.
bThe second Fixed object.
戻り値
A reference to the larger Fixed object.

Fixed.cpp215 行目に定義があります。

◆ max() [4/4]

static Fixed & Fixed::max ( Fixed a,
Fixed b 
)
static

◆ min() [1/4]

const Fixed & Fixed::min ( const Fixed a,
const Fixed b 
)
static

Static member function to find the minimum of two constant Fixed objects.

引数
aThe first constant Fixed object.
bThe second constant Fixed object.
戻り値
A constant reference to the smaller Fixed object.

Fixed.cpp207 行目に定義があります。

◆ min() [2/4]

static const Fixed & Fixed::min ( const Fixed a,
const Fixed b 
)
static

◆ min() [3/4]

Fixed & Fixed::min ( Fixed a,
Fixed b 
)
static

Static member function to find the minimum of two Fixed objects (non-const).

引数
aThe first Fixed object.
bThe second Fixed object.
戻り値
A reference to the smaller Fixed object.

Fixed.cpp199 行目に定義があります。

◆ min() [4/4]

static Fixed & Fixed::min ( Fixed a,
Fixed b 
)
static

◆ operator!=() [1/2]

bool Fixed::operator!= ( const Fixed other) const

Overloads the inequality operator.

引数
otherThe Fixed object to compare with.
戻り値
True if the current object is not equal to the other.

Fixed.cpp111 行目に定義があります。

◆ operator!=() [2/2]

bool Fixed::operator!= ( const Fixed other) const

◆ operator*() [1/2]

Fixed Fixed::operator* ( const Fixed other) const

Overloads the multiplication operator.

引数
otherThe Fixed object to multiply by.
戻り値
A new Fixed object representing the product.

Fixed.cpp134 行目に定義があります。

◆ operator*() [2/2]

Fixed Fixed::operator* ( const Fixed other) const

◆ operator+() [1/2]

Fixed Fixed::operator+ ( const Fixed other) const

Overloads the addition operator.

引数
otherThe Fixed object to add.
戻り値
A new Fixed object representing the sum.

Fixed.cpp120 行目に定義があります。

◆ operator+() [2/2]

Fixed Fixed::operator+ ( const Fixed other) const

◆ operator++() [1/4]

Fixed & Fixed::operator++ ( )

Overloads the pre-increment operator.

戻り値
A reference to the incremented Fixed object.

Fixed.cpp155 行目に定義があります。

◆ operator++() [2/4]

Fixed & Fixed::operator++ ( )

◆ operator++() [3/4]

Fixed Fixed::operator++ ( int  )

Overloads the post-increment operator.

引数
dummyInteger dummy parameter for postfix notation.
戻り値
A copy of the Fixed object before incrementing.

Fixed.cpp165 行目に定義があります。

◆ operator++() [4/4]

Fixed Fixed::operator++ ( int  )

◆ operator-() [1/2]

Fixed Fixed::operator- ( const Fixed other) const

Overloads the subtraction operator.

引数
otherThe Fixed object to subtract.
戻り値
A new Fixed object representing the difference.

Fixed.cpp127 行目に定義があります。

◆ operator-() [2/2]

Fixed Fixed::operator- ( const Fixed other) const

◆ operator--() [1/4]

Fixed & Fixed::operator-- ( )

Overloads the pre-decrement operator.

戻り値
A reference to the decremented Fixed object.

Fixed.cpp175 行目に定義があります。

◆ operator--() [2/4]

Fixed & Fixed::operator-- ( )

◆ operator--() [3/4]

Fixed Fixed::operator-- ( int  )

Overloads the post-decrement operator.

引数
dummyInteger dummy parameter for postfix notation.
戻り値
A copy of the Fixed object before decrementing.

Fixed.cpp185 行目に定義があります。

◆ operator--() [4/4]

Fixed Fixed::operator-- ( int  )

◆ operator/() [1/2]

Fixed Fixed::operator/ ( const Fixed other) const

Overloads the division operator.

引数
otherThe Fixed object to divide by.
戻り値
A new Fixed object representing the quotient, or max float on division by zero.

Fixed.cpp141 行目に定義があります。

◆ operator/() [2/2]

Fixed Fixed::operator/ ( const Fixed other) const

◆ operator<() [1/2]

bool Fixed::operator< ( const Fixed other) const

Overloads the less-than operator.

引数
otherThe Fixed object to compare with.
戻り値
True if the current object is less than the other.

Fixed.cpp83 行目に定義があります。

◆ operator<() [2/2]

bool Fixed::operator< ( const Fixed other) const

◆ operator<=() [1/2]

bool Fixed::operator<= ( const Fixed other) const

Overloads the less-than-or-equal-to operator.

引数
otherThe Fixed object to compare with.
戻り値
True if the current object is less than or equal to the other.

Fixed.cpp97 行目に定義があります。

◆ operator<=() [2/2]

bool Fixed::operator<= ( const Fixed other) const

◆ operator=() [1/4]

Fixed & Fixed::operator= ( const Fixed other)

Copy assignment operator.

Assigns the value of another Fixed object to the current object and prints a message.

引数
otherThe Fixed object to assign from.
戻り値
A reference to the current Fixed object.

Assigns the value of another Fixed object to the current object and prints a message.

引数
otherThe Fixed object to assign from.
戻り値
A reference to the current Fixed object.

< [copyAssignmentOperator] [copyAssignmentOperator]

Fixed.cpp52 行目に定義があります。

◆ operator=() [2/4]

Fixed & Fixed::operator= ( const Fixed other)

Copy assignment operator.

◆ operator=() [3/4]

Fixed & Fixed::operator= ( const Fixed other)

◆ operator=() [4/4]

Fixed & Fixed::operator= ( const Fixed other)

◆ operator==() [1/2]

bool Fixed::operator== ( const Fixed other) const

Overloads the equality operator.

引数
otherThe Fixed object to compare with.
戻り値
True if the current object is equal to the other.

Fixed.cpp104 行目に定義があります。

◆ operator==() [2/2]

bool Fixed::operator== ( const Fixed other) const

◆ operator>() [1/2]

bool Fixed::operator> ( const Fixed other) const

Overloads the greater-than operator.

引数
otherThe Fixed object to compare with.
戻り値
True if the current object is greater than the other.

Fixed.cpp76 行目に定義があります。

◆ operator>() [2/2]

bool Fixed::operator> ( const Fixed other) const

◆ operator>=() [1/2]

bool Fixed::operator>= ( const Fixed other) const

Overloads the greater-than-or-equal-to operator.

引数
otherThe Fixed object to compare with.
戻り値
True if the current object is greater than or equal to the other.

Fixed.cpp90 行目に定義があります。

◆ operator>=() [2/2]

bool Fixed::operator>= ( const Fixed other) const

◆ setRawBits() [1/4]

void Fixed::setRawBits ( int const  raw)

Sets the raw value of the fixed-point number.

Assigns a new integer value to the internal fixed-point representation.

引数
rawThe new raw integer value.

Fixed.cpp84 行目に定義があります。

◆ setRawBits() [2/4]

void Fixed::setRawBits ( int const  raw)

◆ setRawBits() [3/4]

void Fixed::setRawBits ( int const  raw)

◆ setRawBits() [4/4]

void Fixed::setRawBits ( int const  raw)

◆ toFloat() [1/3]

float Fixed::toFloat ( void  ) const

Converts the fixed-point value to a floating-point value.

戻り値
The floating-point representation of the fixed-point number.

< [toFloat_method] [toFloat_method]

Fixed.cpp92 行目に定義があります。

◆ toFloat() [2/3]

float Fixed::toFloat ( void  ) const

◆ toFloat() [3/3]

float Fixed::toFloat ( void  ) const

◆ toInt() [1/3]

int Fixed::toInt ( void  ) const

Converts the fixed-point value to an integer value (truncates the fractional part).

戻り値
The integer representation of the fixed-point number.

< [toInt_method] [toInt_method]

Fixed.cpp101 行目に定義があります。

◆ toInt() [2/3]

int Fixed::toInt ( void  ) const

◆ toInt() [3/3]

int Fixed::toInt ( void  ) const

このクラス詳解は次のファイルから抽出されました: