mirror of
https://github.com/13hannes11/UU_la_parallel_programming_practical_assignments.git
synced 2024-09-04 00:50:58 +02:00
names of sets are now displayed properly
This commit is contained in:
@@ -14,7 +14,7 @@ class FineSet:public Set {
|
|||||||
bool ctn(int element);
|
bool ctn(int element);
|
||||||
};
|
};
|
||||||
|
|
||||||
FineSet::FineSet() : Set() { }
|
FineSet::FineSet() : Set("FineSet") { }
|
||||||
|
|
||||||
bool FineSet::add(int element) {
|
bool FineSet::add(int element) {
|
||||||
this->first->lock();
|
this->first->lock();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class LazySet:public Set {
|
|||||||
bool ctn(int element);
|
bool ctn(int element);
|
||||||
};
|
};
|
||||||
|
|
||||||
LazySet::LazySet() : Set() { }
|
LazySet::LazySet() : Set("LazySet") { }
|
||||||
|
|
||||||
bool LazySet::add(int element) {
|
bool LazySet::add(int element) {
|
||||||
Node* p;
|
Node* p;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class OptimisticSet:public Set {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
OptimisticSet::OptimisticSet() : Set() { }
|
OptimisticSet::OptimisticSet() : Set("OptimisticSet") { }
|
||||||
|
|
||||||
bool OptimisticSet::add(int element) {
|
bool OptimisticSet::add(int element) {
|
||||||
Node* p;
|
Node* p;
|
||||||
|
|||||||
@@ -4,16 +4,20 @@
|
|||||||
|
|
||||||
class Set {
|
class Set {
|
||||||
protected:
|
protected:
|
||||||
Set();
|
std::string name;
|
||||||
|
Set(std::string _name);
|
||||||
Node* first;
|
Node* first;
|
||||||
public:
|
public:
|
||||||
bool add(int element) { return false; };
|
bool add(int element) { return false; };
|
||||||
bool rmv(int element) { return false; };
|
bool rmv(int element) { return false; };
|
||||||
bool ctn(int element) { return false; };
|
bool ctn(int element) { return false; };
|
||||||
|
std::string get_name() { return name; };
|
||||||
};
|
};
|
||||||
|
|
||||||
Set::Set(){
|
Set::Set(std::string _name){
|
||||||
|
name = _name;
|
||||||
first = Node::Dummy();
|
first = Node::Dummy();
|
||||||
Node* last = Node::Dummy();
|
Node* last = Node::Dummy();
|
||||||
first->next = last;
|
first->next = last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ void benchmark(int minVal, int maxVal, benchmark_type b_type, int i){
|
|||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
for (Set* set : sets) {
|
for (Set* set : sets) {
|
||||||
std::cout << typeid(set).name();
|
std::cout << set->get_name();
|
||||||
|
|
||||||
for (int thread_count : thread_counts) {
|
for (int thread_count : thread_counts) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user