BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IFactory.h File Reference
Include dependency graph for IFactory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  IFactory< Key, AbstractProduct >
 

Functions

template<class T >
T * create_new ()
 

Detailed Description

Defines interface class IFactory.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file IFactory.h.

Function Documentation

◆ create_new()

template<class T >
T* create_new ( )

Returns new instance of class T.

This templated function is used in catalogs in form of a function pointer 'create_new<T>', with no function arguments supplied. Equivalently, we could use a lambda function '[](){return new T;}'.

Definition at line 77 of file IFactory.h.

78 {
79  return new T();
80 }