3 #include "LightBulbTest_Stub.hpp"
5 // External create, destroy, and init functions
6 extern "C" void* createLightBulbTest_Stub(void** params) {
7 // Arguments: int _port, const char* _skeletonAddress, string _callbackAddress, int _rev, bool* _bResult, vector<int> _ports
8 return new LightBulbTest_Stub(*((int*) params[0]), ((string*) params[1])->c_str(), *((string*) params[2]), *((int*) params[3]), (bool*) params[4], *((vector<int>*) params[5]));
12 extern "C" void destroyLightBulbTest_Stub(void* t) {
13 LightBulbTest_Stub* lbs = (LightBulbTest_Stub*) t;
18 extern "C" void initLightBulbTest_Stub(void* t) {
19 LightBulbTest_Stub* lbs = (LightBulbTest_Stub*) t;
24 int main(int argc, char *argv[])
28 ports.push_back(58551);
29 const char* skeletonAddress = "localhost";
30 string callbackAddress = "localhost";
33 LightBulbTest_Stub *lbs = new LightBulbTest_Stub(stubPort, skeletonAddress, callbackAddress, rev, &result, ports);
34 cout << "Successfully instantiated stub!" << endl;
36 for (int i = 0; i < 100; i++) {
38 cout << "Turning off!" << endl;
39 this_thread::sleep_for (chrono::milliseconds(1000));
41 cout << "Turning on!" << endl;
42 this_thread::sleep_for (chrono::milliseconds(1000));