summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-02-02 20:14:00 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-02-02 20:14:00 +0000
commit441f938df65b2b42327739cfb8fc19bc6062fdf0 (patch)
tree910693173d1f878537af4fe6e7f7edde7a71ec30 /document
parent2e9c8e2454186b93a6ef11ace4da67d1144e752e (diff)
Implement destructor, move and copy constructors.
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/base/exceptions.cpp27
-rw-r--r--document/src/vespa/document/base/exceptions.h8
2 files changed, 12 insertions, 23 deletions
diff --git a/document/src/vespa/document/base/exceptions.cpp b/document/src/vespa/document/base/exceptions.cpp
index eb9b2eff248..b0c2cf05eb1 100644
--- a/document/src/vespa/document/base/exceptions.cpp
+++ b/document/src/vespa/document/base/exceptions.cpp
@@ -19,19 +19,14 @@ InvalidDataTypeException::InvalidDataTypeException(
const DataType& expected,
const vespalib::string& location)
: vespalib::IllegalStateException(
- vespalib::make_string(
- "Got %s while expecting %s. These types are not compatible.",
- actual.toString().c_str(),
- expected.toString().c_str()
- ), location, 1),
+ vespalib::make_string("Got %s while expecting %s. These types are not compatible.",
+ actual.toString().c_str(), expected.toString().c_str()), location, 1),
_actual(actual),
_expected(expected)
{
}
-InvalidDataTypeException::~InvalidDataTypeException() throw()
-{
-}
+InvalidDataTypeException::~InvalidDataTypeException() = default;
InvalidDataTypeConversionException::InvalidDataTypeConversionException(
const DataType &actual,
@@ -48,9 +43,7 @@ InvalidDataTypeConversionException::InvalidDataTypeConversionException(
{
}
-InvalidDataTypeConversionException::~InvalidDataTypeConversionException() throw()
-{
-}
+InvalidDataTypeConversionException::~InvalidDataTypeConversionException() = default;
DocumentTypeNotFoundException::DocumentTypeNotFoundException(const vespalib::string& name, const vespalib::string& location)
: Exception("Document type "+name+" not found", location, 1),
@@ -71,7 +64,8 @@ DataTypeNotFoundException::DataTypeNotFoundException(const vespalib::string& nam
AnnotationTypeNotFoundException::AnnotationTypeNotFoundException(
int id, const vespalib::string& location)
: Exception(vespalib::make_string("Data type with id %d not found", id),
- location, 1) {
+ location, 1)
+{
}
FieldNotFoundException::
@@ -96,13 +90,8 @@ FieldNotFoundException(int fieldId,
{
}
-FieldNotFoundException::~FieldNotFoundException() throw()
-{
-}
-
-DocumentTypeNotFoundException::~DocumentTypeNotFoundException() throw()
-{
-}
+FieldNotFoundException::~FieldNotFoundException() = default;
+DocumentTypeNotFoundException::~DocumentTypeNotFoundException() = default;
VESPA_IMPLEMENT_EXCEPTION(WrongTensorTypeException, vespalib::Exception);
diff --git a/document/src/vespa/document/base/exceptions.h b/document/src/vespa/document/base/exceptions.h
index 0b7f8364702..6e91b5c08ee 100644
--- a/document/src/vespa/document/base/exceptions.h
+++ b/document/src/vespa/document/base/exceptions.h
@@ -4,7 +4,7 @@
#include <memory>
#include <vespa/vespalib/util/exceptions.h>
-#include <stdint.h>
+#include <cstdint>
namespace document {
@@ -22,7 +22,7 @@ public:
InvalidDataTypeException(const DataType &actual,
const DataType &wanted,
const vespalib::string & location);
- virtual ~InvalidDataTypeException() throw();
+ virtual ~InvalidDataTypeException();
const DataType& getActualDataType() const { return _actual; }
const DataType& getExpectedDataType() const { return _expected; }
@@ -75,7 +75,7 @@ private:
public:
DocumentTypeNotFoundException(const vespalib::string & name,
const vespalib::string& location);
- virtual ~DocumentTypeNotFoundException() throw();
+ ~DocumentTypeNotFoundException() override;
const vespalib::string& getDocumentTypeName() const { return _type; }
@@ -130,7 +130,7 @@ public:
FieldNotFoundException(int32_t fieldId,
int16_t serializationVersion,
const vespalib::string& location);
- ~FieldNotFoundException() throw();
+ ~FieldNotFoundException() override;
const vespalib::string& getFieldName() const { return _fieldName; }
int32_t getFieldId() const { return _fieldId; };