Problem with template class and constructor

Hello

I have facing a problem since 3 days about inheritence in constructor with template class :

here is my code

waitingCustomerQueueType.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef WAITINGCUSTOMERQUEUETYPE_H
#define WAITINGCUSTOMERQUEUETYPE_H
#include "JobType.h"
#include "QueType.h"


class waitingCustomerQueueType : public QueType <JobType>
{
    public:
        waitingCustomerQueueType(int);
      //  virtual ~waitingCustomerQueueType();

    protected:

    private:
};

#endif // WAITINGCUSTOMERQUEUETYPE_H 


waitingCustomerQueueType.cpp

1
2
3
4
5
6
7
8
9
10
11
#include "waitingCustomerQueueType.h"

waitingCustomerQueueType::waitingCustomerQueueType(int taille) : QueType <JobType> :: QueType(taille)
{
    //ctor
}

/*waitingCustomerQueueType::~waitingCustomerQueueType()
{
    //dtor
}*/


QueType.cpp

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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include "QueType.h"

template<class ItemType>
QueType<ItemType>::QueType(int max)
// Paramaterized class constructor
// Post: maxQue, front, and rear have been initialized.
//       The array to hold the queue elements has been dynamically allocated.
{
    maxQue = max + 1;
    front = maxQue - 1;
    rear = maxQue - 1;
    size = 0;
    items = new ItemType[maxQue];
}

template<class ItemType>
QueType<ItemType>::QueType()		// Default class constructor
// Post: maxQue, front, and rear have been initialized.
//       The array to hold the queue elements has been dynamically allocated.

{
    maxQue = 501;
    front = maxQue - 1;
    rear = maxQue - 1;
    size = 0;
    items = new ItemType[maxQue];
}

template<class ItemType>
QueType<ItemType>::~QueType()			// Class destructor
{
    delete [] items;
}

template<class ItemType>
void QueType<ItemType>::MakeEmpty()
// Post: front and rear have been reset to the empty state
//       and size has been set to zero.
{
    front = maxQue - 1;
    rear = maxQue - 1;
    size = 0;
}

template<class ItemType>
bool QueType<ItemType>::IsEmpty() const
// Returns true if the queue is empty; false otherwise.
{
    return (rear == front);
}

template<class ItemType>
bool QueType<ItemType>::IsFull() const
// Returns true if the queue is full; false otherwise.
{
    return ((rear + 1) % maxQue == front);
}

template<class ItemType>
void QueType<ItemType>::Enqueue(ItemType newItem)
// Post: newItem is at the rear of the queue.
{
    rear = (rear +1) % maxQue;
    items[rear] = newItem;
    size++;
}

template<class ItemType>
void QueType<ItemType>::Dequeue(ItemType& item)
// Post: The front of the queue has been removed and a copy returned in item.
{
    front = (front + 1) % maxQue;
    item = items[front];
    size--;
}

template<class ItemType>
int QueType<ItemType>::QueSize() const
{
	return size;

}



my error is here : indefined reference to <JobType>::QueType(taille)

in the waitingCustomerQueueType.cpp
Thank you in advacnce
Last edited on
Topic archived. No new replies allowed.