1/*
2 Copyright(C) 2005
3 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4
5 Permission to use, copy, modify, and distribute this
6 software and its documentation for EDUCATIONAL purposes
7 and without fee is hereby granted provided that this
8 copyright notice appears in all copies.
9
10 date : September 1, 2005.
11 author : Austin W. Westfall, Salih Yurttas.
12
13 consumer.h
14*/
15
16
17#ifndef CONSUMER_H
18#define CONSUMER_H
19
20#include <string>
21
22using namespace std;
23
24#include "thread.h"
25#include "cubby_hole.cpp"
26
27class consumer : public thread {
28public:
29 consumer(cubby_hole<int>* c,
30 const int cid) : ch(c),
31 id(cid),
32 num_items(0) {}
33 void consume(int);
34
35private:
36 cubby_hole<int>* ch;
37 int id;
38 int num_items;
39 virtual void run();
40};
41#endif