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

Use a define for spike_export_function

parent e6dc1c7a
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ public:
for (auto spike : spikes) {
char linebuf[45];
auto n = std::snprintf(linebuf, sizeof(linebuf), "%u %.4f\n",
unsigned{spike.source.gid}, float{spike.time});
unsigned{spike.source.gid}, float(spike.time));
file_handle_.write(linebuf, n);
}
}
......
......@@ -28,6 +28,7 @@ public:
using communicator_type = communication::communicator<time_type, communication::global_policy>;
using sampler_function = typename cell_group_type::sampler_function;
using spike_type = typename communicator_type::spike_type;
using spike_export_function = std::function<void(const std::vector<spike_type>&)>;
struct probe_record {
cell_member_type id;
......@@ -180,22 +181,18 @@ public:
// register a callback that will perform a export of the global
// spike vector
void set_global_spike_callback(std::function<void(
const std::vector<spike_type>&)> global_export_callback)
void set_global_spike_callback(spike_export_function export_callback)
{
global_export_callback_ = global_export_callback;
global_export_callback_ = export_callback;
}
// register a callback that will perform a export of the rank local
// spike vector
void set_local_spike_callback(std::function<void(
const std::vector<spike_type>&)> local_export_callback)
void set_local_spike_callback(spike_export_function export_callback)
{
local_export_callback_ = local_export_callback;
local_export_callback_ = export_callback;
}
private:
cell_gid_type cell_from_;
cell_gid_type cell_to_;
......@@ -211,8 +208,8 @@ private:
using local_spike_store_type = thread_private_spike_store<time_type>;
util::double_buffer< local_spike_store_type > local_spikes_;
std::function<void(const std::vector<spike_type>&)> global_export_callback_;
std::function<void(const std::vector<spike_type>&)> local_export_callback_;
spike_export_function global_export_callback_;
spike_export_function local_export_callback_;
// Convenience functions that map the spike buffers and event queues onto
// the appropriate integration interval.
//
......
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