-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorderedContainer.cpp
More file actions
38 lines (31 loc) · 936 Bytes
/
orderedContainer.cpp
File metadata and controls
38 lines (31 loc) · 936 Bytes
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
// Implement non-pure virtual functions of OrderedContainer here
#include <iostream>
#include <typeinfo>
using namespace std;
template <class T>
OrderedContainer<T>::OrderedContainer(LinearStructure<T>* c){
this->dataStructure = c->clone();
}
template <class T>
OrderedContainer<T>::OrderedContainer(const OrderedContainer<T>& other){
this->dataStructure = other.dataStructure->clone();
}
template <class T>
OrderedContainer<T>& OrderedContainer<T>::operator=(const OrderedContainer<T>& other){
this->dataStructure = other.dataStructure->clone();
return *this;
}
template <class T>
OrderedContainer<T>::~OrderedContainer(){
this->dataStructure->clear();
delete this->dataStructure;
this->dataStructure = NULL;
}
template <class T>
bool OrderedContainer<T>::isEmpty(){
return this->dataStructure->isEmpty();
}
template <class T>
LinearStructure<T>* OrderedContainer<T>::getImplementation(){
return this->dataStructure;
}