CPP05/ex03/inc/ShrubberyCreationForm.hpp
whaffman f916d5cb2f Refactor Bureaucrat and Form classes to implement move semantics and improve exception handling
- Added move constructors and move assignment operators to Bureaucrat and Form classes.
- Updated constructors and destructors to include logging for move operations.
- Enhanced Bureaucrat class with an executeForm method to handle form execution.
- Refactored color definitions in colors.h for better organization and clarity.
- Removed redundant macro definitions and improved code readability.
- Updated main functions to utilize new executeForm method for better exception handling.
- Ensured proper handling of copy and move semantics across all relevant classes.
2026-03-27 19:54:54 +01:00

35 lines
949 B
C++

#pragma once
#include <iostream>
#include <string>
#include "AForm.hpp"
class ShrubberyCreationForm : public AForm
{
private:
const std::string _target;
public:
// Constructors
ShrubberyCreationForm() = delete;
ShrubberyCreationForm(std::string target);
// Copy constructor and copy assignment operator
ShrubberyCreationForm(const ShrubberyCreationForm &other);
ShrubberyCreationForm &operator=(const ShrubberyCreationForm &other) =
delete;
// Move constructor and move assignment operator
ShrubberyCreationForm(ShrubberyCreationForm &&other) noexcept;
ShrubberyCreationForm &operator=(ShrubberyCreationForm &&other) noexcept =
delete;
// Destructor
~ShrubberyCreationForm();
void execute(const Bureaucrat &executor) const override;
const std::string getTarget() const;
};
std::ostream &operator<<(std::ostream &os, const ShrubberyCreationForm &form);