pops-core
0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
|
Kernel types enum and helper functions. More...
#include <string>
#include <stdexcept>
Go to the source code of this file.
Namespaces | |
pops | |
Functions | |
DispersalKernelType | pops::kernel_type_from_string (const std::string &text) |
Get a corresponding enum value for a string which is a kernel name. More... | |
DispersalKernelType | pops::kernel_type_from_string (const char *text) |
Overload which allows to pass C-style string which is nullptr (NULL) More... | |
Kernel types enum and helper functions.
This file contains general functionality shared in general by all kernels.
An alternative implementation would be for each class to maintain its own enum of supported kernels, potentially creating a hierarchy of kernel types and subtypes. This would avoid the need for a separate header file such as this one due to all kernels potentially depending on it which prevents us from having it in the same header file like the main or default interface. However, this is easier for actually using the library as all kernel types are resolved by one function and one variable in the user code.
Definition in file kernel_types.hpp.