From 068230a9c61396e7561469fb6cfb2150c53ba13b Mon Sep 17 00:00:00 2001 From: Sam Yates <sam@quux.dropbear.id.au> Date: Tue, 2 Aug 2016 21:22:40 +0200 Subject: [PATCH] More concise template parameter names. --- miniapp/trace_sampler.hpp | 18 +++++++++--------- src/communication/communicator.hpp | 4 ++-- src/connection.hpp | 4 ++-- src/event_queue.hpp | 8 ++++---- src/fvm_cell.hpp | 4 ++-- src/spike.hpp | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/miniapp/trace_sampler.hpp b/miniapp/trace_sampler.hpp index b0ea4dcb..2e10257a 100644 --- a/miniapp/trace_sampler.hpp +++ b/miniapp/trace_sampler.hpp @@ -13,10 +13,10 @@ namespace nest { namespace mc { // move sampler code to another source file... -template <typename TimeT=float, typename ValueT=double> +template <typename Time=float, typename Value=double> struct sample_trace { - using time_type = TimeT; - using value_type = ValueT; + using time_type = Time; + using value_type = Value; struct sample_type { time_type time; @@ -34,10 +34,10 @@ struct sample_trace { {} }; -template <typename TimeT=float, typename ValueT=double> +template <typename Time=float, typename Value=double> struct trace_sampler { - using time_type = TimeT; - using value_type = ValueT; + using time_type = Time; + using value_type = Value; float next_sample_t() const { return t_next_sample_; } @@ -62,9 +62,9 @@ private: }; // with type deduction ... -template <typename TimeT, typename ValueT> -trace_sampler<TimeT, ValueT> make_trace_sampler(sample_trace<TimeT, ValueT> *trace, TimeT sample_dt, TimeT tfrom=0) { - return trace_sampler<TimeT, ValueT>(trace, sample_dt, tfrom); +template <typename Time, typename Value> +trace_sampler<Time, Value> make_trace_sampler(sample_trace<Time, Value> *trace, Time sample_dt, Time tfrom=0) { + return trace_sampler<Time, Value>(trace, sample_dt, tfrom); } } // namespace mc diff --git a/src/communication/communicator.hpp b/src/communication/communicator.hpp index 437de1cd..cefffd4c 100644 --- a/src/communication/communicator.hpp +++ b/src/communication/communicator.hpp @@ -26,11 +26,11 @@ namespace communication { // Once all connections have been specified, the construct() method can be used // to build the data structures required for efficient spike communication and // event generation. -template <typename TimeT, typename CommunicationPolicy> +template <typename Time, typename CommunicationPolicy> class communicator { public: using id_type = cell_gid_type; - using time_type = TimeT; + using time_type = Time; using communication_policy_type = CommunicationPolicy; using spike_type = spike<cell_member_type, time_type>; diff --git a/src/connection.hpp b/src/connection.hpp index 9fffe97e..3ef99a9c 100644 --- a/src/connection.hpp +++ b/src/connection.hpp @@ -9,11 +9,11 @@ namespace nest { namespace mc { -template <typename TimeT> +template <typename Time> class connection { public: using id_type = cell_member_type; - using time_type = TimeT; + using time_type = Time; connection(id_type src, id_type dest, float w, time_type d) : source_(src), diff --git a/src/event_queue.hpp b/src/event_queue.hpp index 37f5097b..b78cc0ca 100644 --- a/src/event_queue.hpp +++ b/src/event_queue.hpp @@ -17,9 +17,9 @@ namespace mc { * time_type when() const return time value associated with event */ -template <typename TimeT> +template <typename Time> struct postsynaptic_spike_event { - using time_type = TimeT; + using time_type = Time; cell_member_type target; time_type time; @@ -28,9 +28,9 @@ struct postsynaptic_spike_event { time_type when() const { return time; } }; -template <typename TimeT> +template <typename Time> struct sample_event { - using time_type = TimeT; + using time_type = Time; std::uint32_t sampler_index; time_type time; diff --git a/src/fvm_cell.hpp b/src/fvm_cell.hpp index f10c7c7a..17176389 100644 --- a/src/fvm_cell.hpp +++ b/src/fvm_cell.hpp @@ -113,8 +113,8 @@ public: void advance(value_type dt); /// pass an event to the appropriate synapse and call net_receive - template <typename TimeT> - void apply_event(postsynaptic_spike_event<TimeT> e) { + template <typename Time> + void apply_event(postsynaptic_spike_event<Time> e) { mechanisms_[synapse_index_]->net_receive(e.target.index, e.weight); } diff --git a/src/spike.hpp b/src/spike.hpp index 898ffbb0..d3ea0255 100644 --- a/src/spike.hpp +++ b/src/spike.hpp @@ -6,10 +6,10 @@ namespace nest { namespace mc { -template <typename I, typename TimeT> +template <typename I, typename Time> struct spike { using id_type = I; - using time_type = TimeT; + using time_type = Time; id_type source = id_type{}; time_type time = -1.; -- GitLab