Perfecting IoTSlave for C++; Found one issue with SSH/Java process execution in which...
[iot2.git] / iotjava / iotruntime / cpp / setrelation / IoTSet.hpp
index 78d8c63f2b49a8d7db1fcfb3aa7ddad4da6a55ad..60f34f757d4d3a40026c3add2a164bb4804343fe 100644 (file)
@@ -15,10 +15,10 @@ using namespace std;
 template <class T>
 class IoTSet {
        private:
-               unordered_set<T> set;
+               const unordered_set<T>* set;
        public:
                IoTSet();
-               IoTSet(unordered_set<T> const& s);
+               IoTSet(const unordered_set<T>* s);
                ~IoTSet();
        public:
                typename unordered_set<T>::const_iterator find(const T& k);     // Find the object
@@ -43,7 +43,7 @@ IoTSet<T>::IoTSet() {
  * Useful constructor
  */
 template <class T>
-IoTSet<T>::IoTSet(const unordered_set<T>& s) {
+IoTSet<T>::IoTSet(const unordered_set<T>* s) {
 
        set = s;
 }
@@ -64,7 +64,7 @@ IoTSet<T>::~IoTSet() {
 template <class T>
 typename unordered_set<T>::const_iterator IoTSet<T>::find(const T& k) {
 
-       return set.find(k);
+       return set->find(k);
 }
 
 
@@ -74,7 +74,7 @@ typename unordered_set<T>::const_iterator IoTSet<T>::find(const T& k) {
 template <class T>
 typename unordered_set<T>::const_iterator IoTSet<T>::begin() {
 
-       return set.begin();
+       return set->begin();
 }
 
 
@@ -84,7 +84,7 @@ typename unordered_set<T>::const_iterator IoTSet<T>::begin() {
 template <class T>
 typename unordered_set<T>::const_iterator IoTSet<T>::end() {
 
-       return set.end();
+       return set->end();
 }
 
 
@@ -94,7 +94,7 @@ typename unordered_set<T>::const_iterator IoTSet<T>::end() {
 template <class T>
 int IoTSet<T>::size() {
 
-       return set.size();
+       return set->size();
 }
 
 
@@ -104,7 +104,7 @@ int IoTSet<T>::size() {
 template <class T>
 unordered_set<T>* IoTSet<T>::values() {
 
-       return new unordered_set<T>(set);
+       return new unordered_set<T>(*set);
 }
 #endif