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

Represents a bureaucrat with a name and a grade. [詳解]

#include <Bureaucrat.hpp>

Bureaucrat 連携図
Collaboration graph

クラス

class  GradeTooHighException
 
class  GradeTooLowException
 

公開メンバ関数

 Bureaucrat (const std::string &name, int grade)
 Construct a new Bureaucrat:: Bureaucrat object
 
 Bureaucrat (const Bureaucrat &other)
 Copy constructor for Bureaucrat.
 
Bureaucratoperator= (const Bureaucrat &other)
 Assignment operator for Bureaucrat.
 
 ~Bureaucrat ()
 Destroy the Bureaucrat:: Bureaucrat object
 
const std::stringgetName () const
 Gets the name of the Bureaucrat.
 
int getGrade () const
 Gets the grade of the Bureaucrat.
 
void incrementGrade ()
 Increments the bureaucrat's grade (e.g., from 3 to 2).
 
void decrementGrade ()
 Decrements the bureaucrat's grade (e.g., from 2 to 3).
 
 Bureaucrat (const std::string &name, int grade)
 
 Bureaucrat (const Bureaucrat &other)
 
Bureaucratoperator= (const Bureaucrat &other)
 
 ~Bureaucrat ()
 
const std::stringgetName () const
 
int getGrade () const
 
void incrementGrade ()
 
void decrementGrade ()
 
void signForm (Form &form)
 Attempts to sign a form. Calls the form's beSigned method and prints the result.
 
 Bureaucrat (const std::string &name, int grade)
 
 Bureaucrat (const Bureaucrat &other)
 
Bureaucratoperator= (const Bureaucrat &other)
 
 ~Bureaucrat ()
 
const std::stringgetName () const
 
int getGrade () const
 
void incrementGrade ()
 
void decrementGrade ()
 
void signForm (AForm &form)
 
void executeForm (AForm const &form)
 Attempts to execute a form. Calls the form's execute method and prints the result.
 
 Bureaucrat (const std::string &name, int grade)
 
 Bureaucrat (const Bureaucrat &other)
 
Bureaucratoperator= (const Bureaucrat &other)
 
 ~Bureaucrat ()
 
const std::stringgetName () const
 
int getGrade () const
 
void incrementGrade ()
 
void decrementGrade ()
 
void signForm (AForm &form)
 
void executeForm (AForm const &form)
 

詳解

Represents a bureaucrat with a name and a grade.

Represents a bureaucrat who can sign and execute forms.

Represents a bureaucrat who can sign forms.

The grade ranges from 1 (highest) to 150 (lowest).

Bureaucrat.hpp30 行目に定義があります。

構築子と解体子

◆ Bureaucrat() [1/8]

Bureaucrat::Bureaucrat ( const std::string name,
int  grade 
)

Construct a new Bureaucrat:: Bureaucrat object

引数
nameThe name of the bureaucrat.
gradeThe grade of the bureaucrat (1-150).
例外
Bureaucrat::GradeTooHighExceptionif grade is less than 1.
Bureaucrat::GradeTooLowExceptionif grade is greater than 150.

Bureaucrat.cpp29 行目に定義があります。

◆ Bureaucrat() [2/8]

Bureaucrat::Bureaucrat ( const Bureaucrat other)

Copy constructor for Bureaucrat.

引数
otherThe Bureaucrat to copy.

Bureaucrat.cpp44 行目に定義があります。

◆ ~Bureaucrat() [1/4]

Bureaucrat::~Bureaucrat ( )

Destroy the Bureaucrat:: Bureaucrat object

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

◆ Bureaucrat() [3/8]

Bureaucrat::Bureaucrat ( const std::string name,
int  grade 
)

◆ Bureaucrat() [4/8]

Bureaucrat::Bureaucrat ( const Bureaucrat other)

◆ ~Bureaucrat() [2/4]

Bureaucrat::~Bureaucrat ( )

◆ Bureaucrat() [5/8]

Bureaucrat::Bureaucrat ( const std::string name,
int  grade 
)

◆ Bureaucrat() [6/8]

Bureaucrat::Bureaucrat ( const Bureaucrat other)

◆ ~Bureaucrat() [3/4]

Bureaucrat::~Bureaucrat ( )

◆ Bureaucrat() [7/8]

Bureaucrat::Bureaucrat ( const std::string name,
int  grade 
)

◆ Bureaucrat() [8/8]

Bureaucrat::Bureaucrat ( const Bureaucrat other)

◆ ~Bureaucrat() [4/4]

Bureaucrat::~Bureaucrat ( )

関数詳解

◆ decrementGrade() [1/4]

void Bureaucrat::decrementGrade ( )

Decrements the bureaucrat's grade (e.g., from 2 to 3).

例外
Bureaucrat::GradeTooLowExceptionif grade is already 150.

Bureaucrat.cpp99 行目に定義があります。

◆ decrementGrade() [2/4]

void Bureaucrat::decrementGrade ( )

◆ decrementGrade() [3/4]

void Bureaucrat::decrementGrade ( )

◆ decrementGrade() [4/4]

void Bureaucrat::decrementGrade ( )

◆ executeForm() [1/2]

void Bureaucrat::executeForm ( AForm const &  form)

Attempts to execute a form. Calls the form's execute method and prints the result.

引数
formThe form to be executed.

Bureaucrat.cpp70 行目に定義があります。

◆ executeForm() [2/2]

void Bureaucrat::executeForm ( AForm const &  form)

◆ getGrade() [1/4]

int Bureaucrat::getGrade ( ) const

Gets the grade of the Bureaucrat.

戻り値
The current grade.

Bureaucrat.cpp79 行目に定義があります。

◆ getGrade() [2/4]

int Bureaucrat::getGrade ( ) const

◆ getGrade() [3/4]

int Bureaucrat::getGrade ( ) const

◆ getGrade() [4/4]

int Bureaucrat::getGrade ( ) const

◆ getName() [1/4]

const std::string & Bureaucrat::getName ( ) const

Gets the name of the Bureaucrat.

戻り値
A constant reference to the name.

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

◆ getName() [2/4]

const std::string & Bureaucrat::getName ( ) const

◆ getName() [3/4]

const std::string & Bureaucrat::getName ( ) const

◆ getName() [4/4]

const std::string & Bureaucrat::getName ( ) const

◆ incrementGrade() [1/4]

void Bureaucrat::incrementGrade ( )

Increments the bureaucrat's grade (e.g., from 3 to 2).

例外
Bureaucrat::GradeTooHighExceptionif grade is already 1.

Bureaucrat.cpp87 行目に定義があります。

◆ incrementGrade() [2/4]

void Bureaucrat::incrementGrade ( )

◆ incrementGrade() [3/4]

void Bureaucrat::incrementGrade ( )

◆ incrementGrade() [4/4]

void Bureaucrat::incrementGrade ( )

◆ operator=() [1/4]

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

Assignment operator for Bureaucrat.

覚え書き
The constant name is not copied. Only the grade is assigned.
引数
otherThe Bureaucrat to assign from.
戻り値
A reference to the assigned Bureaucrat.

Bureaucrat.cpp54 行目に定義があります。

◆ operator=() [2/4]

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

◆ operator=() [3/4]

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

◆ operator=() [4/4]

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

◆ signForm() [1/3]

void Bureaucrat::signForm ( AForm form)

Bureaucrat.cpp56 行目に定義があります。

◆ signForm() [2/3]

void Bureaucrat::signForm ( AForm form)

◆ signForm() [3/3]

void Bureaucrat::signForm ( Form form)

Attempts to sign a form. Calls the form's beSigned method and prints the result.

引数
formThe form to be signed.

Bureaucrat.cpp68 行目に定義があります。


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