Skip to content

Commit

Permalink
Make return explicit?
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenhater committed Feb 12, 2025
1 parent 88fc189 commit f2c4e38
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions example/probe-demo/probe-demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,29 +195,29 @@ bool parse_options(options& opt, int& argc, char** argv) {
using probe_spec_t = std::tuple<std::string, std::function<any(std::any)>>;
std::pair<const char*, probe_spec_t> probe_tbl[] {
// located probes
{"v", {"v", [](std::any a) { return arb::cable_probe_membrane_voltage{any2loc(a)}; }}},
{"i_axial", {"i_axial", [](std::any a) { return arb::cable_probe_axial_current{any2loc(a)}; }}},
{"j_ion", {"j_ion", [](std::any a) { return arb::cable_probe_total_ion_current_density{any2loc(a)}; }}},
{"j_na", {"j_na", [](std::any a) { return arb::cable_probe_ion_current_density{any2loc(a), "na"}; }}},
{"j_k", {"j_k", [](std::any a) { return arb::cable_probe_ion_current_density{any2loc(a), "k"}; }}},
{"c_na", {"c_na", [](std::any a) { return arb::cable_probe_ion_int_concentration{any2loc(a), "na"}; }}},
{"c_k", {"c_k", [](std::any a) { return arb::cable_probe_ion_int_concentration{any2loc(a), "k"}; }}},
{"hh_m", {"hh_m", [](std::any a) { return arb::cable_probe_density_state{any2loc(a), "hh", "m"}; }}},
{"hh_h", {"hh_h", [](std::any a) { return arb::cable_probe_density_state{any2loc(a), "hh", "h"}; }}},
{"hh_n", {"hh_n", [](std::any a) { return arb::cable_probe_density_state{any2loc(a), "hh", "n"}; }}},
{"expsyn_g", {"expsyn_g", [](std::any a) { auto t = std::any_cast<arb::cell_tag_type>(a); return arb::cable_probe_point_state{t, "expsyn", "g"}; }}},
{"v", {"v", [](std::any a) -> std::any { return arb::cable_probe_membrane_voltage{any2loc(a)}; }}},
{"i_axial", {"i_axial", [](std::any a) -> std::any { return arb::cable_probe_axial_current{any2loc(a)}; }}},
{"j_ion", {"j_ion", [](std::any a) -> std::any { return arb::cable_probe_total_ion_current_density{any2loc(a)}; }}},
{"j_na", {"j_na", [](std::any a) -> std::any { return arb::cable_probe_ion_current_density{any2loc(a), "na"}; }}},
{"j_k", {"j_k", [](std::any a) -> std::any { return arb::cable_probe_ion_current_density{any2loc(a), "k"}; }}},
{"c_na", {"c_na", [](std::any a) -> std::any { return arb::cable_probe_ion_int_concentration{any2loc(a), "na"}; }}},
{"c_k", {"c_k", [](std::any a) -> std::any { return arb::cable_probe_ion_int_concentration{any2loc(a), "k"}; }}},
{"hh_m", {"hh_m", [](std::any a) -> std::any { return arb::cable_probe_density_state{any2loc(a), "hh", "m"}; }}},
{"hh_h", {"hh_h", [](std::any a) -> std::any { return arb::cable_probe_density_state{any2loc(a), "hh", "h"}; }}},
{"hh_n", {"hh_n", [](std::any a) -> std::any { return arb::cable_probe_density_state{any2loc(a), "hh", "n"}; }}},
{"expsyn_g", {"expsyn_g", [](std::any a) -> std::any { auto t = std::any_cast<arb::cell_tag_type>(a); return arb::cable_probe_point_state{t, "expsyn", "g"}; }}},
// all-of-cell probes
{"all_v", {"v", [](std::any) { return arb::cable_probe_membrane_voltage_cell{}; }}},
{"all_i_ion", {"i_ion", [](std::any) { return arb::cable_probe_total_ion_current_cell{}; }}},
{"all_i_na", {"i_na", [](std::any) { return arb::cable_probe_ion_current_cell{"na"}; }}},
{"all_i_k", {"i_k", [](std::any) { return arb::cable_probe_ion_current_cell{"k"}; }}},
{"all_i", {"i", [](std::any) { return arb::cable_probe_total_current_cell{}; }}},
{"all_c_na", {"c_na", [](std::any) { return arb::cable_probe_ion_int_concentration_cell{"na"}; }}},
{"all_c_k", {"c_k", [](std::any) { return arb::cable_probe_ion_int_concentration_cell{"k"}; }}},
{"all_hh_m", {"hh_m", [](std::any) { return arb::cable_probe_density_state_cell{"hh", "m"}; }}},
{"all_hh_h", {"hh_h", [](std::any) { return arb::cable_probe_density_state_cell{"hh", "h"}; }}},
{"all_hh_n", {"hh_n", [](std::any) { return arb::cable_probe_density_state_cell{"hh", "n"}; }}},
{"all_expsyn_g", {"expsyn_g", [](std::any) { return arb::cable_probe_point_state_cell{"expsyn", "g"}; }}},
{"all_v", {"v", [](std::any) -> std::any { return arb::cable_probe_membrane_voltage_cell{}; }}},
{"all_i_ion", {"i_ion", [](std::any) -> std::any { return arb::cable_probe_total_ion_current_cell{}; }}},
{"all_i_na", {"i_na", [](std::any) -> std::any { return arb::cable_probe_ion_current_cell{"na"}; }}},
{"all_i_k", {"i_k", [](std::any) -> std::any { return arb::cable_probe_ion_current_cell{"k"}; }}},
{"all_i", {"i", [](std::any) -> std::any { return arb::cable_probe_total_current_cell{}; }}},
{"all_c_na", {"c_na", [](std::any) -> std::any { return arb::cable_probe_ion_int_concentration_cell{"na"}; }}},
{"all_c_k", {"c_k", [](std::any) -> std::any { return arb::cable_probe_ion_int_concentration_cell{"k"}; }}},
{"all_hh_m", {"hh_m", [](std::any) -> std::any { return arb::cable_probe_density_state_cell{"hh", "m"}; }}},
{"all_hh_h", {"hh_h", [](std::any) -> std::any { return arb::cable_probe_density_state_cell{"hh", "h"}; }}},
{"all_hh_n", {"hh_n", [](std::any) -> std::any { return arb::cable_probe_density_state_cell{"hh", "n"}; }}},
{"all_expsyn_g", {"expsyn_g", [](std::any) -> std::any { return arb::cable_probe_point_state_cell{"expsyn", "g"}; }}},
};

auto double_or_string = [](const char* arg) -> to::maybe<std::any> {
Expand Down

0 comments on commit f2c4e38

Please sign in to comment.