/**
* Class which associating active queries with warnings queues on client, so it easy to add new
* warning from anywhere when it received from server
*/
class SciDBWarnings: public Singleton<SciDBWarnings>
{
public:
void postWarning(QueryID queryId, const Warning &warning)
{
ScopedMutexLock _lock(_mapLock);
assert(_resultsMap.find(queryId) != _resultsMap.end());
_resultsMap[queryId]->_postWarning(warning);
}
void associateWarnings(QueryID queryId, QueryResult *res)
{
ScopedMutexLock _lock(_mapLock);
_resultsMap[queryId] = res;
}
void unassociateWarnings(QueryID queryId)
{
ScopedMutexLock _lock(_mapLock);
_resultsMap.erase(queryId);
}
private:
std::map<QueryID, QueryResult*> _resultsMap;
* Class which associating active queries with warnings queues on client, so it easy to add new
* warning from anywhere when it received from server
*/
class SciDBWarnings: public Singleton<SciDBWarnings>
{
public:
void postWarning(QueryID queryId, const Warning &warning)
{
ScopedMutexLock _lock(_mapLock);
assert(_resultsMap.find(queryId) != _resultsMap.end());
_resultsMap[queryId]->_postWarning(warning);
}
void associateWarnings(QueryID queryId, QueryResult *res)
{
ScopedMutexLock _lock(_mapLock);
_resultsMap[queryId] = res;
}
void unassociateWarnings(QueryID queryId)
{
ScopedMutexLock _lock(_mapLock);
_resultsMap.erase(queryId);
}
private:
std::map<QueryID, QueryResult*> _resultsMap;