NEURON
mech_mapping.hpp
Go to the documentation of this file.
1 /*
2 # =============================================================================
3 # Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
4 #
5 # See top-level LICENSE file for details.
6 # =============================================================================
7 */
8 
9 #pragma once
10 
11 #include <string_view>
12 
13 /*
14  * todo : currently mod2c has exactly 4 different variable categories
15  * that are registered to coreneuron.
16  */
17 #define NB_MECH_VAR_CATEGORIES 4
18 
19 /*
20  * SerializedNames
21  *
22  * names are passed serialized using the following format:
23  * SerializedNames : {"0",[[<CategorieNames>,]*0,]* [[<CategorieNames>,]* 0]}
24  * All categories must be filled, if they are emtpy, just an other 0 follow.
25  *
26  * ex: {"0", "name1", "name2", 0, "name3, "name4", 0,0,0}
27  * This means the first categorie with names {name1,name2},
28  * the second categorie with {name3, name4}, 2 last categories are empty
29  */
30 namespace coreneuron {
31 struct Memb_list;
32 
33 using SerializedNames = const char**;
34 
35 // return pointer to value of a variable's mechanism, or nullptr if not found
36 double* get_var_location_from_var_name(int mech_id,
37  const std::string_view mech_name,
38  const std::string_view variable_name,
39  Memb_list* ml,
40  int local_index);
41 
42 // initialize mapping of variable names of mechanism, to their places in memory
43 void register_all_variables_offsets(int mech_id, SerializedNames variable_names);
44 
45 } // namespace coreneuron
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
double * get_var_location_from_var_name(int mech_id, const std::string_view mech_name, const std::string_view variable_name, Memb_list *ml, int node_index)
const char ** SerializedNames
void register_all_variables_offsets(int mech_id, SerializedNames variable_names)
A view into a set of mechanism instances.
Definition: nrnoc_ml.h:34