📄 warcps.h
字号:
/** */#ifndef WAR_CPS_H#define WAR_CPS_H/* SYSTEM INCLUDES */#ifndef WAR_LIST_INCLUDED# define WAR_LIST_INCLUDED# include <list>#endif/* PROJECT INCLUDES */#ifndef WAR_CPS_TIMESTAMP_H# include "WarCpsTimestamp.h"#endif/* LOCAL INCLUDES *//* FORWARD REFERENCES */#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********//****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplusclass WarCps {public: typedef std::list<WarCpsTimestamp> sample_list_t; // LIFECYCLE /** * Default constructor. */ WarCps(const unsigned delayMs, const unsigned holdMs, const unsigned minCnt, const unsigned maxCnt, const unsigned minCps, const unsigned maxCps); /** * Copy constructor. * * @param from The value to copy to this object. */ WarCps(const WarCps& from); /** * Destructor. */ ~WarCps(); // OPERATORS /** * Assignment operator. * * @param from THe value to assign to this object. * * @return A reference to this object. */ WarCps& operator=(WarCps& from); // OPERATIONS /** Get the current cps. * * @returns The current cps, or -1 if * the samplet data is insuffient to * calculate the cps. */ int GetCps(); /// bool IsOverLimit(); /// bool IsUnderLimit(); /// void Record(const war_flen_t& bytes); // CALLBACK // ACCESS // INQUIRY WarTime GetNextCpsTime();protected:private: unsigned mDelayMs; // Sample rate unsigned mHoldMs; // Extra time between timer events unsigned mMinCnt; unsigned mMaxCnt; unsigned mMinCps; unsigned mMaxCps; sample_list_t mSamples; war_flen_t mBytesRecorded;};/* INLINE METHODS *//* EXTERNAL REFERENCES */#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif /* WAR_CPS_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -