Skip to content
Snippets Groups Projects
Commit 9e22f238 authored by w.klijn's avatar w.klijn
Browse files

Remove the do_nothing function, and use Sam, fancy thingy

parent b251a45f
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <profiling/profiler.hpp> #include <profiling/profiler.hpp>
#include <threading/threading.hpp> #include <threading/threading.hpp>
#include <util/ioutil.hpp> #include <util/ioutil.hpp>
#include <util/nop.hpp>
#include <util/optional.hpp> #include <util/optional.hpp>
#include "io.hpp" #include "io.hpp"
...@@ -70,10 +71,11 @@ int main(int argc, char** argv) { ...@@ -70,10 +71,11 @@ int main(int argc, char** argv) {
// File output is depending on the input arguments // File output is depending on the input arguments
std::unique_ptr<file_export_type> file_exporter; 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) { if (!options.spike_file_output) {
// TODO: use the no_function if PR:77 m.set_global_spike_callback(do_nothing);
m.set_global_spike_callback(file_export_type::do_nothing); m.set_local_spike_callback(do_nothing);
m.set_local_spike_callback(file_export_type::do_nothing);
} }
else { else {
// The exporter is the same for both global and local output // The exporter is the same for both global and local output
...@@ -84,7 +86,7 @@ int main(int argc, char** argv) { ...@@ -84,7 +86,7 @@ int main(int argc, char** argv) {
options.file_extention, options.over_write); options.file_extention, options.over_write);
if (options.single_file_per_rank) { 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( m.set_local_spike_callback(
[&](const std::vector<spike_type>& spikes) { [&](const std::vector<spike_type>& spikes) {
file_exporter->output(spikes); file_exporter->output(spikes);
...@@ -95,7 +97,7 @@ int main(int argc, char** argv) { ...@@ -95,7 +97,7 @@ int main(int argc, char** argv) {
[&](const std::vector<spike_type>& spikes) { [&](const std::vector<spike_type>& spikes) {
file_exporter->output(spikes); file_exporter->output(spikes);
}); });
m.set_local_spike_callback(file_export_type::do_nothing); m.set_local_spike_callback(do_nothing);
} }
} }
......
...@@ -26,10 +26,6 @@ public: ...@@ -26,10 +26,6 @@ public:
// Returns the status of the exporter // Returns the status of the exporter
virtual bool good() const = 0; 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 } //communication
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment