MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / getCacheID

Method getCacheID

src/OpenColorIO/Context.cpp:163–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163const char * Context::getCacheID() const
164{
165 AutoMutex lock(getImpl()->m_resultsCacheMutex);
166
167 if(getImpl()->m_cacheID.empty())
168 {
169 std::ostringstream cacheid;
170 if (!getImpl()->m_searchPaths.empty())
171 {
172 cacheid << "Search Path ";
173 for (auto & path : getImpl()->m_searchPaths)
174 {
175 cacheid << path << " ";
176 }
177 }
178 cacheid << "Working Dir " << getImpl()->m_workingDir << " ";
179 cacheid << "Environment Mode " << getImpl()->m_envmode << " ";
180
181 for (EnvMap::const_iterator iter = getImpl()->m_envMap.begin(),
182 end = getImpl()->m_envMap.end();
183 iter != end; ++iter)
184 {
185 cacheid << iter->first << "=" << iter->second << " ";
186 }
187
188 std::string fullstr = cacheid.str();
189 getImpl()->m_cacheID = CacheIDHash(fullstr.c_str(), fullstr.size());
190 }
191
192 return getImpl()->m_cacheID.c_str();
193}
194
195void Context::setSearchPath(const char * path)
196{

Callers 3

test_copyMethod · 0.95
test_interfaceMethod · 0.95
test_interfaceMethod · 0.95

Calls 6

CacheIDHashFunction · 0.85
getImplFunction · 0.50
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by 3

test_copyMethod · 0.76
test_interfaceMethod · 0.76
test_interfaceMethod · 0.76