aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-04-03 17:22:27 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-04-04 16:36:17 +0200
commitd57ddaefd37e6a19d3a6937fbf9a655dbafcdba5 (patch)
tree56f50116805e8ae7d2287c934e6ccc073142d0ce /vespalib
parent3dab091fd0ec3ffd71af3e19e55ed3a4437b8d8b (diff)
Use override
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/atomic/atomic_bench.cpp12
-rw-r--r--vespalib/src/tests/zcurve/zcurve_test.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/array_value.h20
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/basic_value.h24
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/binary_format.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/cursor.h6
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/inject.cpp6
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/inserter.h64
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/inspector.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/json_format.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/named_symbol_inserter.h2
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/named_symbol_lookup.h2
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/object_value.h26
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/resolved_symbol.h4
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/value.h100
-rw-r--r--vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp10
-rw-r--r--vespalib/src/vespa/vespalib/io/fileutil.h8
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_hook.cpp6
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_hook.h2
-rw-r--r--vespalib/src/vespa/vespalib/util/active.h3
-rw-r--r--vespalib/src/vespa/vespalib/util/dual_merge_director.h4
-rw-r--r--vespalib/src/vespa/vespalib/util/runnable_pair.h2
-rw-r--r--vespalib/src/vespa/vespalib/util/simple_thread_bundle.cpp8
-rw-r--r--vespalib/src/vespa/vespalib/util/simple_thread_bundle.h8
-rw-r--r--vespalib/src/vespa/vespalib/util/slaveproc.h2
-rw-r--r--vespalib/src/vespa/vespalib/util/thread.h6
-rw-r--r--vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h6
27 files changed, 172 insertions, 175 deletions
diff --git a/vespalib/src/tests/atomic/atomic_bench.cpp b/vespalib/src/tests/atomic/atomic_bench.cpp
index 499af1daa65..003ef25ba45 100644
--- a/vespalib/src/tests/atomic/atomic_bench.cpp
+++ b/vespalib/src/tests/atomic/atomic_bench.cpp
@@ -1,20 +1,20 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("atomic_bench");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/atomic.h>
#include <vector>
#include <algorithm>
#include <sstream>
+#include <vespa/log/log.h>
+LOG_SETUP("atomic_bench");
class Test : public vespalib::TestApp
{
public:
template<typename C, typename T>
void testInc(size_t threads, size_t loops);
- int Main();
+ int Main() override;
};
template <typename T>
@@ -33,7 +33,7 @@ class Incrementer : public Changer<T>
{
public:
Incrementer(int times, T *data) : Changer<T>(times, data) {}
- void Run(FastOS_ThreadInterface *, void *) {
+ void Run(FastOS_ThreadInterface *, void *) override {
using vespalib::Atomic;
for (int i = 0; i < this->_times; ++i) {
Atomic::postInc(this->_idata);
@@ -46,7 +46,7 @@ class IncrementerByCmpSwap : public Changer<T>
{
public:
IncrementerByCmpSwap(int times, T *data) : Changer<T>(times, data) {}
- void Run(FastOS_ThreadInterface *, void *) {
+ void Run(FastOS_ThreadInterface *, void *) override {
using vespalib::Atomic;
T oldVal(0);
for (int i = 0; i < this->_times; ++i) {
diff --git a/vespalib/src/tests/zcurve/zcurve_test.cpp b/vespalib/src/tests/zcurve/zcurve_test.cpp
index e4a5d02d68e..41bccf23ccf 100644
--- a/vespalib/src/tests/zcurve/zcurve_test.cpp
+++ b/vespalib/src/tests/zcurve/zcurve_test.cpp
@@ -48,9 +48,9 @@ public:
bm3(void);
int64_t
- bmcheck(void);
+ bmcheck();
- int Main(void);
+ int Main() override;
};
diff --git a/vespalib/src/vespa/vespalib/data/slime/array_value.h b/vespalib/src/vespa/vespalib/data/slime/array_value.h
index 6d5178c39c3..bd78522b207 100644
--- a/vespalib/src/vespa/vespalib/data/slime/array_value.h
+++ b/vespalib/src/vespa/vespalib/data/slime/array_value.h
@@ -24,7 +24,7 @@ private:
std::vector<Value*> _values;
protected:
- virtual Cursor &addLeaf(const ValueFactory &input) {
+ Cursor &addLeaf(const ValueFactory &input) override {
Value *value = input.create(_stash);
_values.push_back(value);
return *value;
@@ -35,23 +35,23 @@ public:
ArrayValue(const ArrayValue &) = delete;
ArrayValue &operator=(const ArrayValue &) = delete;
- virtual Type type() const { return ARRAY::instance; }
- virtual size_t children() const { return _values.size(); }
- virtual size_t entries() const { return _values.size(); }
- virtual void traverse(ArrayTraverser &at) const;
+ Type type() const override { return ARRAY::instance; }
+ size_t children() const override { return _values.size(); }
+ size_t entries() const override { return _values.size(); }
+ void traverse(ArrayTraverser &at) const override;
- virtual Cursor &operator[](size_t idx) const {
+ Cursor &operator[](size_t idx) const override {
if (idx < _values.size()) {
return *_values[idx];
}
return *NixValue::invalid();
}
- virtual Cursor &addArray();
- virtual Cursor &addObject();
- virtual Symbol resolve(Memory symbol_name);
+ Cursor &addArray() override;
+ Cursor &addObject() override;
+ Symbol resolve(Memory symbol_name) override;
- virtual ~ArrayValue() { }
+ ~ArrayValue() { }
};
} // namespace vespalib::slime
diff --git a/vespalib/src/vespa/vespalib/data/slime/basic_value.h b/vespalib/src/vespa/vespalib/data/slime/basic_value.h
index 67d5655a6a9..8944acd986c 100644
--- a/vespalib/src/vespa/vespalib/data/slime/basic_value.h
+++ b/vespalib/src/vespa/vespalib/data/slime/basic_value.h
@@ -17,26 +17,26 @@ class BasicBoolValue : public Value {
bool _value;
public:
BasicBoolValue(bool bit) : _value(bit) {}
- virtual bool asBool() const { return _value; }
- virtual Type type() const { return BOOL::instance; }
+ bool asBool() const override { return _value; }
+ Type type() const override { return BOOL::instance; }
};
class BasicLongValue : public Value {
int64_t _value;
public:
BasicLongValue(int64_t l) : _value(l) {}
- virtual int64_t asLong() const { return _value; }
- virtual double asDouble() const { return _value; }
- virtual Type type() const { return LONG::instance; }
+ int64_t asLong() const override { return _value; }
+ double asDouble() const override { return _value; }
+ Type type() const override { return LONG::instance; }
};
class BasicDoubleValue : public Value {
double _value;
public:
BasicDoubleValue(double d) : _value(d) {}
- virtual double asDouble() const { return _value; }
- virtual int64_t asLong() const { return _value; }
- virtual Type type() const { return DOUBLE::instance; }
+ double asDouble() const override { return _value; }
+ int64_t asLong() const override { return _value; }
+ Type type() const override { return DOUBLE::instance; }
};
class BasicStringValue : public Value {
@@ -45,8 +45,8 @@ public:
BasicStringValue(Memory str, Stash & stash);
BasicStringValue(const BasicStringValue &) = delete;
BasicStringValue & operator = (const BasicStringValue &) = delete;
- virtual Memory asString() const { return _value; }
- virtual Type type() const { return STRING::instance; }
+ Memory asString() const override { return _value; }
+ Type type() const override { return STRING::instance; }
};
class BasicDataValue : public Value {
@@ -55,8 +55,8 @@ public:
BasicDataValue(Memory data, Stash & stash);
BasicDataValue(const BasicDataValue &) = delete;
BasicDataValue & operator = (const BasicDataValue &) = delete;
- virtual Memory asData() const { return _value; }
- virtual Type type() const { return DATA::instance; }
+ Memory asData() const override { return _value; }
+ Type type() const override { return DATA::instance; }
};
} // namespace vespalib::slime
diff --git a/vespalib/src/vespa/vespalib/data/slime/binary_format.cpp b/vespalib/src/vespa/vespalib/data/slime/binary_format.cpp
index 33694006a3b..2b7460933cf 100644
--- a/vespalib/src/vespa/vespalib/data/slime/binary_format.cpp
+++ b/vespalib/src/vespa/vespalib/data/slime/binary_format.cpp
@@ -68,8 +68,8 @@ struct BinaryEncoder : public ArrayTraverser,
out.write(image.data, image.size);
}
}
- virtual void entry(size_t, const Inspector &inspector);
- virtual void field(const Symbol &symbol, const Inspector &inspector);
+ void entry(size_t, const Inspector &inspector) override;
+ void field(const Symbol &symbol, const Inspector &inspector) override;
};
void
diff --git a/vespalib/src/vespa/vespalib/data/slime/cursor.h b/vespalib/src/vespa/vespalib/data/slime/cursor.h
index cebb05a44ee..504307359cf 100644
--- a/vespalib/src/vespa/vespalib/data/slime/cursor.h
+++ b/vespalib/src/vespa/vespalib/data/slime/cursor.h
@@ -8,9 +8,9 @@ namespace vespalib {
namespace slime {
struct Cursor : public Inspector {
- virtual Cursor &operator[](size_t idx) const = 0;
- virtual Cursor &operator[](Symbol sym) const = 0;
- virtual Cursor &operator[](Memory name) const = 0;
+ virtual Cursor &operator[](size_t idx) const override = 0;
+ virtual Cursor &operator[](Symbol sym) const override = 0;
+ virtual Cursor &operator[](Memory name) const override = 0;
virtual Cursor &addNix() = 0;
virtual Cursor &addBool(bool bit) = 0;
diff --git a/vespalib/src/vespa/vespalib/data/slime/inject.cpp b/vespalib/src/vespa/vespalib/data/slime/inject.cpp
index 76cc2fe0cc0..548a3f24248 100644
--- a/vespalib/src/vespa/vespalib/data/slime/inject.cpp
+++ b/vespalib/src/vespa/vespalib/data/slime/inject.cpp
@@ -4,7 +4,7 @@
#include "cursor.h"
#include "array_traverser.h"
#include "object_traverser.h"
-#include <stdlib.h>
+#include <cstdlib>
namespace vespalib {
namespace slime {
@@ -15,8 +15,8 @@ struct NestedInjector : ArrayTraverser, ObjectTraverser {
Cursor &cursor;
const Inspector *guard;
NestedInjector(Cursor &c, const Inspector *g) : cursor(c), guard(g) {}
- virtual void entry(size_t, const Inspector &inspector);
- virtual void field(const Memory &symbol_name, const Inspector &inspector);
+ void entry(size_t, const Inspector &inspector) override;
+ void field(const Memory &symbol_name, const Inspector &inspector) override;
};
void injectNix(const Inserter &inserter) { inserter.insertNix(); }
diff --git a/vespalib/src/vespa/vespalib/data/slime/inserter.h b/vespalib/src/vespa/vespalib/data/slime/inserter.h
index 18b2e900e39..321580289a8 100644
--- a/vespalib/src/vespa/vespalib/data/slime/inserter.h
+++ b/vespalib/src/vespa/vespalib/data/slime/inserter.h
@@ -38,28 +38,28 @@ struct SlimeInserter : Inserter {
Slime &slime;
explicit SlimeInserter(Slime &s) : slime(s) {}
- virtual Cursor &insertNix() const;
- virtual Cursor &insertBool(bool value) const;
- virtual Cursor &insertLong(int64_t value) const;
- virtual Cursor &insertDouble(double value) const;
- virtual Cursor &insertString(Memory value) const;
- virtual Cursor &insertData(Memory value) const;
- virtual Cursor &insertArray() const;
- virtual Cursor &insertObject() const;
+ Cursor &insertNix() const override;
+ Cursor &insertBool(bool value) const override;
+ Cursor &insertLong(int64_t value) const override;
+ Cursor &insertDouble(double value) const override;
+ Cursor &insertString(Memory value) const override;
+ Cursor &insertData(Memory value) const override;
+ Cursor &insertArray() const override;
+ Cursor &insertObject() const override;
};
struct ArrayInserter : Inserter {
Cursor &cursor;
explicit ArrayInserter(Cursor &c) : cursor(c) {}
- virtual Cursor &insertNix() const;
- virtual Cursor &insertBool(bool value) const;
- virtual Cursor &insertLong(int64_t value) const;
- virtual Cursor &insertDouble(double value) const;
- virtual Cursor &insertString(Memory value) const;
- virtual Cursor &insertData(Memory value) const;
- virtual Cursor &insertArray() const;
- virtual Cursor &insertObject() const;
+ Cursor &insertNix() const override;
+ Cursor &insertBool(bool value) const override;
+ Cursor &insertLong(int64_t value) const override;
+ Cursor &insertDouble(double value) const override;
+ Cursor &insertString(Memory value) const override;
+ Cursor &insertData(Memory value) const override;
+ Cursor &insertArray() const override;
+ Cursor &insertObject() const override;
};
struct ObjectSymbolInserter : Inserter {
@@ -67,14 +67,14 @@ struct ObjectSymbolInserter : Inserter {
Symbol symbol;
ObjectSymbolInserter(Cursor &c, const Symbol &s) : cursor(c), symbol(s) {}
- virtual Cursor &insertNix() const;
- virtual Cursor &insertBool(bool value) const;
- virtual Cursor &insertLong(int64_t value) const;
- virtual Cursor &insertDouble(double value) const;
- virtual Cursor &insertString(Memory value) const;
- virtual Cursor &insertData(Memory value) const;
- virtual Cursor &insertArray() const;
- virtual Cursor &insertObject() const;
+ Cursor &insertNix() const override;
+ Cursor &insertBool(bool value) const override;
+ Cursor &insertLong(int64_t value) const override;
+ Cursor &insertDouble(double value) const override;
+ Cursor &insertString(Memory value) const override;
+ Cursor &insertData(Memory value) const override;
+ Cursor &insertArray() const override;
+ Cursor &insertObject() const override;
};
struct ObjectInserter : Inserter {
@@ -82,14 +82,14 @@ struct ObjectInserter : Inserter {
Memory name;
ObjectInserter(Cursor &c, const Memory &n) : cursor(c), name(n) {}
- virtual Cursor &insertNix() const;
- virtual Cursor &insertBool(bool value) const;
- virtual Cursor &insertLong(int64_t value) const;
- virtual Cursor &insertDouble(double value) const;
- virtual Cursor &insertString(Memory value) const;
- virtual Cursor &insertData(Memory value) const;
- virtual Cursor &insertArray() const;
- virtual Cursor &insertObject() const;
+ Cursor &insertNix() const override;
+ Cursor &insertBool(bool value) const override;
+ Cursor &insertLong(int64_t value) const override;
+ Cursor &insertDouble(double value) const override;
+ Cursor &insertString(Memory value) const override;
+ Cursor &insertData(Memory value) const override;
+ Cursor &insertArray() const override;
+ Cursor &insertObject() const override;
};
} // namespace slime
diff --git a/vespalib/src/vespa/vespalib/data/slime/inspector.cpp b/vespalib/src/vespa/vespalib/data/slime/inspector.cpp
index a387ab5b86a..cfcbdc99ce9 100644
--- a/vespalib/src/vespa/vespalib/data/slime/inspector.cpp
+++ b/vespalib/src/vespa/vespalib/data/slime/inspector.cpp
@@ -21,7 +21,7 @@ class EqualObject : public ObjectTraverser, public Equal {
public:
EqualObject(const Inspector & rhs) : Equal(rhs) { }
private:
- virtual void field(const Memory &symbol, const Inspector &inspector) {
+ void field(const Memory &symbol, const Inspector &inspector) override {
if ( _equal ) {
_equal = (inspector == _rhs[symbol]);
}
@@ -32,7 +32,7 @@ class EqualArray : public ArrayTraverser, public Equal {
public:
EqualArray(const Inspector & rhs) : Equal(rhs) { }
private:
- virtual void entry(size_t idx, const Inspector &inspector) {
+ void entry(size_t idx, const Inspector &inspector) override {
if ( _equal ) {
_equal = (inspector == _rhs[idx]);
}
diff --git a/vespalib/src/vespa/vespalib/data/slime/json_format.cpp b/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
index 30ac5d98042..b7b6c88667b 100644
--- a/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
+++ b/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
@@ -136,8 +136,8 @@ struct JsonEncoder : public ArrayTraverser,
}
abort(); // should not be reached
}
- virtual void entry(size_t idx, const Inspector &inspector);
- virtual void field(const Memory &symbol_name, const Inspector &inspector);
+ void entry(size_t idx, const Inspector &inspector) override;
+ void field(const Memory &symbol_name, const Inspector &inspector) override;
static void encode(const Inspector &inspector, OutputWriter &out) {
JsonEncoder<COMPACT> encoder(out);
diff --git a/vespalib/src/vespa/vespalib/data/slime/named_symbol_inserter.h b/vespalib/src/vespa/vespalib/data/slime/named_symbol_inserter.h
index 507804f20ee..13a55de765c 100644
--- a/vespalib/src/vespa/vespalib/data/slime/named_symbol_inserter.h
+++ b/vespalib/src/vespa/vespalib/data/slime/named_symbol_inserter.h
@@ -20,7 +20,7 @@ private:
public:
NamedSymbolInserter(SymbolTable &table, const Memory &name)
: _table(table), _name(name) {}
- virtual Symbol insert() {
+ Symbol insert() override {
return _table.insert(_name);
}
};
diff --git a/vespalib/src/vespa/vespalib/data/slime/named_symbol_lookup.h b/vespalib/src/vespa/vespalib/data/slime/named_symbol_lookup.h
index 792728f870b..5674fbb1e13 100644
--- a/vespalib/src/vespa/vespalib/data/slime/named_symbol_lookup.h
+++ b/vespalib/src/vespa/vespalib/data/slime/named_symbol_lookup.h
@@ -20,7 +20,7 @@ private:
public:
NamedSymbolLookup(const SymbolTable &table, const Memory &name)
: _table(table), _name(name) {}
- virtual Symbol lookup() const {
+ Symbol lookup() const override {
return _table.lookup(_name);
}
};
diff --git a/vespalib/src/vespa/vespalib/data/slime/object_value.h b/vespalib/src/vespa/vespalib/data/slime/object_value.h
index fc647caca1b..b927fab1705 100644
--- a/vespalib/src/vespa/vespalib/data/slime/object_value.h
+++ b/vespalib/src/vespa/vespalib/data/slime/object_value.h
@@ -65,23 +65,23 @@ public:
ObjectValue &operator=(const ObjectValue &) = delete;
- virtual Type type() const { return OBJECT::instance; }
- virtual size_t children() const { return _fields.size(); }
- virtual size_t fields() const { return _fields.size(); }
- virtual void traverse(ObjectSymbolTraverser &ot) const;
- virtual void traverse(ObjectTraverser &ot) const;
+ Type type() const override { return OBJECT::instance; }
+ size_t children() const override { return _fields.size(); }
+ size_t fields() const override { return _fields.size(); }
+ void traverse(ObjectSymbolTraverser &ot) const override;
+ void traverse(ObjectTraverser &ot) const override;
- virtual Cursor &operator[](Symbol sym) const;
- virtual Cursor &operator[](Memory name) const;
+ Cursor &operator[](Symbol sym) const override;
+ Cursor &operator[](Memory name) const override;
- virtual Cursor &setArray(Symbol sym);
- virtual Cursor &setObject(Symbol sym);
+ Cursor &setArray(Symbol sym) override;
+ Cursor &setObject(Symbol sym) override;
- virtual Cursor &setArray(Memory name);
- virtual Cursor &setObject(Memory name);
- virtual Symbol resolve(Memory symbol_name);
+ Cursor &setArray(Memory name) override;
+ Cursor &setObject(Memory name) override;
+ Symbol resolve(Memory symbol_name) override;
- virtual ~ObjectValue() { }
+ ~ObjectValue() { }
};
} // namespace vespalib::slime
diff --git a/vespalib/src/vespa/vespalib/data/slime/resolved_symbol.h b/vespalib/src/vespa/vespalib/data/slime/resolved_symbol.h
index f258ea6d7a1..481023d9616 100644
--- a/vespalib/src/vespa/vespalib/data/slime/resolved_symbol.h
+++ b/vespalib/src/vespa/vespalib/data/slime/resolved_symbol.h
@@ -22,10 +22,10 @@ private:
public:
ResolvedSymbol(const Symbol &symbol) : _symbol(symbol) {}
- virtual Symbol lookup() const {
+ Symbol lookup() const override {
return _symbol;
}
- virtual Symbol insert() {
+ Symbol insert() override {
return _symbol;
}
};
diff --git a/vespalib/src/vespa/vespalib/data/slime/value.h b/vespalib/src/vespa/vespalib/data/slime/value.h
index 0324ae8d49a..8d11531f619 100644
--- a/vespalib/src/vespa/vespalib/data/slime/value.h
+++ b/vespalib/src/vespa/vespalib/data/slime/value.h
@@ -29,56 +29,56 @@ protected:
virtual Cursor &setLeaf(Memory name, const ValueFactory &input);
public:
- virtual bool valid() const;
- virtual Type type() const;
- virtual size_t children() const;
- virtual size_t entries() const;
- virtual size_t fields() const;
-
- virtual bool asBool() const;
- virtual int64_t asLong() const;
- virtual double asDouble() const;
- virtual Memory asString() const;
- virtual Memory asData() const;
-
- virtual void traverse(ArrayTraverser &at) const;
- virtual void traverse(ObjectSymbolTraverser &ot) const;
- virtual void traverse(ObjectTraverser &ot) const;
-
- virtual vespalib::string toString() const override;
-
- virtual Cursor &operator[](size_t idx) const;
- virtual Cursor &operator[](Symbol sym) const;
- virtual Cursor &operator[](Memory name) const;
-
- virtual Cursor &addNix();
- virtual Cursor &addBool(bool bit);
- virtual Cursor &addLong(int64_t l);
- virtual Cursor &addDouble(double d);
- virtual Cursor &addString(Memory str);
- virtual Cursor &addData(Memory data);
- virtual Cursor &addArray();
- virtual Cursor &addObject();
-
- virtual Cursor &setNix(Symbol sym);
- virtual Cursor &setBool(Symbol sym, bool bit);
- virtual Cursor &setLong(Symbol sym, int64_t l);
- virtual Cursor &setDouble(Symbol sym, double d);
- virtual Cursor &setString(Symbol sym, Memory str);
- virtual Cursor &setData(Symbol sym, Memory data);
- virtual Cursor &setArray(Symbol sym);
- virtual Cursor &setObject(Symbol sym);
-
- virtual Cursor &setNix(Memory name);
- virtual Cursor &setBool(Memory name, bool bit);
- virtual Cursor &setLong(Memory name, int64_t l);
- virtual Cursor &setDouble(Memory name, double d);
- virtual Cursor &setString(Memory name, Memory str);
- virtual Cursor &setData(Memory name, Memory str);
- virtual Cursor &setArray(Memory name);
- virtual Cursor &setObject(Memory name);
-
- virtual Symbol resolve(Memory symbol_name);
+ bool valid() const override;
+ Type type() const override;
+ size_t children() const override;
+ size_t entries() const override;
+ size_t fields() const override;
+
+ bool asBool() const override;
+ int64_t asLong() const override;
+ double asDouble() const override;
+ Memory asString() const override;
+ Memory asData() const override;
+
+ void traverse(ArrayTraverser &at) const override;
+ void traverse(ObjectSymbolTraverser &ot) const override;
+ void traverse(ObjectTraverser &ot) const override;
+
+ vespalib::string toString() const override;
+
+ Cursor &operator[](size_t idx) const override;
+ Cursor &operator[](Symbol sym) const override;
+ Cursor &operator[](Memory name) const override;
+
+ Cursor &addNix() override;
+ Cursor &addBool(bool bit) override;
+ Cursor &addLong(int64_t l) override;
+ Cursor &addDouble(double d) override;
+ Cursor &addString(Memory str) override;
+ Cursor &addData(Memory data) override;
+ Cursor &addArray() override;
+ Cursor &addObject() override;
+
+ Cursor &setNix(Symbol sym) override;
+ Cursor &setBool(Symbol sym, bool bit) override;
+ Cursor &setLong(Symbol sym, int64_t l) override;
+ Cursor &setDouble(Symbol sym, double d) override;
+ Cursor &setString(Symbol sym, Memory str) override;
+ Cursor &setData(Symbol sym, Memory data) override;
+ Cursor &setArray(Symbol sym) override;
+ Cursor &setObject(Symbol sym) override;
+
+ Cursor &setNix(Memory name) override;
+ Cursor &setBool(Memory name, bool bit) override;
+ Cursor &setLong(Memory name, int64_t l) override;
+ Cursor &setDouble(Memory name, double d) override;
+ Cursor &setString(Memory name, Memory str) override;
+ Cursor &setData(Memory name, Memory str) override;
+ Cursor &setArray(Memory name) override;
+ Cursor &setObject(Memory name) override;
+
+ Symbol resolve(Memory symbol_name) override;
};
} // namespace vespalib::slime
diff --git a/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp b/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp
index 7741b60ac01..8ead9508c52 100644
--- a/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp
+++ b/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp
@@ -21,27 +21,27 @@ public:
class GenericFactory :public Factory{
public:
- virtual IAccelrated::UP create() const { return IAccelrated::UP(new GenericAccelrator()); }
+ IAccelrated::UP create() const override { return IAccelrated::UP(new GenericAccelrator()); }
};
class Sse2Factory :public Factory{
public:
- virtual IAccelrated::UP create() const { return IAccelrated::UP(new Sse2Accelrator()); }
+ IAccelrated::UP create() const override { return IAccelrated::UP(new Sse2Accelrator()); }
};
class AvxFactory :public Factory{
public:
- virtual IAccelrated::UP create() const { return IAccelrated::UP(new AvxAccelrator()); }
+ IAccelrated::UP create() const override { return IAccelrated::UP(new AvxAccelrator()); }
};
class Avx2Factory :public Factory{
public:
- virtual IAccelrated::UP create() const { return IAccelrated::UP(new Avx2Accelrator()); }
+ IAccelrated::UP create() const override { return IAccelrated::UP(new Avx2Accelrator()); }
};
class Avx512Factory :public Factory{
public:
- virtual IAccelrated::UP create() const { return IAccelrated::UP(new Avx512Accelrator()); }
+ IAccelrated::UP create() const override { return IAccelrated::UP(new Avx512Accelrator()); }
};
template<typename T>
diff --git a/vespalib/src/vespa/vespalib/io/fileutil.h b/vespalib/src/vespa/vespalib/io/fileutil.h
index 52d0e9b3cd6..8ad05c96152 100644
--- a/vespalib/src/vespa/vespalib/io/fileutil.h
+++ b/vespalib/src/vespa/vespalib/io/fileutil.h
@@ -233,24 +233,24 @@ public:
{ _autoCreateDirectories = autoCreate; }
bool autoCreateDirectories() const { return _autoCreateDirectories; }
- int getFileDescriptor() const {
+ int getFileDescriptor() const override {
if (!isOpen()) {
const_cast<LazyFile&>(*this).open(_flags, _autoCreateDirectories);
}
return File::getFileDescriptor();
}
- void resize(off_t size) {
+ void resize(off_t size) override {
if (!isOpen()) { open(_flags, _autoCreateDirectories); }
File::resize(size);
}
- off_t write(const void *buf, size_t bufsize, off_t offset) {
+ off_t write(const void *buf, size_t bufsize, off_t offset) override {
if (!isOpen()) { open(_flags, _autoCreateDirectories); }
return File::write(buf, bufsize, offset);
}
- size_t read(void *buf, size_t bufsize, off_t offset) const {
+ size_t read(void *buf, size_t bufsize, off_t offset) const override {
if (!isOpen()) {
const_cast<LazyFile&>(*this).open(_flags, _autoCreateDirectories);
}
diff --git a/vespalib/src/vespa/vespalib/testkit/test_hook.cpp b/vespalib/src/vespa/vespalib/testkit/test_hook.cpp
index ac051e03217..2c00bbda744 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_hook.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/test_hook.cpp
@@ -12,14 +12,14 @@ namespace {
struct FastOSTestThreadRunner : FastOS_Runnable {
TestThreadEntry &entry;
FastOSTestThreadRunner(TestThreadEntry &entry_in) : entry(entry_in) {}
- virtual bool DeleteOnCompletion() const { return true; }
- virtual void Run(FastOS_ThreadInterface *, void *) { entry.threadEntry(); }
+ bool DeleteOnCompletion() const override { return true; }
+ void Run(FastOS_ThreadInterface *, void *) override { entry.threadEntry(); }
};
struct FastOSTestThreadFactory : TestThreadFactory {
FastOS_ThreadPool threadPool;
FastOSTestThreadFactory() : threadPool(256 * 1024) {}
- virtual void createThread(TestThreadEntry &entry) {
+ void createThread(TestThreadEntry &entry) override {
threadPool.NewThread(new FastOSTestThreadRunner(entry), 0);
}
};
diff --git a/vespalib/src/vespa/vespalib/testkit/test_hook.h b/vespalib/src/vespa/vespalib/testkit/test_hook.h
index 2dc67595736..746a05733bd 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_hook.h
+++ b/vespalib/src/vespa/vespalib/testkit/test_hook.h
@@ -47,7 +47,7 @@ public:
_latch(l), _barrier(b), _traceStack(traceStack),
_fixture(fixture) {}
- virtual void threadEntry();
+ void threadEntry() override;
bool getResult() const {
return _result;
}
diff --git a/vespalib/src/vespa/vespalib/util/active.h b/vespalib/src/vespa/vespalib/util/active.h
index e1a77040862..deede405bd1 100644
--- a/vespalib/src/vespa/vespalib/util/active.h
+++ b/vespalib/src/vespa/vespalib/util/active.h
@@ -24,9 +24,6 @@ struct Active : Joinable {
**/
virtual Joinable &stop() = 0;
- // inherits documentation from Joinable
- virtual void join() = 0;
-
/**
* Empty virtual destructor to enable subclassing.
**/
diff --git a/vespalib/src/vespa/vespalib/util/dual_merge_director.h b/vespalib/src/vespa/vespalib/util/dual_merge_director.h
index 0ef42f367b5..6676d40042e 100644
--- a/vespalib/src/vespa/vespalib/util/dual_merge_director.h
+++ b/vespalib/src/vespa/vespalib/util/dual_merge_director.h
@@ -50,14 +50,14 @@ private:
bool last;
MixedMergeStateExchanger(bool v) :
Rendezvous<MergeState, MergeState>(2), last(v) {}
- virtual void mingle();
+ void mingle() override;
};
struct MergeStateExchanger : Rendezvous<MergeState, MergeState> {
size_t remaining;
MergeStateExchanger(size_t r) :
Rendezvous<MergeState, MergeState>(2), remaining(r) {}
- virtual void mingle();
+ void mingle() override;
};
size_t _num_threads;
diff --git a/vespalib/src/vespa/vespalib/util/runnable_pair.h b/vespalib/src/vespa/vespalib/util/runnable_pair.h
index 620a4d92f34..58dc45f4566 100644
--- a/vespalib/src/vespa/vespalib/util/runnable_pair.h
+++ b/vespalib/src/vespa/vespalib/util/runnable_pair.h
@@ -17,7 +17,7 @@ private:
public:
RunnablePair(Runnable &first, Runnable &second);
- virtual void run();
+ void run() override;
};
} // namespace vesaplib
diff --git a/vespalib/src/vespa/vespalib/util/simple_thread_bundle.cpp b/vespalib/src/vespa/vespalib/util/simple_thread_bundle.cpp
index ad287c54d6a..b90f07cf691 100644
--- a/vespalib/src/vespa/vespalib/util/simple_thread_bundle.cpp
+++ b/vespalib/src/vespa/vespalib/util/simple_thread_bundle.cpp
@@ -12,26 +12,26 @@ namespace {
struct SignalHook : Runnable {
Signal &signal;
SignalHook(Signal &s) : signal(s) {}
- virtual void run() { signal.send(); }
+ void run() override { signal.send(); }
};
struct BroadcastHook : Runnable {
Signal &signal;
BroadcastHook(Signal &s) : signal(s) {}
- virtual void run() { signal.broadcast(); }
+ void run() override { signal.broadcast(); }
};
struct PartHook : Runnable {
Part part;
PartHook(const Part &p) : part(p) {}
- virtual void run() { part.perform(); }
+ void run() override { part.perform(); }
};
struct HookPair : Runnable {
Runnable::UP first;
Runnable::UP second;
HookPair(Runnable::UP f, Runnable::UP s) : first(std::move(f)), second(std::move(s)) {}
- virtual void run() {
+ void run() override {
first->run();
second->run();
}
diff --git a/vespalib/src/vespa/vespalib/util/simple_thread_bundle.h b/vespalib/src/vespa/vespalib/util/simple_thread_bundle.h
index f4b5d174ae1..4c656baf6c3 100644
--- a/vespalib/src/vespa/vespalib/util/simple_thread_bundle.h
+++ b/vespalib/src/vespa/vespalib/util/simple_thread_bundle.h
@@ -113,7 +113,7 @@ private:
Worker(Signal &s, Runnable::UP h) : thread(*this), signal(s), hook(std::move(h)) {
thread.start();
}
- virtual void run() {
+ void run() override {
for (size_t gen = 0; signal.wait(gen) > 0; ) {
hook->run();
}
@@ -127,9 +127,9 @@ private:
public:
SimpleThreadBundle(size_t size, Strategy strategy = USE_SIGNAL_LIST);
- virtual ~SimpleThreadBundle();
- virtual size_t size() const;
- virtual void run(const std::vector<Runnable*> &targets);
+ ~SimpleThreadBundle();
+ size_t size() const override;
+ void run(const std::vector<Runnable*> &targets) override;
};
} // namespace vespalib
diff --git a/vespalib/src/vespa/vespalib/util/slaveproc.h b/vespalib/src/vespa/vespalib/util/slaveproc.h
index 69055feec27..4b0ce5db156 100644
--- a/vespalib/src/vespa/vespalib/util/slaveproc.h
+++ b/vespalib/src/vespa/vespalib/util/slaveproc.h
@@ -37,7 +37,7 @@ private:
int _waitCnt;
bool _readEOF;
- virtual void OnReceiveData(const void *data, size_t length);
+ void OnReceiveData(const void *data, size_t length) override;
bool hasData();
bool waitForData(slaveproc::Timer &timer, MonitorGuard &lock);
void updateEOF();
diff --git a/vespalib/src/vespa/vespalib/util/thread.h b/vespalib/src/vespa/vespalib/util/thread.h
index 1a87b3bc576..72ac1570e79 100644
--- a/vespalib/src/vespa/vespalib/util/thread.h
+++ b/vespalib/src/vespa/vespalib/util/thread.h
@@ -42,9 +42,9 @@ private:
public:
Thread(Runnable &runnable);
~Thread();
- virtual void start();
- virtual Thread &stop();
- virtual void join();
+ void start() override;
+ Thread &stop() override;
+ void join() override;
bool stopped() const { return _stopped; }
bool slumber(double s);
static Thread &currentThread();
diff --git a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h
index 10bf8113e05..c2f5742009f 100644
--- a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h
+++ b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h
@@ -115,7 +115,7 @@ private:
bool obtainTask(Worker &worker);
// from FastOS_Runnable (all workers live here)
- virtual void Run(FastOS_ThreadInterface *, void *);
+ void Run(FastOS_ThreadInterface *, void *) override;
protected:
/**
@@ -182,7 +182,7 @@ public:
Stats getStats();
// inherited from Executor
- virtual Task::UP execute(Task::UP task);
+ Task::UP execute(Task::UP task) override;
/**
* Synchronize with this executor. This function will block until
@@ -191,7 +191,7 @@ public:
*
* @return this object; for chaining
**/
- virtual ThreadStackExecutorBase &sync();
+ ThreadStackExecutorBase &sync() override;
/**
* Block the calling thread until the current task count is equal