26#include "neml2/base/OptionSet.h"
32#define register_NEML2_object(classname) \
33 static const char dummyvar_for_registering_obj_##classname = Registry::add<classname>(#classname)
37#define register_NEML2_object_alias(classname, registryname) \
38 static const char dummyvar_for_registering_obj_##classname = \
39 Registry::add<classname>(registryname)
73 static std::string
syntax_type(
const std::string & type);
81 static void add_inner(
const std::string &,
const std::string &,
const OptionSet &,
BuildPtr);
84 static std::shared_ptr<NEML2Object> build(
const OptionSet & options)
86 return std::make_shared<T>(options);
89 std::map<std::string, OptionSet> _expected_options;
91 std::map<std::string, BuildPtr> _objects;
93 std::map<std::string, std::string> _syntax_type;
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:54
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:85
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(const std::string &name)
Add information on a NEML2Object to the registry.
Definition Registry.h:60
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)
Demangle a piece of cxx abi type information.
Definition utils.cxx:32
Definition CrossRef.cxx:31
std::string name(ElasticConstant p)
Definition ElasticityConverter.cxx:30
std::shared_ptr< NEML2Object >(*)(const OptionSet &options) BuildPtr
Definition Registry.h:43