X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=iotjava%2Fiotruntime%2Fcpp%2Fsetrelation%2FIRelation.hpp;fp=iotjava%2Fiotruntime%2Fcpp%2Fsetrelation%2FIRelation.hpp;h=0000000000000000000000000000000000000000;hb=39563ab07eb793e7be02984f6ab5604f82bfc0c4;hp=17be57218c39fda02bed654fddaa48ac0a0727fa;hpb=ffea2cb68e5a2e1bac041fe2279620eba8d227f8;p=iot2.git diff --git a/iotjava/iotruntime/cpp/setrelation/IRelation.hpp b/iotjava/iotruntime/cpp/setrelation/IRelation.hpp deleted file mode 100644 index 17be572..0000000 --- a/iotjava/iotruntime/cpp/setrelation/IRelation.hpp +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef _IRELATION_HPP__ -#define _IRELATION_HPP__ -#include -#include -#include - -using namespace std; - -/** This is the IoTRelation implementation for C++ - * - * @author Rahmadi Trimananda - * @version 1.0 - * @since 2016-09-06 - */ -template -class IRelation final { - private: - unordered_multimap* rel; - public: - IRelation(); - IRelation(unordered_multimap const* r); - ~IRelation(); - public: - typename unordered_multimap::const_iterator find(const K& k); // Find the object based on key - typename unordered_multimap::const_iterator insert(const pair& val); // Insert the object pair - bool empty(); // Test is empty? - typename unordered_multimap::const_iterator begin(); // Iterator - typename unordered_multimap::const_iterator end(); // Iterator - std::pair::const_iterator, - typename unordered_multimap::const_iterator> - equal_range(const K& k); // Equal range iterator - int size(); // Set size - unordered_multimap values(); // Return set contents -}; - - -/** - * Default constructor - */ -template -IRelation::IRelation() { - - rel = new unordered_multimap(); -} - - -/** - * Useful constructor - */ -template -IRelation::IRelation(const unordered_multimap* r) { - - rel = r; -} - - -/** - * Default destructor - */ -template -IRelation::~IRelation() { - - if (rel != NULL) - delete rel; -} - - -/** - * Find the object k in the set - */ -template -typename unordered_multimap::const_iterator IRelation::find(const K& k) { - - return rel->find(k); -} - - -/** - * Insert object k into the set - */ -template -typename unordered_multimap::const_iterator IRelation::insert(const pair& val) { - - return rel->insert(val); -} - - -/** - * Return the "begin" iterator - */ -template -typename unordered_multimap::const_iterator IRelation::begin() { - - return rel->begin(); -} - - -/** - * Return the "end" iterator - */ -template -typename unordered_multimap::const_iterator IRelation::end() { - - return rel->end(); -} - - -/** - * Return the "equal_range" iterator - */ -template -std::pair::const_iterator, - typename unordered_multimap::const_iterator> - IRelation::equal_range(const K& k) { - - return rel->equal_range(k); -} - - -/** - * Return the size of the set - */ -template -int IRelation::size() { - - return rel->size(); -} - - -/** - * Return a new copy of the set - */ -template -unordered_multimap IRelation::values() { - - return rel; -} -#endif - - - -