Changeset 442
- Timestamp:
- 08/26/09 18:35:44 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/service_management_layer/ServiceManagementLayer.cpp
r441 r442 28 28 29 29 #include <cmath> 30 #include <cstdio> 31 #include <cstdlib> 30 32 #include <cstring> 31 #include <stdlib.h>32 #include <string.h>33 #include <stdio.h>34 33 #include <stdint.h> 35 34 … … 40 39 #include <fcntl.h> 41 40 #include <sqlite3.h> 41 #include <string> 42 42 #include <sys/ioctl.h> 43 43 #include <sys/mman.h> … … 80 80 services_DB _services_DB; 81 81 data_DB _data_DB; 82 const char *_SML_Config;82 string _SML_Config; 83 83 bool shellFound; 84 84 … … 142 142 } 143 143 144 //Note that sizes of CE_List, miss, and service are hardcoded for now. 145 //Also, their sizes are hardcoded into the code in various places; a fix for a future version. 144 /* Note that sizes of CE_List, miss, and service are hardcoded for now. 145 * Also, their sizes are hardcoded into the code in various places; a fix 146 * for a future version. */ 146 147 ServiceManagementLayer::ServiceManagementLayer(const char* SML_Config, \ 147 148 const char* serverName, const char* serverPort, int16_t clientPort) 148 149 { 149 150 LOG("Creating Service Management Layer.\n"); 150 _SML_Config = SML_Config; 151 152 _SML_Config = string(SML_Config); 151 153 SMLport = clientPort; 152 154 153 155 ConnectToShell(serverName, serverPort); 154 CE_List = (CE_Reg *) malloc(10*sizeof(struct CE_Reg));155 156 CE_List = new CE_Reg[10]; 156 157 157 158 miss = new Mission[10]; 158 for( int i = 0; i < 10; i++)159 for(size_t i = 0; i < 10; i++) 159 160 miss[i].services = new Service[30]; 160 161 … … 162 163 163 164 LoadConfiguration(SML_Config, miss); 165 164 166 CreateServicesDB(); 165 167 CreateDataDB(); … … 1399 1401 for(int i = 0; i < 10; i++) 1400 1402 miss[i].services = new Service[30]; 1401 LoadConfiguration(_SML_Config , miss);1403 LoadConfiguration(_SML_Config.c_str(), miss); 1402 1404 } 1403 1405