diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-03 22:46:03 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-04 16:36:18 +0200 |
commit | 37cfa9ab6b103ae733a783cde18c8384e0ace507 (patch) | |
tree | 99b4ec1964a7a392b4aec133c4b20a4a40ab0002 /staging_vespalib | |
parent | 5a48a81c4134bae524aa66e1e49624f678c8b6ce (diff) |
Override
Diffstat (limited to 'staging_vespalib')
11 files changed, 30 insertions, 39 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/data/fileheader.h b/staging_vespalib/src/vespa/vespalib/data/fileheader.h index 5c8b63bbd93..50d5a8d1105 100644 --- a/staging_vespalib/src/vespa/vespalib/data/fileheader.h +++ b/staging_vespalib/src/vespa/vespalib/data/fileheader.h @@ -1,9 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <map> #include "databuffer.h" #include <vespa/vespalib/util/exception.h> +#include <map> class FastOS_FileInterface; @@ -110,7 +110,7 @@ public: public: BufferReader(DataBuffer &buf); - size_t getData(char *buf, size_t len); + size_t getData(char *buf, size_t len) override; }; /** @@ -123,7 +123,7 @@ public: public: BufferWriter(DataBuffer &buf); - size_t putData(const char *buf, size_t len); + size_t putData(const char *buf, size_t len) override; }; class MMapReader : public IDataReader @@ -134,7 +134,7 @@ public: public: MMapReader(const char *buf, size_t sz); - size_t getData(char *buf, size_t len); + size_t getData(char *buf, size_t len) override; }; private: @@ -259,7 +259,7 @@ public: public: FileReader(FastOS_FileInterface &file); - size_t getData(char *buf, size_t len); + size_t getData(char *buf, size_t len) override; }; /** @@ -272,7 +272,7 @@ public: public: FileWriter(FastOS_FileInterface &file); - size_t putData(const char *buf, size_t len); + size_t putData(const char *buf, size_t len) override; }; private: @@ -296,7 +296,7 @@ public: * * @return The number of bytes required to hold the content of this. */ - size_t getSize() const; + size_t getSize() const override; /** * Deserializes header content from the given file into this. This requires that the file is open in read diff --git a/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.h b/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.h index 8561b6fb008..c31c8b41c73 100644 --- a/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.h +++ b/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.h @@ -18,7 +18,7 @@ public: SimpleComponentConfigProducer(); void addConfig(const Config &config); void removeConfig(const vespalib::string &name); - virtual void getComponentConfig(Consumer &consumer); + void getComponentConfig(Consumer &consumer) override; }; } // namespace vespalib diff --git a/staging_vespalib/src/vespa/vespalib/net/simple_health_producer.h b/staging_vespalib/src/vespa/vespalib/net/simple_health_producer.h index 254b4ce29b7..fa219c33f48 100644 --- a/staging_vespalib/src/vespa/vespalib/net/simple_health_producer.h +++ b/staging_vespalib/src/vespa/vespalib/net/simple_health_producer.h @@ -17,7 +17,7 @@ public: SimpleHealthProducer(); void setOk(); void setFailed(const vespalib::string &msg); - virtual Health getHealth() const; + Health getHealth() const override; }; } // namespace vespalib diff --git a/staging_vespalib/src/vespa/vespalib/net/slime_explorer.cpp b/staging_vespalib/src/vespa/vespalib/net/slime_explorer.cpp index d6945064eb6..d0ca194c97d 100644 --- a/staging_vespalib/src/vespa/vespalib/net/slime_explorer.cpp +++ b/staging_vespalib/src/vespa/vespalib/net/slime_explorer.cpp @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "slime_explorer.h" -#include <vespa/vespalib/data/slime/inject.h> namespace vespalib { @@ -10,7 +9,7 @@ namespace { struct SelfState : slime::ObjectTraverser { Slime result; SelfState() : result() { result.setObject(); } - virtual void field(const Memory &key, const slime::Inspector &value) { + void field(const Memory &key, const slime::Inspector &value) override { if (value.type().getId() != slime::OBJECT::ID) { slime::inject(value, slime::ObjectInserter(result.get(), key)); } @@ -19,7 +18,7 @@ struct SelfState : slime::ObjectTraverser { struct ChildrenNames : slime::ObjectTraverser { std::vector<vespalib::string> result; - virtual void field(const Memory &key, const slime::Inspector &value) { + void field(const Memory &key, const slime::Inspector &value) override { if (value.type().getId() == slime::OBJECT::ID) { result.push_back(key.make_string()); } diff --git a/staging_vespalib/src/vespa/vespalib/net/state_api.cpp b/staging_vespalib/src/vespa/vespalib/net/state_api.cpp index 2c2dc55060d..f211ee90425 100644 --- a/staging_vespalib/src/vespa/vespalib/net/state_api.cpp +++ b/staging_vespalib/src/vespa/vespalib/net/state_api.cpp @@ -10,7 +10,7 @@ namespace { struct ConfigRenderer : ComponentConfigProducer::Consumer { JSONStringer &json; ConfigRenderer(JSONStringer &j) : json(j) {} - virtual void add(const ComponentConfigProducer::Config &config) { + void add(const ComponentConfigProducer::Config &config) override { json.appendKey(config.name); json.beginObject(); json.appendKey("generation"); @@ -27,7 +27,7 @@ struct ConfigGenerationObserver : ComponentConfigProducer::Consumer { size_t maxGen; bool seenSome; ConfigGenerationObserver() : maxGen(0), seenSome(false) {} - virtual void add(const ComponentConfigProducer::Config &config) { + void add(const ComponentConfigProducer::Config &config) override { if (seenSome) { maxGen = std::max(maxGen, config.gen); } else { diff --git a/staging_vespalib/src/vespa/vespalib/objects/identifiable.h b/staging_vespalib/src/vespa/vespalib/objects/identifiable.h index 6d320bbd864..5d68c781046 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/identifiable.h +++ b/staging_vespalib/src/vespa/vespalib/objects/identifiable.h @@ -168,7 +168,7 @@ public: bool equal(unsigned cid) const { return id() == cid; } int compare(const RuntimeClass& other) const { return (id() - other.id()); } private: - virtual stringref getName() const { return stringref(_rt->_name); } + stringref getName() const override { return stringref(_rt->_name); } RuntimeInfo * _rt; }; DECLARE_IDENTIFIABLE(Identifiable); diff --git a/staging_vespalib/src/vespa/vespalib/objects/objectdumper.h b/staging_vespalib/src/vespa/vespalib/objects/objectdumper.h index b630246328c..ebae4bc6eeb 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/objectdumper.h +++ b/staging_vespalib/src/vespa/vespalib/objects/objectdumper.h @@ -60,22 +60,14 @@ public: **/ vespalib::string toString() const { return _str; } - // inherit doc - virtual void openStruct(const vespalib::string &name, const vespalib::string &type); - // inherit doc - virtual void closeStruct(); - // inherit doc - virtual void visitBool(const vespalib::string &name, bool value); - // inherit doc - virtual void visitInt(const vespalib::string &name, int64_t value); - // inherit doc - virtual void visitFloat(const vespalib::string &name, double value); - // inherit doc - virtual void visitString(const vespalib::string &name, const vespalib::string &value); - // inherit doc - virtual void visitNull(const vespalib::string &name); - // inherit doc - virtual void visitNotImplemented(); + virtual void openStruct(const vespalib::string &name, const vespalib::string &type) override; + virtual void closeStruct() override; + virtual void visitBool(const vespalib::string &name, bool value) override; + virtual void visitInt(const vespalib::string &name, int64_t value) override; + virtual void visitFloat(const vespalib::string &name, double value) override; + virtual void visitString(const vespalib::string &name, const vespalib::string &value) override; + virtual void visitNull(const vespalib::string &name) override; + virtual void visitNotImplemented() override; }; } // namespace vespalib diff --git a/staging_vespalib/src/vespa/vespalib/util/clock.h b/staging_vespalib/src/vespa/vespalib/util/clock.h index 02311367fbb..4a5611bbe5a 100644 --- a/staging_vespalib/src/vespa/vespalib/util/clock.h +++ b/staging_vespalib/src/vespa/vespalib/util/clock.h @@ -27,7 +27,7 @@ private: void setTime() const; - virtual void Run(FastOS_ThreadInterface *thisThread, void *arguments); + void Run(FastOS_ThreadInterface *thisThread, void *arguments) override; public: Clock(double timePeriod=0.100); diff --git a/staging_vespalib/src/vespa/vespalib/util/document_runnable.h b/staging_vespalib/src/vespa/vespalib/util/document_runnable.h index 67ca8a67d78..3ea4b79f8a6 100644 --- a/staging_vespalib/src/vespa/vespalib/util/document_runnable.h +++ b/staging_vespalib/src/vespa/vespalib/util/document_runnable.h @@ -32,7 +32,7 @@ private: mutable vespalib::Monitor _stateLock; State _state; - void Run(FastOS_ThreadInterface*, void*); + void Run(FastOS_ThreadInterface*, void*) override; Runnable(const Runnable&); Runnable& operator=(const Runnable&); diff --git a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h index 50f5695902a..02181094607 100644 --- a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h +++ b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h @@ -26,7 +26,7 @@ class ShutdownGuard : public FastOS_Runnable FastOS_ThreadPool _pool; volatile uint64_t _dieAtTime; - virtual void Run(FastOS_ThreadInterface *, void *); + void Run(FastOS_ThreadInterface *, void *) override; public: /** diff --git a/staging_vespalib/src/vespa/vespalib/util/timer.cpp b/staging_vespalib/src/vespa/vespalib/util/timer.cpp index 4a719e69665..4e2fc3d54c6 100644 --- a/staging_vespalib/src/vespa/vespalib/util/timer.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/timer.cpp @@ -1,6 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "timer.h" -#include <vespa/fnet/fnet.h> +#include <vespa/fnet/scheduler.h> +#include <vespa/fnet/task.h> +#include <vespa/fnet/transport.h> namespace vespalib { @@ -22,13 +24,11 @@ public: _interval(interval) { } - ~TimerTask(void) - { + ~TimerTask() { Kill(); } - void PerformTask() - { + void PerformTask() override { _task->run(); Schedule(_interval); } |