CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Cat.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* Cat.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/05/20 16:25:54 by kamitsui #+# #+# */
9/* Updated: 2025/06/03 23:33:20 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
21#ifndef CAT_HPP
22#define CAT_HPP
23
24#include "Animal.hpp" // Inherits from Animal
25#include "Brain.hpp"
26
34class Cat : public Animal {
35 private:
36 Brain *brain;
37
38 public:
39 Cat();
40 Cat(const Cat &other);
41 Cat &operator=(const Cat &other);
42 virtual ~Cat();
43
44 virtual void makeSound() const;
45 void meow() const;
46 Brain *getBrain() const;
47
48 private:
49 void swap(Cat &other);
50};
51
52#endif
The Animal class represents a generic animal.
Definition Animal.hpp:37
Represents the brain of an animal, holding a collection of ideas.
Definition Brain.hpp:37
The Cat class represents a feline animal.
Definition Cat.hpp:33
Cat(const Cat &other)
virtual ~Cat()
void meow() const
Brain * getBrain() const
Cat & operator=(const Cat &other)
virtual void makeSound() const
Makes a generic animal sound. This implementation is for the base Animal class. Derived classes are e...
Declares the abstract Animal base class.
Declares the Brain class.