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

📄 event.h

📁 经典数据结构书籍 数据结构C++语言描述 的源代码 很难找的哦
💻 H
字号:
#ifndef EVENT_CLASS
#define EVENT_CLASS

enum EventType {arrival, departure};

class Event                                         
{
    private:
        int time;
        EventType etype;
        int customerID;
        int tellerID;
        int waittime;
        int servicetime;
    public:
        Event(void);
        Event(int t, EventType et, int cn, int tn, int wt, int st);
        int GetTime(void);
        EventType GetEventType(void);
        int GetCustomerID(void);
        int GetTellerID(void);
        int GetWaitTime(void);
        int GetServiceTime(void);
};

Event::Event(void)  // default constructor - data filled by assignment later
{}

Event::Event(int t, EventType et, int cn, int tn, int wt, int st): 
                time(t), etype(et), customerID(cn), tellerID(tn),
                waittime (wt), servicetime(st) 
{}
    
int Event::GetTime(void)
{
    return time;
}
    
EventType Event::GetEventType(void)
{
    return etype;
}
    
int Event::GetCustomerID(void)
{
    return customerID;
}
    
int Event::GetTellerID(void)
{
    return tellerID;
}
    
int Event::GetWaitTime(void)
{
    return waittime;
}

int Event::GetServiceTime(void)
{
    return servicetime;
}

// compare two Event objects using the time at 
// which the events occur. needed for the
// priority queue

int operator< (Event e1, Event e2)
{
    return e1.GetTime() < e2.GetTime();
}


#endif  // EVENT_CLASS

⌨️ 快捷键说明

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