dynLattice
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Member Functions | List of all members
MaterialFactory Class Reference

Factory for dynamic material creation and registration. More...

#include "MaterialFactory.h"

Inheritance diagram for MaterialFactory:
Inheritance graph
[legend]
Collaboration diagram for MaterialFactory:
Collaboration graph
[legend]

Classes

class  CtorMap_
 Internal constructor map for MaterialFactory. More...
 

Public Types

typedef MaterialFactory Self
 Type alias for the MaterialFactory class itself.
 
typedef Factory Super
 Type alias for the base Factory class.
 
typedef Ref< Material >(* Constructor) (const String &name, const Properties &conf, const Properties &props, const Properties &globdat)
 Constructor function pointer for material creation.
 

Static Public Member Functions

static void declare (const String &type, Constructor ctor)
 Register a material type with the factory.
 
static bool exists (const String &type)
 Check if a material type is registered.
 
static StringVector listKnownTypes ()
 Get list of all registered material types.
 
static Ref< Material > newInstance (const String &type, const String &name, const Properties &conf, const Properties &props, const Properties &globdat)
 Create material instance with explicit type.
 
static Ref< Material > newInstance (const String &name, const Properties &conf, const Properties &props, const Properties &globdat)
 Create material instance with type from properties.
 

Detailed Description

Provides centralized registry for material types, enabling dynamic instantiation based on string identifiers. Materials register with declare() and are created with newInstance().

Supported Materials

Author
Til Gärtner
See also
Material, ElasticRodMaterial, ElastoPlasticRodMaterial, declareMaterials()

Member Typedef Documentation

◆ Constructor

typedef Ref< Material >(* MaterialFactory::Constructor) (const String &name, const Properties &conf, const Properties &props, const Properties &globdat)
Parameters
nameMaterial instance identifier
confConfiguration properties for output
propsInput properties with material parameters
globdatGlobal simulation data
Returns
Reference to newly created Material

◆ Self

◆ Super

typedef Factory MaterialFactory::Super

Member Function Documentation

◆ declare()

void MaterialFactory::declare ( const String &  type,
Constructor  ctor 
)
static
Parameters
typeMaterial type identifier (e.g., "ElasticRodMaterial")
ctorConstructor function matching Constructor signature

◆ exists()

bool MaterialFactory::exists ( const String &  type)
static
Parameters
typeMaterial type identifier to check
Returns
true if registered, false otherwise

◆ listKnownTypes()

StringVector MaterialFactory::listKnownTypes ( )
static
Returns
Vector of registered material type identifiers

◆ newInstance() [1/2]

Ref< Material > MaterialFactory::newInstance ( const String &  name,
const Properties &  conf,
const Properties &  props,
const Properties &  globdat 
)
static
Parameters
nameMaterial instance name
confConfiguration properties for output
propsInput properties containing type and parameters
globdatGlobal simulation data
Returns
Reference to created Material
Exceptions
jive::util::noSuchTypeErrorif type not registered

◆ newInstance() [2/2]

Ref< Material > MaterialFactory::newInstance ( const String &  type,
const String &  name,
const Properties &  conf,
const Properties &  props,
const Properties &  globdat 
)
static
Parameters
typeMaterial type identifier
nameMaterial instance name
confConfiguration properties for output
propsInput properties with parameters
globdatGlobal simulation data
Returns
Reference to created Material (null if type not registered)