1 #include "ProgressSemaphorePool.hh"
2 #include "ProgressSemaphore.hh"
20 map<string, SharedPtr<ProgressSemaphore> >::iterator it;
21 it = Semaphores_.find(name);
22 if (it != Semaphores_.end())
26 Semaphores_[name]=sem;
37 map<string, SharedPtr<ProgressSemaphore> >::iterator it;
40 names.push_back(it->first);
54 map<string, SharedPtr<ProgressSemaphore> >::iterator it;
57 it->second->SetTerminateFlag();
67 map<string, SharedPtr<ProgressSemaphore> >::iterator it;
70 float prog = it->second->GetProgress();
71 BIASASSERT(prog>=0. && prog<=1.);
76 float result = accu/float(count);
78 BIASASSERT(result>=0. && result <=1.);
87 map<string, SharedPtr<ProgressSemaphore> >::iterator it;
~ProgressSemaphorePool()
destructor
std::map< std::string, SharedPtr< ProgressSemaphore > > Semaphores_
pointer with reference count and automatic deletion
this class represents a progress counter which multiple processes can use.
float GetOverallProgress()
void GetAllSemaphoreNames(std::vector< std::string > &names)
bool Exists(const std::string &name)
SharedPtr< ProgressSemaphore > Register(const std::string &name)