Skip to content

Commit

Permalink
Override
Browse files Browse the repository at this point in the history
  • Loading branch information
milasudril committed Feb 20, 2021
1 parent 89e8b4a commit 2488d50
Show file tree
Hide file tree
Showing 56 changed files with 296 additions and 293 deletions.
2 changes: 1 addition & 1 deletion command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace
ParamExtractor(const std::string& prefix
,std::vector<std::string>& result):r_prefix(prefix),r_result(result)
{}
void operator()(const char* value)
void operator()(const char* value) override
{r_result.push_back(r_prefix + value);}
private:
const std::string& r_prefix;
Expand Down
8 changes: 4 additions & 4 deletions dependencybufferdefault.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ namespace Maike
class PRIVATE DependencyBufferDefault final:public DependencyBuffer
{
public:
void append(Dependency&& dep)
void append(Dependency&& dep) override
{m_deps.push_back(std::move(dep));}

const Dependency* begin() const noexcept
const Dependency* begin() const noexcept override
{return m_deps.data();}

const Dependency* end() const noexcept
const Dependency* end() const noexcept override
{return begin() + m_deps.size();}

void append(const DependencyBuffer& buffer)
void append(const DependencyBuffer& buffer) override
{
std::for_each(buffer.begin(),buffer.end()
,[this](const Dependency& dep)
Expand Down
20 changes: 10 additions & 10 deletions dependencygraphdefault.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ namespace Maike
r_handler(handler),m_patch_needed(0)
{}

DependencyGraphDefault& targetRegister(Handle<Target>&& target);
DependencyGraphDefault& targetsPatch();
void targetsProcess(TargetProcessorConst&& proc) const;
DependencyGraphDefault& targetsProcess(TargetProcessor&& proc);
DependencyGraphDefault& targetsRemove(TargetProcessor&& condition);
Target* targetFind(const Stringkey& key);
const Target* targetFind(const Stringkey& key) const;
DependencyGraphDefault& targetRegister(Handle<Target>&& target) override;
DependencyGraphDefault& targetsPatch() override;
void targetsProcess(TargetProcessorConst&& proc) const override;
DependencyGraphDefault& targetsProcess(TargetProcessor&& proc) override;
DependencyGraphDefault& targetsRemove(TargetProcessor&& condition) override;
Target* targetFind(const Stringkey& key) override;
const Target* targetFind(const Stringkey& key) const override;

const Twins<size_t>& idRangeGet() const;
const Twins<size_t>& idRangeGet() const override;

DependencyGraphDefault& clear() noexcept;
DependencyGraphDefault& clear() noexcept override;

size_t targetsCountGet() const noexcept
size_t targetsCountGet() const noexcept override
{return m_targets.size();}

private:
Expand Down
6 changes: 3 additions & 3 deletions filein.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ namespace Maike
explicit FileIn(const char* filename);
~FileIn() noexcept;

size_t read(void* buffer,size_t count);
size_t read(void* buffer,size_t count) override;

const char* nameGet() const noexcept
const char* nameGet() const noexcept override
{return m_name.c_str();}

private:
std::string m_name;
intptr_t m_handle;
void destroy()
void destroy() override
{delete this;}
};
}
Expand Down
4 changes: 2 additions & 2 deletions fileout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ namespace Maike
FileOut(StdStream stream);
~FileOut() noexcept;

size_t write(const void* buffer,size_t count);
size_t write(const void* buffer,size_t count) override;

private:
intptr_t m_handle;
void destroy()
void destroy() override
{delete this;}
};
}
Expand Down
2 changes: 1 addition & 1 deletion graphedgewriterdot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Maike
{
public:
GraphEdgeWriterDOT(WriteBuffer& wb);
void edgeWrite(const char* from,const char* to,const char* label);
void edgeWrite(const char* from,const char* to,const char* label) override;
~GraphEdgeWriterDOT();
private:
WriteBuffer& r_wb;
Expand Down
6 changes: 3 additions & 3 deletions maike-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,18 @@ namespace
StringReader(const char* str,size_t n):r_str(str),m_n(n)
{}

size_t read(void* buffer,size_t n)
size_t read(void* buffer,size_t n) override
{
auto n_read=std::min(n,m_n);
memcpy(buffer,r_str,n_read);
m_n-=n_read;
return n_read;
}

const char* nameGet() const noexcept
const char* nameGet() const noexcept override
{return "Command line buffer";}

void destroy(){}
void destroy() override {}

private:
const char* r_str;
Expand Down
20 changes: 10 additions & 10 deletions maike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ namespace
TargetsListAll(WriteBuffer& wb):r_wb(wb)
{}

int operator()(const DependencyGraph&,const Target& target)
int operator()(const DependencyGraph&,const Target& target) override
{
r_wb.write(" * ").write(target.nameGet());
auto description=target.descriptionGet();
Expand Down Expand Up @@ -247,7 +247,7 @@ namespace
TargetsListLeaf(WriteBuffer& wb):r_wb(wb)
{}

int operator()(const DependencyGraph&,const Target& target)
int operator()(const DependencyGraph&,const Target& target) override
{
auto x=target.dependenciesInverseGet();
if(x.second - x.first==0)
Expand All @@ -257,7 +257,7 @@ namespace
if(*description!='\0')
{r_wb.write(" -- ").write(description);}
r_wb.write("\n");
}
}
return 0;
}
private:
Expand All @@ -283,7 +283,7 @@ namespace
TargetsListExternal(WriteBuffer& wb):r_wb(wb)
{}

int operator()(const DependencyGraph&,const Target& target)
int operator()(const DependencyGraph&,const Target& target) override
{
auto ptr=dynamic_cast<const TargetPlaceholder*>(&target);
if(ptr!=nullptr && ptr->relation()!=Dependency::Relation::MISC)
Expand Down Expand Up @@ -399,7 +399,7 @@ namespace
,id_range(maike.targetIdRangeGet())
{}

int operator()(DependencyGraph&,Target& target)
int operator()(DependencyGraph&,Target& target) override
{
auto x=target.dependenciesInverseGet();
if(x.second - x.first==0)
Expand Down Expand Up @@ -436,7 +436,7 @@ namespace
GraphEdgesWrite(GraphEdgeWriter& writer):r_writer(writer)
{}

int operator()(const DependencyGraph&,const Target& target)
int operator()(const DependencyGraph&,const Target& target) override
{
auto name_target=target.nameGet();
if(strcmp(name_target,".")!=0)
Expand Down Expand Up @@ -539,7 +539,7 @@ namespace
TargetDumpJSON(ResourceObject& db):r_db(db)
{}

int operator()(const DependencyGraph&,const Target& target)
int operator()(const DependencyGraph&,const Target& target) override
{
auto target_obj=r_db.createObject();
target.dump(target_obj);
Expand Down Expand Up @@ -594,7 +594,7 @@ namespace
TargetDumpTSV(WriteBuffer& wb):r_wb(wb)
{}

int operator()(const DependencyGraph&,const Target& target)
int operator()(const DependencyGraph&,const Target& target) override
{
::targetDumpTSV(target,r_wb);
return 0;
Expand Down Expand Up @@ -648,7 +648,7 @@ namespace
,id_range(maike.targetIdRangeGet())
{}

int operator()(DependencyGraph&,Target& target)
int operator()(DependencyGraph&,Target& target) override
{
auto x=target.dependenciesInverseGet();
if(x.second - x.first==0)
Expand Down Expand Up @@ -682,7 +682,7 @@ namespace
r_target_dir(target_dir),r_target_list(target_list)
{}

int operator()(const DependencyGraph&,const Target& target)
int operator()(const DependencyGraph&,const Target& target) override
{
r_target_list.insert(Stringkey(dircat(r_target_dir,target.nameGet()).c_str()));
return 0;
Expand Down
3 changes: 3 additions & 0 deletions maikeconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"-Wall",
"-Wsuggest-final-types",
"-Wextra",
"-Wsuggest-override",
"-Werror",
"{cflags_extra}",
"{iquote}",
Expand Down Expand Up @@ -50,6 +51,7 @@
"-Wall",
"-Wsuggest-final-types",
"-Wextra",
"-Wsuggest-override",
"-Werror",
"{cflags_extra}",
"{iquote}",
Expand Down Expand Up @@ -96,6 +98,7 @@
"-Wsuggest-final-types",
"-Wunused-parameter",
"-Wextra",
"-Wsuggest-override",
"-Werror",
"{cflags_extra}",
"{iquote}",
Expand Down
2 changes: 1 addition & 1 deletion parametersetmapfixed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Maike
using BaseType::length;
using BaseType::end;

void parameterGet(const Stringkey& key,ParameterProcessor&& proc) const;
void parameterGet(const Stringkey& key,ParameterProcessor&& proc) const override;
};

template<Stringkey::HashValue ... args>
Expand Down
10 changes: 5 additions & 5 deletions pipe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ namespace Maike
void operator delete(void *)=delete;
void operator delete[](void*)=delete;

size_t read(void* buffer, size_t n);
const char* nameGet() const noexcept;
size_t read(void* buffer, size_t n) override;
const char* nameGet() const noexcept override;

void init(intptr_t handle) noexcept
{m_handle=handle;}
Expand All @@ -99,7 +99,7 @@ namespace Maike

private:
intptr_t m_handle;
void destroy() noexcept
void destroy() noexcept override
{close();}
};

Expand All @@ -119,7 +119,7 @@ namespace Maike
void operator delete(void *)=delete;
void operator delete[](void*)=delete;

size_t write(const void* buffer, size_t n);
size_t write(const void* buffer, size_t n) override;

void init(intptr_t handle,bool echo) noexcept
{m_handle=handle; m_echo=echo;}
Expand All @@ -129,7 +129,7 @@ namespace Maike
private:
intptr_t m_handle;
bool m_echo;
void destroy() noexcept
void destroy() noexcept override
{close();}
};

Expand Down
6 changes: 3 additions & 3 deletions session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ namespace
public:
BySourceName(const char* filename):r_filename(filename){}

int operator()(DependencyGraph&,Target& target)
int operator()(DependencyGraph&,Target& target) override
{return strcmp(target.sourceNameGet(),r_filename);}

private:
Expand All @@ -191,7 +191,7 @@ namespace
public:
ByParentDirectory(const char* filename):r_filename(filename){}

int operator()(DependencyGraph&,Target& target)
int operator()(DependencyGraph&,Target& target) override
{return strcmp(target.inDirGet(),r_filename);}

private:
Expand Down Expand Up @@ -260,7 +260,7 @@ namespace
r_delegator(delegator)
{}

void operator()(const Stringkey& filename_ext,const Target_Hook& hook)
void operator()(const Stringkey& filename_ext,const Target_Hook& hook) override
{
r_delegator.loaderRegister(filename_ext,hook.loaderGet());
}
Expand Down
4 changes: 2 additions & 2 deletions spiderdefault.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ namespace Maike
SpiderDefault(Target_FactoryDelegator& deleg
,DependencyGraph& targets);

SpiderDefault& scanFile(const char* filename,const char* in_dir);
SpiderDefault& run();
SpiderDefault& scanFile(const char* filename,const char* in_dir) override;
SpiderDefault& run() override;

private:
Target_FactoryDelegator& r_target_creator;
Expand Down
6 changes: 3 additions & 3 deletions systemtargetinfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Maike
~SystemTargetInfo() noexcept;

void parameterGet(const Stringkey& key
,ParameterProcessor&& proc) const;
,ParameterProcessor&& proc) const override;

Variant variableGet(const Stringkey& key) const noexcept;

Expand All @@ -47,8 +47,8 @@ namespace Maike
void clear();

SystemTargetInfo& configAppend(const ResourceObject& targetinfo);
void configDump(ResourceObject& targetinfo) const;
ResourceObject configDump() const;
void configDump(ResourceObject& targetinfo) const override;
ResourceObject configDump() const override;

SystemTargetInfo& sysvarsLoad();
SystemTargetInfo& configAppendDefault();
Expand Down
Loading

0 comments on commit 2488d50

Please sign in to comment.