NEML2 2.0.0
Loading...
Searching...
No Matches
Registry Class Reference

Detailed Description

The Registry is used as a global singleton to collect information on all available NEML2Object that can be manufactured from the input file.

To register a concrete class to the registry, use the macro register_NEML2_object or register_NEML2_object_alias. Each object/class should only be registered once.

#include <Registry.h>

Static Public Member Functions

static Registryget ()
 Get the global Registry singleton.
 
template<typename T >
static char add (const std::string &name)
 Add information on a NEML2Object to the registry.
 
static void load (const std::filesystem::path &)
 Load registry from a dynamic library.
 
static const std::map< std::string, NEML2ObjectInfo > & info ()
 Get information of all registered objects.
 
static const NEML2ObjectInfoinfo (const std::string &)
 Get the information of an object given its syntax type.
 

Member Function Documentation

◆ add()

template<typename T >
static char add ( const std::string & name)
inlinestatic

Add information on a NEML2Object to the registry.

◆ get()

Registry & get ( )
static

Get the global Registry singleton.

◆ info() [1/2]

const std::map< std::string, NEML2ObjectInfo > & info ( )
static

Get information of all registered objects.

◆ info() [2/2]

const NEML2ObjectInfo & info ( const std::string & name)
static

Get the information of an object given its syntax type.

◆ load()

void load ( const std::filesystem::path & lib)
static

Load registry from a dynamic library.