#include <compare>#include <fstream>#include <functional>#include <initializer_list>#include <iostream>#include <memory>#include <optional>#include <string>#include <string_view>#include <tuple>#include <ankerl/unordered_dense.h>#include "mim/config.h"#include "mim/def.h"Go to the source code of this file.
Classes | |
| struct | mim::PluginArg |
| One -X <plugin>:<arg> a Plugin understands; see Arguments. More... | |
| struct | mim::PluginEnv |
| One environment variable a Plugin reads; see Environment Variables. More... | |
| struct | mim::PluginSym |
| One symbol a Plugin offers to other Plugins; see Driver::get_fun_ptr. More... | |
| class | mim::Out |
| A file name from the command line and the stream to write to;. More... | |
| struct | mim::Version |
| struct | mim::Plugin |
| Basic info and registration function pointer to be returned from a specific plugin. More... | |
| struct | mim::Annex |
| Holds info about an entity defined within a Plugin (called Annex). More... | |
Namespaces | |
| namespace | mim |
Macros | |
| #define | MIM_VERSION Version { MIM_VER_MAJOR, MIM_VER_MINOR, MIM_VER_SUFFIX, MIM_GIT_HASH } |
| #define | MIM_PLUGIN_ENTRY_NAME(p) |
| #define | MIM_PLUGIN_ENTRY(p) |
| Defines a Plugin's entry point; the body fills in the plugin handed to it, as in MIM_PLUGIN_ENTRY(demo) { plugin.register_normalizers = demo::register_normalizers; }. | |
Functions | |
Plugin Argument Lookup | |
Picks the -X <plugin>:<arg> strings of Driver::args / Phase::args apart. Each helper matches any of | |
| template<class... Keys> | |
| std::optional< std::string_view > | mim::arg_value (fe::View< std::string > args, Keys... keys) |
| std::optional< bool > | mim::arg_bool (fe::View< std::string > args, std::initializer_list< std::string_view > on, std::initializer_list< std::string_view > off) |
An on key ↦ true, an off key ↦ false; std::nullopt if neither occurs. | |
| template<class... Keys> | |
| bool | mim::arg_flag (fe::View< std::string > args, Keys... keys) |
Whether any of keys occurs. | |
Plugin Interface | |
| |
| #define | MIM_PLUGIN_SYM(f) |
Builds a PluginSym for f, so name and address cannot drift apart. | |
| using | mim::Normalizers = ankerl::unordered_dense::map<flags_t, NormalizeFn> |
| using | mim::Flags2Phases = ankerl::unordered_dense::map<flags_t, std::function<std::unique_ptr<Phase>(World&)>> |
| Maps an axiom of a Phase to a function that creates one. | |
| mim::Plugin | mim::mim_get_plugin () |
| struct mim::PluginArg |
One -X <plugin>:<arg> a Plugin understands; see Arguments.
A Plugin declares these next to the code that picks them apart, so that mim -p <plugin> -h can list them.
| struct mim::PluginEnv |
One environment variable a Plugin reads; see Environment Variables.
A Plugin declares these next to the code that reads them, so that mim -p <plugin> -h can list them.
| Class Members | ||
|---|---|---|
| const char * | descr | What it does; one sentence of Markdown, but no links: the terminal help prints it as is. |
| const char * | name | Name of the variable, e.g. "CUDA_HOME". |
| struct mim::PluginSym |
| #define MIM_PLUGIN_ENTRY | ( | p | ) |
Defines a Plugin's entry point; the body fills in the plugin handed to it, as in MIM_PLUGIN_ENTRY(demo) { plugin.register_normalizers = demo::register_normalizers; }.
Plugin::name and Plugin::version are already set, and every other field is zeroed. p must be the Plugin's name: a MIM_STATIC_PLUGINS build needs one entry point per Plugin.
Definition at line 196 of file plugin.h.
Referenced by MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), MIM_PLUGIN_ENTRY(), and MIM_PLUGIN_ENTRY().
| #define MIM_PLUGIN_SYM | ( | f | ) |
| #define MIM_VERSION Version { MIM_VER_MAJOR, MIM_VER_MINOR, MIM_VER_SUFFIX, MIM_GIT_HASH } |
Definition at line 150 of file plugin.h.
Referenced by mim::Driver::Driver().