Added: #1440 Slave functions for getting the file status from the plugin

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
parent e7e0006556
commit 6ce855c1b6

@ -453,6 +453,34 @@ public:
}
}
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// If this returns false, the status is not sane, and the build must error; or the file does not exist and must error or warn.
// Gets the file status as it was known at the beginning of the build or when this file was first known.
bool getFileStatusCached(CFileStatus &fileStatus, const std::string &filePath) // not by macro path :)
{
std::map<std::string, CFileStatus>::iterator statusIt = m_FileStatusCache.find(filePath);
if (statusIt == m_FileStatusCache.end())
{
nldebug("File status '%s' not requested before, ensure this is not a dependency", filePath.c_str());
if (g_DatabaseStatus->getFileStatus(fileStatus, filePath))
{
m_FileStatusCache[filePath] = fileStatus;
return true;
}
else return false;
}
fileStatus = statusIt->second; // copy
return true;
}
// If this returns false, the status is not sane, and the build must error; or the file does not exist and must error or warn.
bool getFileStatusLatest(CFileStatus &fileStatus, const std::string &filePath)
{
return g_DatabaseStatus->getFileStatus(fileStatus, filePath);
}
virtual void addFileStatusToCache(NLNET::IModuleProxy *sender, const std::string &macroPath, const CFileStatus &fileStatus)
{
nlassert(sender == NULL || m_Master->getModuleProxy() == sender); // sanity check
@ -464,6 +492,9 @@ public:
m_FileStatusCache[filePath] = fileStatus;
}
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
virtual void masterUpdatedDatabaseStatus(NLNET::IModuleProxy *sender)
{
nlassert(sender == NULL || m_Master->getModuleProxy() == sender); // sanity check

Loading…
Cancel
Save