status.hpp

来自「卡尔曼滤波类」· HPP 代码 · 共 44 行

HPP
44
字号
// 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//                      (c) Copyright 1995, Everett F. Carter Jr.//                      Permission is granted by the author to use//			this software for any application provided this//			copyright notice is preserved.// 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(void)        { return status() == 0; }          // nonzero if bad          int operator!(void)       { return status() != 0; }};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?