⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timevalue.h

📁 dcom机制在vxworks上的实现源代码
💻 H
字号:
/* TimeValue - Encapsulates a time value *//* Copyright (c) 1999 Wind River Systems, Inc. *//*modification history--------------------01c,10dec01,dbs  diab build01b,19jan00,nel  Modifications for Linux debug build01a,08Jul99,aim  created*/#ifndef __INCTimeValue_h#define __INCTimeValue_h#include "time.h"#ifdef VXDCOM_PLATFORM_VXWORKS#include "sys/times.h"#endif#ifdef VXDCOM_PLATFORM_LINUX#include "sys/time.h"#endif#include <iostream>class TimeValue    {  public:    virtual ~TimeValue ();    TimeValue ();    TimeValue (const timeval& tv);    TimeValue (long sec, long usec = 0);    TimeValue& operator += (const TimeValue &rhs);    TimeValue& operator -= (const TimeValue &rhs);    friend const TimeValue operator +	(	const TimeValue &lhs,	const TimeValue &rhs	);    friend const TimeValue operator -	(	const TimeValue &lhs,	const TimeValue &rhs	);    friend int operator >	(	const TimeValue &tv1,	const TimeValue &tv2	);    friend int operator <	(	const TimeValue &tv1,	const TimeValue &tv2	);    friend int operator <=	(	const TimeValue &tv1,	const TimeValue &tv2	);    friend int operator >=	(	const TimeValue &tv1,	const TimeValue &tv2	);    friend int operator ==	(	const TimeValue &tv1,	const TimeValue &tv2	);    friend int operator !=	(	const TimeValue &tv1,	const TimeValue &tv2	);    friend ostream& operator <<	(	ostream& os,	const TimeValue&	);    long sec () const;    long usec () const;    void set (const timeval&);    void set (int, int);    operator timeval () const;    operator const timeval* () const;    operator timeval* ();    static const TimeValue  now ();    static const TimeValue& zero ();  private:    void normalize ();    // Put the timevalue into a canonical form.    timeval m_tv;    };#endif // __INCTimeValue_h

⌨️ 快捷键说明

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