1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
class StockList //stock list
{
public:
StockList();
~StockList();
int getLengthStock() const;
int getLengthWait() const;
void LoadDVDList(string filename); // read dvd file
void LoadWaitList(string filename); // read dvd file
void Retrieve(int index,string& ID,string& title,int& year,int& have,int& want);
void RetrieveWaitList(StockList& aLis,int index,string& who);
private:
class StockItem //stock item
{
public:
StockItem();
~StockItem();
void Set_Data(string ID,string title,int year,int have,int want);
string Get_ID();
string Get_title();
int Get_year();
int Get_have();
int Get_want();
private:
string ID;
string title;
int year, have, want;
};
struct WaitNode
{
string ID;
string who;
WaitNode *next;
};
int wsize;
WaitNode *whead;
WaitNode *find_wait(int index) const;
/********************************/
struct StockNode //node for inventory list of stock items
{
StockItem item;
WaitNode *waitHead,*waitTail;
StockNode *next;
};
int size;
StockNode *head; // pointer to first stock node on the list
StockNode *find(int index) const;
};
|