go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Loading...
Searching...
No Matches
ImpactLoss::LossFactory Class Reference

#include <ImpactLoss.h>

Detailed Description

Singleton factory to register and create Loss instances by string name.

Used to instantiate losses dynamically from configuration. Example: "L1", "L2", "NCC", etc.

Definition at line 167 of file ImpactLoss.h.

Public Types

using CreatorFunc = std::function<std::unique_ptr<Loss>()>

Public Member Functions

std::unique_ptr< LossCreate (const std::string &name)
void RegisterLoss (const std::string &name, CreatorFunc creator)

Static Public Member Functions

static LossFactoryInstance ()

Private Attributes

std::unordered_map< std::string, CreatorFuncfactoryMap

Member Typedef Documentation

◆ CreatorFunc

using ImpactLoss::LossFactory::CreatorFunc = std::function<std::unique_ptr<Loss>()>

Definition at line 170 of file ImpactLoss.h.

Member Function Documentation

◆ Create()

std::unique_ptr< Loss > ImpactLoss::LossFactory::Create ( const std::string & name)
inline

Definition at line 186 of file ImpactLoss.h.

◆ Instance()

LossFactory & ImpactLoss::LossFactory::Instance ( )
inlinestatic

Definition at line 173 of file ImpactLoss.h.

◆ RegisterLoss()

void ImpactLoss::LossFactory::RegisterLoss ( const std::string & name,
CreatorFunc creator )
inline

Definition at line 180 of file ImpactLoss.h.

Member Data Documentation

◆ factoryMap

std::unordered_map<std::string, CreatorFunc> ImpactLoss::LossFactory::factoryMap
private

Definition at line 197 of file ImpactLoss.h.



Generated on 1774142652 for elastix by doxygen 1.15.0 elastix logo