BAPS/packing/BP/Event.h

00001 /**********************************************************************
00002  *
00003  * Filename    : Event.h
00004  * Author      : Chen Li Wen
00005  *
00006  * Version     : 1.03
00007  * Date        : July 15, 1998
00008  *
00009  * Description : Interface file for class Event. Each Vessel has two 
00010  *               Events: the Arrive Event and the Departure Event.
00011  *
00012  * Reference   : nil
00013  *
00014  * Notes       : nil
00015  *
00016  * Changes     : DEPARTURE to DEPART; CLW, June 13, 1998.
00017  *
00018  * Copyright   : Copyright (c) 1998
00019  *               All rights reserved by
00020  *               Resource Allocation and Scheduling Group
00021  *               Department of Information Systems and Computer Science
00022  *               National University of Singapore
00023  *
00024  **********************************************************************/
00025 
00026 #ifndef __EVENT_H__
00027 #define __EVENT_H__
00028 
00029 #include "Vessel.h"
00030 #include "PackDef.h"
00031 #include "BAPBase.h"
00032 
00033 // Enumeration type for event type
00034 enum EventType
00035 {
00036    ARRIVE, 
00037    DEPART
00038 };
00039 
00040 class Event : public BAPBase
00041 {
00042    public:
00043       Event();
00044       Event(Vessel aVessel, EventType aDepartOrArrive);
00045       Event(const Event& aEvent);
00046       ~Event();
00047 
00048       // Assignment operator =
00049       Event&    operator=(const Event& aEvent);
00050       
00051       // Debugger facility. if aDetail is greater than 0,
00052       // it will print detail information about the vessel 
00053       // belonged to.
00054       void      Print(int aWidth = 1, int aDetail = 0) const;
00055       
00056       // Determine the Event Type
00057       Bool      IsArrive() const;
00058       Bool      IsDepart() const;
00059       
00060       // Access functions
00061       Vessel    GetVessel() const;
00062       int       GetTime() const;
00063       int       GetSize() const;
00064 
00065       // Modification functions
00066       void      SetTime(int aTime);
00067       void      SetSize(int aSize);
00068 
00069       // Functions for comparing different Events
00070    friend int      compare(const Event& aLEvent, const Event& aREvent);
00071    friend ostream& operator<<(ostream& aOutput, const Event& aEvent);
00072    friend istream& operator>>(istream& aInput, Event& aEvent);
00073    
00074    private:
00075       Vessel    mVessel;
00076       EventType mEventType;
00077       int       mTime;
00078       int       mSize;
00079 };
00080 
00081 #endif

Generated on Tue Sep 9 15:40:10 2008 for BAP by  doxygen 1.5.3