Skip to content
Snippets Groups Projects
Commit e5bdc528 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Autoformat

parent 4101e019
No related branches found
No related tags found
1 merge request!381Feature: Memory types: findLatestInstance()/Snapshot(), hasSnapshots(), hasInstances()
......@@ -6,7 +6,6 @@
#include "../MemoryID.h"
namespace armarx::armem::error
{
......@@ -15,7 +14,6 @@ namespace armarx::armem::error
{
}
InvalidArgument::InvalidArgument(const std::string& argument,
const std::string& function,
const std::string& message) :
......@@ -41,7 +39,6 @@ namespace armarx::armem::error
return ss.str();
}
ContainerNameMismatch::ContainerNameMismatch(const std::string& gottenName,
const std::string& ownTerm,
const std::string& containerName) :
......@@ -60,7 +57,6 @@ namespace armarx::armem::error
return ss.str();
}
ContainerEntryAlreadyExists::ContainerEntryAlreadyExists(const std::string& existingTerm,
const std::string& existingName,
const std::string& ownTerm,
......@@ -81,7 +77,6 @@ namespace armarx::armem::error
return ss.str();
}
MissingEntry::MissingEntry(const std::string& missingTerm,
const std::string& missingName,
const std::string& containerTerm,
......@@ -104,7 +99,6 @@ namespace armarx::armem::error
return ss.str();
}
MissingData::MissingData(const std::string& missingTerm,
const std::string& missingName,
const std::string& ownTerm,
......@@ -125,7 +119,6 @@ namespace armarx::armem::error
return ss.str();
}
ParseIntegerError::ParseIntegerError(std::string string, std::string semanticName) :
ArMemError(makeMsg(string, semanticName))
{
......@@ -139,7 +132,6 @@ namespace armarx::armem::error
return ss.str();
}
InvalidMemoryID::InvalidMemoryID(const MemoryID& id, const std::string& message) :
ArMemError(makeMsg(id, message))
{
......@@ -153,7 +145,6 @@ namespace armarx::armem::error
return ss.str();
}
EntityHistoryEmpty::EntityHistoryEmpty(const std::string& entityName,
const std::string& message) :
ArMemError(makeMsg(entityName, message))
......@@ -176,7 +167,6 @@ namespace armarx::armem::error
return ss.str();
}
UnknownQueryType::UnknownQueryType(const std::string& term, const std::string& typeName) :
ArMemError(makeMsg(term, typeName))
{
......@@ -195,7 +185,8 @@ namespace armarx::armem::error
{
}
std::string QueryFailed::makeMsg(const std::string& memory, const std::string& message)
std::string
QueryFailed::makeMsg(const std::string& memory, const std::string& message)
{
std::stringstream ss;
ss << "Query from memory " << memory << " failed with message: " << message;
......@@ -207,7 +198,6 @@ namespace armarx::armem::error
{
}
std::string
IOError::makeMsg(const std::string& path, const std::string& message)
{
......
......@@ -4,7 +4,6 @@
#include <SimoxUtility/meta/type_name.h>
namespace armarx::armem
{
class MemoryID;
......@@ -19,86 +18,86 @@ namespace armarx::armem::error
class ArMemError : public std::runtime_error
{
public:
ArMemError(const std::string& msg);
};
/**
* @brief Indicates that an argument was invalid.
*/
class InvalidArgument : public ArMemError
{
public:
InvalidArgument(const std::string& argument, const std::string& function,
InvalidArgument(const std::string& argument,
const std::string& function,
const std::string& message);
static std::string makeMsg(const std::string& argument, const std::string& function,
static std::string makeMsg(const std::string& argument,
const std::string& function,
const std::string& message);
};
/**
* @brief Indicates that a name in a given ID does not match a container's own name.
*/
class ContainerNameMismatch : public ArMemError
{
public:
ContainerNameMismatch(const std::string& gottenName,
const std::string& containerTerm, const std::string& containerName);
const std::string& containerTerm,
const std::string& containerName);
static std::string makeMsg(const std::string& gottenName,
const std::string& containerTerm, const std::string& containerName);
const std::string& containerTerm,
const std::string& containerName);
};
/**
* @brief Indicates that a name in a given ID does not match a container's own name.
*/
class ContainerEntryAlreadyExists : public ArMemError
{
public:
ContainerEntryAlreadyExists(const std::string& existingTerm, const std::string& existingName,
const std::string& ownTerm, const std::string& ownName);
static std::string makeMsg(const std::string& existingTerm, const std::string& existingName,
const std::string& ownTerm, const std::string& ownName);
ContainerEntryAlreadyExists(const std::string& existingTerm,
const std::string& existingName,
const std::string& ownTerm,
const std::string& ownName);
static std::string makeMsg(const std::string& existingTerm,
const std::string& existingName,
const std::string& ownTerm,
const std::string& ownName);
};
/**
* @brief Indicates that a container did not have an entry under a given name.
*/
class MissingEntry : public ArMemError
{
public:
template <class MissingT, class ContainerT>
static MissingEntry create(const std::string& missingKey, const ContainerT& container)
static MissingEntry
create(const std::string& missingKey, const ContainerT& container)
{
return MissingEntry(MissingT::getLevelName(), missingKey,
ContainerT::getLevelName(), container.getKeyString(), container.size());
return MissingEntry(MissingT::getLevelName(),
missingKey,
ContainerT::getLevelName(),
container.getKeyString(),
container.size());
}
MissingEntry(const std::string& missingTerm, const std::string& missingName,
const std::string& containerTerm, const std::string& containerName,
MissingEntry(const std::string& missingTerm,
const std::string& missingName,
const std::string& containerTerm,
const std::string& containerName,
size_t containerSize);
static std::string makeMsg(const std::string& missingTerm, const std::string& missingName,
const std::string& containerTerm, const std::string& containerName,
static std::string makeMsg(const std::string& missingTerm,
const std::string& missingName,
const std::string& containerTerm,
const std::string& containerName,
size_t size);
};
/**
* @brief Indicates that a container did have an entry, but the entry's data was
* null when trying to access it.
......@@ -106,14 +105,17 @@ namespace armarx::armem::error
class MissingData : public ArMemError
{
public:
MissingData(const std::string& missingTerm, const std::string& missingName,
const std::string& ownTerm, const std::string& ownName);
static std::string makeMsg(const std::string& missingTerm, const std::string& missingName,
const std::string& ownTerm, const std::string& ownName);
MissingData(const std::string& missingTerm,
const std::string& missingName,
const std::string& ownTerm,
const std::string& ownName);
static std::string makeMsg(const std::string& missingTerm,
const std::string& missingName,
const std::string& ownTerm,
const std::string& ownName);
};
/**
* @brief Indicates that a string could not be parsed as integer.
*/
......@@ -125,52 +127,43 @@ namespace armarx::armem::error
static std::string makeMsg(std::string string, std::string semanticName);
};
/**
* @brief Indicates that a memory ID is invalid, e.g. does not contain necessary information.
*/
class InvalidMemoryID : public ArMemError
{
public:
InvalidMemoryID(const MemoryID& id, const std::string& message);
static std::string makeMsg(const MemoryID& id, const std::string& message);
};
/**
* @brief Indicates that an entity's history was queried, but is empty.
*/
class EntityHistoryEmpty : public ArMemError
{
public:
EntityHistoryEmpty(const std::string& entityName, const std::string& message = "");
static std::string makeMsg(const std::string& entityName, const std::string& message = "");
};
/**
* @brief Indicates that an entity's history was queried, but is empty.
*/
class UnknownQueryType : public ArMemError
{
public:
template <class QueryType>
UnknownQueryType(const std::string& term, const QueryType& query) :
UnknownQueryType(term, simox::meta::get_type_name(query))
{
}
UnknownQueryType(const std::string& term, const std::string& typeName);
static std::string makeMsg(const std::string& term, const std::string& typeName);
};
/**
......@@ -179,28 +172,23 @@ namespace armarx::armem::error
class QueryFailed : public ArMemError
{
public:
QueryFailed(const std::string& memory, const std::string& message = "");
static std::string makeMsg(const std::string& memory, const std::string& message = "");
};
/**
* @brief Indicates that something went wrong when accessing the filesystem.
*/
class IOError : public ArMemError
{
public:
IOError(const std::string& path, const std::string& message = "");
static std::string makeMsg(const std::string& path, const std::string& message = "");
std::string path;
};
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment