src: refactored ErrorInfo to be used as standard error type outside of Storage

This commit is contained in:
Eberhard Graether
2016-10-21 14:48:20 +02:00
parent a5613715db
commit 0e8c0ee18a
20 changed files with 85 additions and 115 deletions
+2 -3
View File
@@ -15,7 +15,6 @@
#include "data/ErrorCountInfo.h"
#include "data/ErrorInfo.h"
#include "data/StorageStats.h"
#include "data/StorageTypes.h"
class Graph;
class TextAccess;
@@ -70,8 +69,8 @@ public:
virtual StorageStats getStorageStats() const = 0;
virtual ErrorCountInfo getErrorCount() const = 0;
virtual std::vector<StorageError> getErrors() const = 0;
virtual std::vector<StorageError> getAllErrors() const = 0;
virtual std::vector<ErrorInfo> getErrors() const = 0;
virtual std::vector<ErrorInfo> getAllErrors() const = 0;
virtual std::shared_ptr<TokenLocationCollection> getErrorTokenLocations(std::vector<ErrorInfo>* errors) const = 0;
};
+9 -9
View File
@@ -274,8 +274,8 @@ ErrorCountInfo StorageAccessProxy::getErrorCount() const
{
ErrorCountInfo info;
std::vector<StorageError> storageErrors = getErrors();
for (const StorageError& error : storageErrors)
std::vector<ErrorInfo> errors = getErrors();
for (const ErrorInfo& error : errors)
{
info.total++;
@@ -288,14 +288,14 @@ ErrorCountInfo StorageAccessProxy::getErrorCount() const
return info;
}
std::vector<StorageError> StorageAccessProxy::getErrors() const
std::vector<ErrorInfo> StorageAccessProxy::getErrors() const
{
if (hasSubject())
{
std::vector<StorageError> errors = m_subject->getAllErrors();;
std::vector<StorageError> filteredErrors;
std::vector<ErrorInfo> errors = m_subject->getAllErrors();;
std::vector<ErrorInfo> filteredErrors;
for (const StorageError& error : errors)
for (const ErrorInfo& error : errors)
{
if (m_errorFilter.filter(error))
{
@@ -306,17 +306,17 @@ std::vector<StorageError> StorageAccessProxy::getErrors() const
return filteredErrors;
}
return std::vector<StorageError>();
return std::vector<ErrorInfo>();
}
std::vector<StorageError> StorageAccessProxy::getAllErrors() const
std::vector<ErrorInfo> StorageAccessProxy::getAllErrors() const
{
if (hasSubject())
{
return m_subject->getAllErrors();
}
return std::vector<StorageError>();
return std::vector<ErrorInfo>();
}
std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getErrorTokenLocations(std::vector<ErrorInfo>* errors) const
+2 -3
View File
@@ -4,7 +4,6 @@
#include "data/access/StorageAccess.h"
#include "data/ErrorFilter.h"
#include "data/StorageTypes.h"
#include "utility/messaging/MessageListener.h"
#include "utility/messaging/type/MessageErrorFilterChanged.h"
@@ -65,8 +64,8 @@ public:
virtual StorageStats getStorageStats() const;
virtual ErrorCountInfo getErrorCount() const;
virtual std::vector<StorageError> getErrors() const;
virtual std::vector<StorageError> getAllErrors() const;
virtual std::vector<ErrorInfo> getErrors() const;
virtual std::vector<ErrorInfo> getAllErrors() const;
virtual std::shared_ptr<TokenLocationCollection> getErrorTokenLocations(std::vector<ErrorInfo>* errors) const;