📄 status.hpp
字号:
// status.hpp An Object Error Status class, to be inherited by// classes that need it. Inherit this class as public VIRTUAL// Note: This class cannot be inherited by classes for which the// ! operator or a cast to an int would make sense// rcsid: @(#)status.hpp 1.1 13:33:52 10/14/93 EFC#ifndef STATUS_HPP_#define STATUS_HPP_ 1.1class ErrorStatus{ protected: int err_flag; virtual void set_flag(const int flag) { err_flag = flag; } virtual void reset_flag() { err_flag = 0; } ErrorStatus() : err_flag(0) {} public: virtual ~ErrorStatus() {} // getting the status of the object // the actual status flag virtual int status() { return err_flag; } // nonzero if good operator int() { return status() == 0; } // nonzero if bad int operator!() { return status() != 0; }};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -