diff --git a/miniapp/miniapp.cpp b/miniapp/miniapp.cpp index 9f98b08fd5e740291d34142997b487db095a6bad..cf7592cd319d8cc3365f8e6465976fd0f31a3a34 100644 --- a/miniapp/miniapp.cpp +++ b/miniapp/miniapp.cpp @@ -19,6 +19,7 @@ #include <profiling/profiler.hpp> #include <threading/threading.hpp> #include <util/ioutil.hpp> +#include <util/nop.hpp> #include <util/optional.hpp> #include "io.hpp" @@ -70,10 +71,11 @@ int main(int argc, char** argv) { // File output is depending on the input arguments std::unique_ptr<file_export_type> file_exporter; + std::function<void(const std::vector<spike_type>&)> do_nothing{ + util::nop_function }; if (!options.spike_file_output) { - // TODO: use the no_function if PR:77 - m.set_global_spike_callback(file_export_type::do_nothing); - m.set_local_spike_callback(file_export_type::do_nothing); + m.set_global_spike_callback(do_nothing); + m.set_local_spike_callback(do_nothing); } else { // The exporter is the same for both global and local output @@ -84,7 +86,7 @@ int main(int argc, char** argv) { options.file_extention, options.over_write); if (options.single_file_per_rank) { - m.set_global_spike_callback(file_export_type::do_nothing); + m.set_global_spike_callback(do_nothing); m.set_local_spike_callback( [&](const std::vector<spike_type>& spikes) { file_exporter->output(spikes); @@ -95,7 +97,7 @@ int main(int argc, char** argv) { [&](const std::vector<spike_type>& spikes) { file_exporter->output(spikes); }); - m.set_local_spike_callback(file_export_type::do_nothing); + m.set_local_spike_callback(do_nothing); } } diff --git a/src/io/exporter.hpp b/src/io/exporter.hpp index de093aee25043fc02a75bb1e1c416bd6071ddf8f..a5885b7b10841593059402a491ccf21148b78df3 100644 --- a/src/io/exporter.hpp +++ b/src/io/exporter.hpp @@ -26,10 +26,6 @@ public: // Returns the status of the exporter virtual bool good() const = 0; - - // Static version of the do_export function for NOP callbacks - static void do_nothing(const std::vector<spike_type>&) - {} }; } //communication