3 #include "IoTRelation.hpp"
9 unordered_set<string> myset = { "red","green","blue" };
11 IoTSet<string> iotset(&myset);
13 unordered_set<string>::const_iterator got = iotset.find ("red");
15 if ( got == iotset.end() )
16 cout << "not found in myset" << endl;
18 cout << *got << " is in myset" << endl;
20 cout << "size: " << iotset.size() << endl;
22 unordered_multimap<string,string> mymap = {
28 unordered_set<string>* retset = iotset.values();
29 cout << "Returned set: " << retset->size() << endl;
31 cout << "Returned set: " << retset->size() << endl;
32 cout << "Original set: " << myset.size() << endl;
34 //cout << "one of the values for 'mom' is: ";
35 //cout << mymap.find("mom")->second;
37 IoTRelation<string,string> iotrel(&mymap);
39 std::pair<unordered_multimap<string,string>::const_iterator,
40 unordered_multimap<string,string>::const_iterator> ret;
41 ret = iotrel.equal_range("mom");
42 for (std::unordered_multimap<string,string>::const_iterator it=ret.first; it!=ret.second; ++it)
43 cout << ' ' << it->second << endl;
45 cout << "size: " << iotrel.size() << endl;