Singleton class for random strings.
More...
template<unsigned int SIZE = 4>
class nmodl::utils::SingletonRandomString< SIZE >
Singleton class for random strings.
Singleton class for random strings that are appended to the Eigen matrices names that are used in the solutions of nmodl::visitor::SympySolverVisitor and need to be the same to be printed by the nmodl::codegen::CodegenCoreneuronCppVisitor
Definition at line 67 of file common_utils.hpp.
#include <common_utils.hpp>
|
std::map< std::string, std::string > | random_strings |
| std::map that keeps the random strings assigned to variables as suffix More...
|
|
◆ SingletonRandomString() [1/2]
template<unsigned int SIZE = 4>
Delete public constructor needed for the singleton pattern to work.
◆ SingletonRandomString() [2/2]
template<unsigned int SIZE = 4>
◆ get_random_string()
template<unsigned int SIZE = 4>
Get the random string of the var_name variable.
- Parameters
-
var_name | Variable name for which to get the random string |
- Returns
- Random string assigned to var_name
Definition at line 94 of file common_utils.hpp.
◆ instance()
template<unsigned int SIZE = 4>
◆ operator=()
template<unsigned int SIZE = 4>
Delete public "=" operator.
◆ random_string_exists()
template<unsigned int SIZE = 4>
Check if there is a random string assigned as suffix for the var_name variable.
- Parameters
-
var_name | Variable name to check if exists in the std::map of random strings |
- Returns
- true if it exists, false if not
Definition at line 85 of file common_utils.hpp.
◆ reset_random_string()
template<unsigned int SIZE = 4>
If var_name has already got a random string assigned remove it from map and assign a new one, else simply insert a new random string for var_name.
- Parameters
-
var_name | Variable name for which to reset the random string |
use_numbers | control whether random string can include numeric characters or not |
- Returns
- Random string assigned to var_name
Definition at line 105 of file common_utils.hpp.
◆ random_strings
template<unsigned int SIZE = 4>
std::map that keeps the random strings assigned to variables as suffix
Definition at line 126 of file common_utils.hpp.
The documentation for this class was generated from the following file: