26#include "neml2/base/OptionSet.h"
32#define register_NEML2_object(classname) \
33 static char dummyvar_for_registering_obj_##classname = Registry::add<classname>(#classname)
37#define register_NEML2_object_alias(classname, registryname) \
38 static char dummyvar_for_registering_obj_##classname = Registry::add<classname>(registryname)
59 static char add(std::string name)
72 static std::string
syntax_type(
const std::string & type);
80 static void add_inner(
const std::string &,
const std::string &,
const OptionSet &,
BuildPtr);
83 static std::shared_ptr<NEML2Object> build(
const OptionSet & options)
85 return std::make_shared<T>(options);
88 std::map<std::string, OptionSet> _expected_options;
90 std::map<std::string, BuildPtr> _objects;
92 std::map<std::string, std::string> _syntax_type;
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
static std::map< std::string, OptionSet > expected_options()
Return the expected options of all registered classs.
Definition Registry.cxx:38
static Registry & get()
Get the global Registry singleton.
Definition Registry.cxx:31
static BuildPtr builder(const std::string &name)
Return the build method pointer of a specific registered class.
Definition Registry.cxx:63
static char add(std::string name)
Add information on a NEML2Object to the registry.
Definition Registry.h:59
static std::string syntax_type(const std::string &type)
Return the syntax type (what appears in the input file) given a registered object's type.
Definition Registry.cxx:56
std::string demangle(const char *name)
Definition parser_utils.cxx:46
Definition CrossRef.cxx:32
std::shared_ptr< NEML2Object >(*)(const OptionSet &options) BuildPtr
Definition Registry.h:42