Changeset 14551
- Timestamp:
- 11/03/12 18:52:18 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/StateMachineDimControl.cc
r14541 r14551 297 297 fMutex.unlock(); 298 298 299 fStateCallback(server, state); 300 299 301 return GetCurrentState(); 300 302 } … … 342 344 if (server!="DIS_DNS") 343 345 { 344 DimDescriptions *d = new DimDescriptions(server); 345 346 fDimDescriptionsList.push_back(d); 347 d->SetCallback(bind(&StateMachineDimControl::HandleStateChange, this, server, d)); 348 d->SetCallbackStates(bind(&StateMachineDimControl::HandleStates, this, server, d)); 349 d->SetCallbackDescriptions(bind(&StateMachineDimControl::HandleDescriptions, this, d)); 350 d->Subscribe(*this); 346 struct Find : string 347 { 348 Find(const string &ref) : string(ref) { } 349 bool operator()(const DimDescriptions *dim) { return *this==dim->server; } 350 }; 351 352 if (find_if(fDimDescriptionsList.begin(), fDimDescriptionsList.end(), 353 Find(server))==fDimDescriptionsList.end()) 354 { 355 DimDescriptions *d = new DimDescriptions(server); 356 357 fDimDescriptionsList.push_back(d); 358 d->SetCallback(bind(&StateMachineDimControl::HandleStateChange, this, server, d)); 359 d->SetCallbackStates(bind(&StateMachineDimControl::HandleStates, this, server, d)); 360 d->SetCallbackDescriptions(bind(&StateMachineDimControl::HandleDescriptions, this, d)); 361 d->Subscribe(*this); 362 } 351 363 } 352 364 -
trunk/FACT++/src/StateMachineDimControl.h
r14541 r14551 21 21 std::map<std::pair<std::string, int32_t>, std::pair<std::string, std::string>> fStateDescriptionList; 22 22 std::map<std::string, std::vector<Description>> fServiceDescriptionList; 23 24 std::function<void(const std::string &, const State&)> fStateCallback; 23 25 24 26 DimVersion fDim; … … 63 65 void SendDimCommand(const std::string &server, std::string str, std::ostream &lout); 64 66 67 void SetStateCallback(const std::function<void(const std::string &, const State &)> &func) { fStateCallback = func; } 68 65 69 public: 66 70 StateMachineDimControl(std::ostream &out=std::cout);
Note:
See TracChangeset
for help on using the changeset viewer.