📄 event.h
字号:
#ifndef EVENT_H
#define EVENT_H
#include <iostream.h>
#include "para.h"
class Event
{
public:
Event();
void setStrStp(double t);
void setInqStp(double t);
void setEndStp(double t);
double getStrStp();
double getInqStp();
double getEndStp();
friend ostream& operator<<(ostream& out, Event& e);
protected:
int type;
double strStp;
double inqStp;
double endStp;
};
Event::Event():strStp(0),inqStp(0),endStp(0){}
void Event::setStrStp(double t){strStp=t;}
void Event::setInqStp(double t){inqStp=t;}
void Event::setEndStp(double t){endStp=t;}
double Event::getStrStp(){return strStp;}
double Event::getInqStp(){return inqStp;}
double Event::getEndStp(){return endStp;}
ostream& operator<<(ostream& out, Event& e)
{
out<<"strStp: "<<e.getStrStp()<<"|"
<<"endStp: "<<e.getEndStp()<<"|";
return out;
}
///////////////////////////////////////////////////////////////////
class Mess
{
public:
Mess(int tp,double tm);
int getType();
double getTim();
int operator < (Mess& m);
friend ostream& operator<< (ostream& out,Mess& m);
private:
int type;
double tim;
};
Mess::Mess(int tp,double tm)
{
type=tp;
tim=tm;
}
int Mess::getType(){return type;}
double Mess::getTim(){return tim;}
int Mess::operator < (Mess& m)
{
if(tim<m.getTim())
return 1;
else
return -1;
}
ostream& operator<< (ostream& out,Mess& m)
{
out<<"Type: "<<m.getType()<<" "<<"Time: "<<m.getTim();
return out;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -