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

The WrongCat class represents a feline animal in the "wrong" hierarchy. [詳解]

#include <WrongCat.hpp>

WrongCat の継承関係図
Inheritance graph
WrongCat 連携図
Collaboration graph

公開メンバ関数

 WrongCat ()
 Default constructor for WrongCat. Calls the WrongAnimal base class constructor and sets the type to "WrongCat". Displays a specific construction message.
 
 WrongCat (const WrongCat &other)
 Copy constructor for WrongCat. Calls the WrongAnimal base class copy constructor. Displays a specific copy construction message.
 
WrongCatoperator= (const WrongCat &other)
 Makes the characteristic sound of a WrongCat ("Wrong meow!").
 
virtual ~WrongCat ()
 Destructor for WrongCat. Displays a specific destruction message.
 
void makeSound () const
 Makes the characteristic sound of a WrongCat ("Wrong meow!").
 
 WrongCat ()
 
 WrongCat (const WrongCat &other)
 
WrongCatoperator= (const WrongCat &other)
 
virtual ~WrongCat ()
 
void makeSound () const
 
 WrongCat ()
 
 WrongCat (const WrongCat &other)
 
WrongCatoperator= (const WrongCat &other)
 
virtual ~WrongCat ()
 
void makeSound () const
 
- 基底クラス WrongAnimal に属する継承公開メンバ関数
 WrongAnimal ()
 Default constructor for WrongAnimal. Initializes the type to "Generic WrongAnimal". Displays a construction message for clarity.
 
 WrongAnimal (const WrongAnimal &other)
 Copy constructor for WrongAnimal. Copies the type from the other WrongAnimal object. Displays a copy construction message.
 
WrongAnimaloperator= (const WrongAnimal &other)
 Copy assignment operator for WrongAnimal. Assigns the type from the other WrongAnimal object. Handles self-assignment to prevent issues. Displays a copy assignment message.
 
virtual ~WrongAnimal ()
 Destructor for WrongAnimal. Displays a destruction message. Note: Declared virtual in the header to ensure proper cleanup even if makeSound() isn't virtual.
 
void makeSound () const
 Makes a generic sound for a WrongAnimal. This function is intentionally NOT VIRTUAL to show the lack of runtime polymorphism when called via a base class pointer.
 
const std::stringgetType () const
 Gets the type of the WrongAnimal.
 
 WrongAnimal ()
 
 WrongAnimal (const WrongAnimal &other)
 
WrongAnimaloperator= (const WrongAnimal &other)
 
virtual ~WrongAnimal ()
 
void makeSound () const
 
const std::stringgetType () const
 
 WrongAnimal ()
 
 WrongAnimal (const WrongAnimal &other)
 
WrongAnimaloperator= (const WrongAnimal &other)
 
virtual ~WrongAnimal ()
 
void makeSound () const
 
const std::stringgetType () const
 

その他の継承メンバ

- 基底クラス WrongAnimal に属する継承限定公開変数類
std::string type
 

詳解

The WrongCat class represents a feline animal in the "wrong" hierarchy.

This class inherits from WrongAnimal and attempts to provide its own sound. However, due to makeSound() in WrongAnimal not being virtual, the specific WrongCat::makeSound() will NOT be called polymorphically when accessed via a WrongAnimal pointer.

WrongCat.hpp34 行目に定義があります。

構築子と解体子

◆ WrongCat() [1/6]

WrongCat::WrongCat ( )

Default constructor for WrongCat. Calls the WrongAnimal base class constructor and sets the type to "WrongCat". Displays a specific construction message.

WrongCat.cpp28 行目に定義があります。

◆ WrongCat() [2/6]

WrongCat::WrongCat ( const WrongCat other)

Copy constructor for WrongCat. Calls the WrongAnimal base class copy constructor. Displays a specific copy construction message.

引数
otherThe WrongCat object to copy from.

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

◆ ~WrongCat() [1/3]

WrongCat::~WrongCat ( )
virtual

Destructor for WrongCat. Displays a specific destruction message.

WrongCat.cpp63 行目に定義があります。

◆ WrongCat() [3/6]

WrongCat::WrongCat ( )

◆ WrongCat() [4/6]

WrongCat::WrongCat ( const WrongCat other)

◆ ~WrongCat() [2/3]

virtual WrongCat::~WrongCat ( )
virtual

◆ WrongCat() [5/6]

WrongCat::WrongCat ( )

◆ WrongCat() [6/6]

WrongCat::WrongCat ( const WrongCat other)

◆ ~WrongCat() [3/3]

virtual WrongCat::~WrongCat ( )
virtual

関数詳解

◆ makeSound() [1/3]

void WrongCat::makeSound ( ) const

Makes the characteristic sound of a WrongCat ("Wrong meow!").

This function attempts to override makeSound(), but because the base WrongAnimal::makeSound() is not virtual, this specific implementation will only be called when invoked directly on a WrongCat object, not polymorphically through a WrongAnimal pointer.

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

◆ makeSound() [2/3]

void WrongCat::makeSound ( ) const

◆ makeSound() [3/3]

void WrongCat::makeSound ( ) const

◆ operator=() [1/3]

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

Makes the characteristic sound of a WrongCat ("Wrong meow!").

This function attempts to override makeSound(), but because the base WrongAnimal::makeSound() is not virtual, this specific implementation will only be called when invoked directly on a WrongCat object, not polymorphically through a WrongAnimal pointer.

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

◆ operator=() [2/3]

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

◆ operator=() [3/3]

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

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