5 #include <unordered_set>
9 /** This is the IoTSet implementation for C++
11 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
18 const unordered_set<T>* set;
21 IoTSet(const unordered_set<T>* s);
24 typename unordered_set<T>::const_iterator find(const T& k); // Find the object
25 bool empty(); // Test is empty?
26 typename unordered_set<T>::const_iterator begin(); // Iterator
27 typename unordered_set<T>::const_iterator end(); // Iterator
28 int size(); // Set size
29 unordered_set<T>* values(); // Return set contents
46 IoTSet<T>::IoTSet(const unordered_set<T>* s) {
56 IoTSet<T>::~IoTSet() {
62 * Find the object k in the set
65 typename unordered_set<T>::const_iterator IoTSet<T>::find(const T& k) {
67 return (new unordered_set<T>(*set))->find(k);
72 * Return the "begin" iterator
75 typename unordered_set<T>::const_iterator IoTSet<T>::begin() {
77 return (new unordered_set<T>(*set))->begin();
82 * Return the "end" iterator
85 typename unordered_set<T>::const_iterator IoTSet<T>::end() {
87 return (new unordered_set<T>(*set))->end();
92 * Return the size of the set
95 int IoTSet<T>::size() {
102 * Return a new copy of the set
105 unordered_set<T>* IoTSet<T>::values() {
107 return new unordered_set<T>(*set);