Changeset 12940 for fact/Evidence/History.cc
- Timestamp:
- 02/24/12 20:43:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/Evidence/History.cc
r12910 r12940 52 52 53 53 DimInfo *ServerList; 54 DimService *Service; 54 55 char *Directory; 55 56 … … 72 73 EvidenceServer(SERVER_NAME), 73 74 Directory(Dir) { 74 75 75 // Get/initialize configuration 76 76 GetConfig("minchange", " "); … … 80 80 GetConfig("exclude", ""); 81 81 82 // Create services for information about subscribed services 83 Service = new DimService(SERVER_NAME "/Subscriptions", "C", NULL, 0); 84 82 85 // Subscribe to top-level server list 83 86 ServerList = new DimInfo((char *) "DIS_DNS/SERVER_LIST", NO_LINK, this); … … 90 93 delete ServerList; 91 94 while (Map.size() != 0) RemoveService((*Map.begin()).first); 95 96 delete Service; 92 97 } 93 98 … … 96 101 void History::infoHandler() { 97 102 103 static string List; 104 98 105 DimInfo *I = getInfo(); 99 106 100 107 // Check if service available 101 108 if (!ServiceOK(I)) return; 102 109 103 110 // ====== Part A: Handle service subscriptions === 104 111 … … 138 145 Name = strtok(NULL, "|"); 139 146 } 147 148 // Update service subscription list 149 static stringstream Stream; 150 151 for (map<string, struct Item>::const_iterator i=Map.begin(); i!=Map.end(); i++) { 152 Stream << i->first << ':' << i->second.MinAbsChange << '|'; 153 } 154 List = Stream.str(); 155 Service->updateService((void *) List.c_str(), List.size()+1); 156 140 157 return; 141 158 }
Note:
See TracChangeset
for help on using the changeset viewer.