Skip to content

Commit

Permalink
overrides all around.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersbakken committed Mar 20, 2015
1 parent 83887b4 commit 4fc3c4d
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions rct/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class Config
};
template <typename T>
struct Option : public OptionBase {
virtual bool validate(String &err)
virtual bool validate(String &err) override
{
if (validator) {
const T t = value.convert<T>();
Expand All @@ -175,7 +175,7 @@ class Config

template <typename T>
struct ListOption : public OptionBase {
virtual bool validate(String &err)
virtual bool validate(String &err) override
{
if (validator) {
const List<Value> t = value.convert<List<Value> >();
Expand Down
6 changes: 3 additions & 3 deletions rct/ConnectMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class ConnectMessage : public Message
{
}

virtual int encodedSize() const { return 0; }
void encode(Serializer &) const {}
void decode(Deserializer &) {}
virtual int encodedSize() const override { return 0; }
virtual void encode(Serializer &) const override {}
virtual void decode(Deserializer &) override {}
};

#endif
4 changes: 2 additions & 2 deletions rct/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class SocketClientBuffer : public Serializer::Buffer
: mClient(client), mWritten(0)
{}

virtual bool write(const char *data, int len)
virtual bool write(const char *data, int len) override
{
if (mClient->write(data, len)) {
mWritten += len;
Expand All @@ -217,7 +217,7 @@ class SocketClientBuffer : public Serializer::Buffer
return false;
}

virtual int pos() const
virtual int pos() const override
{
return mWritten;
}
Expand Down
4 changes: 2 additions & 2 deletions rct/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Connection : public std::enable_shared_from_this<Connection>
ret->connect(client);
return ret;
}
virtual ~Connection();
~Connection();

void setVersion(int version) { mVersion = version; }
int version() const { return mVersion; }
Expand All @@ -41,7 +41,7 @@ class Connection : public std::enable_shared_from_this<Connection>

int pendingWrite() const;

virtual bool send(const Message &message);
bool send(const Message &message);
template <int StaticBufSize>
bool write(const char *format, ...)
{
Expand Down
6 changes: 3 additions & 3 deletions rct/FinishMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class FinishMessage : public Message

int status() const { return mStatus; }

virtual int encodedSize() const { return sizeof(mStatus); }
virtual void encode(Serializer &s) const { s << mStatus; }
virtual void decode(Deserializer &d) { d >> mStatus; }
virtual int encodedSize() const override { return sizeof(mStatus); }
virtual void encode(Serializer &s) const override { s << mStatus; }
virtual void decode(Deserializer &d) override { d >> mStatus; }
private:
int mStatus;
};
Expand Down
6 changes: 3 additions & 3 deletions rct/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FileOutput : public LogOutput
fclose(file);
}

virtual void log(const char *msg, int)
virtual void log(const char *msg, int) override
{
if (sTimedLogs) {
fprintf(file, "%s %s\n", String::formatTime(time(0), String::Time).constData(), msg);
Expand All @@ -45,7 +45,7 @@ class StderrOutput : public LogOutput
StderrOutput(int lvl)
: LogOutput(lvl)
{}
virtual void log(const char *msg, int)
virtual void log(const char *msg, int) override
{
if (sTimedLogs) {
fprintf(stderr, "%s %s\n", String::formatTime(time(0), String::Time).constData(), msg);
Expand All @@ -67,7 +67,7 @@ class SyslogOutput : public LogOutput
{
::closelog();
}
virtual void log(const char *msg, int)
virtual void log(const char *msg, int) override
{
::syslog(LOG_NOTICE, "%s", msg);
}
Expand Down
2 changes: 1 addition & 1 deletion rct/Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Message
class MessageCreator : public MessageCreatorBase
{
public:
virtual Message *create(const char *data, int size)
virtual Message *create(const char *data, int size) override
{
T *t = new T;
Deserializer deserializer(data, size);
Expand Down
2 changes: 1 addition & 1 deletion rct/MessageQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MessageThread : public Thread, public std::enable_shared_from_this<Message
void stop();

protected:
virtual void run();
virtual void run() override;

private:
static void notifyDataAvailable(const Buffer& buf, const std::weak_ptr<MessageThread>& thread);
Expand Down
6 changes: 3 additions & 3 deletions rct/QuitMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class QuitMessage : public Message
}

int exitCode() const { return mExitCode; }
virtual int encodedSize() const { return sizeof(int); }
void encode(Serializer &s) const { s << mExitCode; }
void decode(Deserializer &s) { s >> mExitCode; }
virtual int encodedSize() const override { return sizeof(int); }
void encode(Serializer &s) const override { s << mExitCode; }
void decode(Deserializer &s) override { s >> mExitCode; }
private:
int mExitCode;
};
Expand Down
6 changes: 3 additions & 3 deletions rct/ResponseMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class ResponseMessage : public Message
String data() const { return mData; }
void setData(const String &data) { mData = data; }

virtual int encodedSize() const { return mData.size() + sizeof(int); }
virtual void encode(Serializer &serializer) const { serializer << mData; }
virtual void decode(Deserializer &deserializer) { deserializer >> mData; }
virtual int encodedSize() const override { return mData.size() + sizeof(int); }
virtual void encode(Serializer &serializer) const override { serializer << mData; }
virtual void decode(Deserializer &deserializer) override { deserializer >> mData; }
private:
String mData;
Type mType;
Expand Down
2 changes: 1 addition & 1 deletion rct/ScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct ScriptEngineCustom : public Value::Custom
object.Reset(isolate, obj);
}

virtual String toString() const
virtual String toString() const override
{
if (object.IsEmpty())
return String("\"\"");
Expand Down
8 changes: 4 additions & 4 deletions rct/Serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class Serializer
: mString(&out.ref())
{}

virtual bool write(const char *data, int len)
virtual bool write(const char *data, int len) override
{
mString->append(data, len);
return true;
}
virtual int pos() const { return mString->size(); }
virtual int pos() const override { return mString->size(); }
private:
std::string *mString;
};
Expand All @@ -93,14 +93,14 @@ class Serializer
assert(f);
}

virtual bool write(const char *data, int len)
virtual bool write(const char *data, int len) override
{
assert(mFile);
const size_t ret = fwrite(data, sizeof(char), len, mFile);
return (ret == static_cast<size_t>(len));
}

virtual int pos() const
virtual int pos() const override
{
return static_cast<int>(ftell(mFile));
}
Expand Down
2 changes: 1 addition & 1 deletion rct/ThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ThreadPoolThread : public Thread
void stop();

protected:
virtual void run();
virtual void run() override;

private:
std::shared_ptr<ThreadPool::Job> mJob;
Expand Down

0 comments on commit 4fc3c4d

Please sign in to comment.