Advertisement
bkuhns

SafeArrayPtr

Oct 11th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. auto lines = SafeArrayPtr<IProfibusLinePtr>(profiMaster->GetProfibusLines());
  2. if(lines.size() != 1) {
  3.     ASSERT(false);  //< We only support one line at the moment.
  4.     return nullptr;
  5. }
  6. auto line = lines.at(0);
  7.  
  8. auto slaves = SafeArrayPtr<IProfibusSlavePtr>(line->GetProfibusSlaves());
  9. for_each(begin(slaves), end(slaves), [&](IProfibusSlavePtr slave) {
  10.     if(auto found = searchInProfiSlave( slave, id )) {
  11.         retDevice = found;
  12.         break;
  13.     }
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement