#include "LifxLightBulb.cpp"
#include "LightBulb_Skeleton.cpp"
#include "LightBulbTest_Stub.cpp"
+#include "IoTSet.hpp"
-typedef void* create_t(string className, void** params);
-typedef void destroy_t(void*);
+//typedef void* create_t(string className, void** params);
+//typedef void destroy_t(void*);
+
+// Transferring members of IoTSet<void*> into IoTSet<IoTDeviceAddress*>
+IoTSet<IoTDeviceAddress*>* createDeviceAddressSet(unordered_set<void*>* iotSet) {
+
+ unordered_set<IoTDeviceAddress*>* devSet = new unordered_set<IoTDeviceAddress*>();
+ //for (auto itr = iotSet->begin(); itr != iotSet->end(); ++itr) {
+ for (unordered_set<void*>::const_iterator itr = iotSet->begin(); itr != iotSet->end(); ++itr) {
+ IoTDeviceAddress* deviceAddress = (IoTDeviceAddress*) *itr;
+ devSet->insert(deviceAddress);
+ }
+ IoTSet<IoTDeviceAddress*>* iotDevSet = new IoTSet<IoTDeviceAddress*>(devSet);
+
+ delete iotSet;
+ return iotDevSet;
+}
+
+
+/*
// External creator/destroyer
extern "C" void* create(string className, void** params) {
}
}
}
-
-/*typedef LifxLightBulb* create_t(IoTSet<IoTDeviceAddress*>* _devAddress, string macAddress);
-typedef void destroy_t(LifxLightBulb*);
-
-// External creator/destroyer
-extern "C" LifxLightBulb* create(IoTSet<IoTDeviceAddress*>* _devAddress, string macAddress) {
- return new LifxLightBulb(_devAddress, macAddress);
-}
-
-extern "C" void destroy(LifxLightBulb* t) {
- delete t;
-}*/
-
-//typedef LightBulb_Skeleton* create_t(LightBulb *_mainObj, string _callbackAddress, int _port);
-//typedef void destroy_t(LightBulb_Skeleton*);
-
-/*extern "C" LightBulb_Skeleton* create(LightBulb *_mainObj, string _callbackAddress, int _port) {
- return new LightBulb_Skeleton(_mainObj, _callbackAddress, _port);
-}
-
-extern "C" void destroy(LightBulb_Skeleton* t) {
- delete t;
-}*/
-
-//typedef LightBulbTest_Stub* create_t(int _port, const char* _skeletonAddress, string _callbackAddress, int _rev, bool* _bResult, vector<int> _ports);
-//typedef void destroy_t(LightBulbTest_Stub*);
-
-/*extern "C" LightBulbTest_Stub* create(int _port, const char* _skeletonAddress, string _callbackAddress, int _rev, bool* _bResult, vector<int> _ports) {
- return new LightBulbTest_Stub(_port, _skeletonAddress, _callbackAddress, _rev, _bResult, _ports);
-}
-
-extern "C" void destroy(LightBulbTest_Stub* t) {
- delete t;
-}*/
-
+*/