comparison transform/TransformFactory.cpp @ 485:9eb7ef610d7f

* Add more informative text to Find a Transform (particularly when none available)
author Chris Cannam
date Thu, 20 Nov 2008 12:09:55 +0000
parents 45ded09e4710
children c45e6c6722e0
comparison
equal deleted inserted replaced
484:45ded09e4710 485:9eb7ef610d7f
116 } 116 }
117 117
118 return m_transforms[id]; 118 return m_transforms[id];
119 } 119 }
120 120
121 bool
122 TransformFactory::haveInstalledTransforms()
123 {
124 populateTransforms();
125 return !m_transforms.empty();
126 }
127
121 TransformList 128 TransformList
122 TransformFactory::getUninstalledTransformDescriptions() 129 TransformFactory::getUninstalledTransformDescriptions()
123 { 130 {
124 m_populatingSlowly = false; 131 m_populatingSlowly = false;
125 populateUninstalledTransforms(); 132 populateUninstalledTransforms();
150 if (m_uninstalledTransforms.find(id) == m_uninstalledTransforms.end()) { 157 if (m_uninstalledTransforms.find(id) == m_uninstalledTransforms.end()) {
151 return TransformDescription(); 158 return TransformDescription();
152 } 159 }
153 160
154 return m_uninstalledTransforms[id]; 161 return m_uninstalledTransforms[id];
162 }
163
164 bool
165 TransformFactory::haveUninstalledTransforms(bool waitForCheckToComplete)
166 {
167 if (waitForCheckToComplete) {
168 populateUninstalledTransforms();
169 } else {
170 if (!m_uninstalledTransformsMutex.tryLock()) {
171 return false;
172 }
173 if (!m_uninstalledTransformsPopulated) {
174 m_uninstalledTransformsMutex.unlock();
175 return false;
176 }
177 m_uninstalledTransformsMutex.unlock();
178 }
179
180 return !m_uninstalledTransforms.empty();
155 } 181 }
156 182
157 TransformFactory::TransformInstallStatus 183 TransformFactory::TransformInstallStatus
158 TransformFactory::getTransformInstallStatus(TransformId id) 184 TransformFactory::getTransformInstallStatus(TransformId id)
159 { 185 {