BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FTDistribution2DComponents Class Reference
Inheritance diagram for FTDistribution2DComponents:
Collaboration diagram for FTDistribution2DComponents:

Public Member Functions

 FTDistribution2DComponents ()
 
const IFTDistribution2DgetItem (const std::string &key) const
 
std::vector< std::string > keys () const
 
size_t size () const
 

Protected Member Functions

void add (const std::string &key, IFTDistribution2D *item)
 

Private Attributes

std::map< std::string, std::unique_ptr< IFTDistribution2D > > m_data
 

Detailed Description

Predefined Fourier transformed distributions for functional tests.

Definition at line 24 of file SampleComponents.h.

Constructor & Destructor Documentation

◆ FTDistribution2DComponents()

FTDistribution2DComponents::FTDistribution2DComponents ( )

Definition at line 20 of file SampleComponents.cpp.

22 {
23  add("FTDistribution2DCauchy", new FTDistribution2DCauchy(0.5, 1.0, 0));
24  add("FTDistribution2DGauss", new FTDistribution2DGauss(0.5, 1.0, 0));
25  add("FTDistribution2DGate", new FTDistribution2DGate(0.5, 1.0, 0));
26  add("FTDistribution2DCone", new FTDistribution2DCone(0.5, 1.0, 0));
27  add("FTDistribution2DVoigt", new FTDistribution2DVoigt(0.5, 1.0, 0, 0.2));
28 }
Two-dimensional Cauchy distribution in Fourier space; corresponds to a normalized exp(-r) in real spa...
Two-dimensional cone distribution in Fourier space; corresponds to 1-r if r<1 (and 0 otherwise) in re...
Two-dimensional gate distribution in Fourier space; corresponds to normalized constant if r<1 (and 0 ...
Two-dimensional Gauss distribution in Fourier space; corresponds to normalized exp(-r^2/2) in real sp...
Two-dimensional Voigt distribution in Fourier space; corresponds to eta*Gauss + (1-eta)*Cauchy.
void add(const std::string &key, IFTDistribution2D *item)
Definition: IRegistry.h:51

References IRegistry< IFTDistribution2D >::add().

Here is the call graph for this function:

Member Function Documentation

◆ getItem()

const IFTDistribution2D * IRegistry< IFTDistribution2D >::getItem ( const std::string &  key) const
inlineinherited

Definition at line 31 of file IRegistry.h.

32  {
33  auto it = m_data.find(key);
34  if (it == m_data.end())
36  "IRegistry::createItem() -> Error. Not existing item key '" + key + "'");
37  return it->second.get();
38  }
std::map< std::string, std::unique_ptr< IFTDistribution2D > > m_data
Definition: IRegistry.h:60

◆ keys()

std::vector<std::string> IRegistry< IFTDistribution2D >::keys ( ) const
inlineinherited

Definition at line 40 of file IRegistry.h.

41  {
42  std::vector<std::string> result;
43  for (auto it = m_data.begin(); it != m_data.end(); ++it)
44  result.push_back(it->first);
45  return result;
46  }

◆ size()

size_t IRegistry< IFTDistribution2D >::size ( ) const
inlineinherited

Definition at line 48 of file IRegistry.h.

48 { return m_data.size(); }

◆ add()

void IRegistry< IFTDistribution2D >::add ( const std::string &  key,
IFTDistribution2D item 
)
inlineprotectedinherited

Definition at line 51 of file IRegistry.h.

52  {
53  if (m_data.find(key) != m_data.end())
55  "IRegistry::createItem() -> Error. Already existing item with key '" + key + "'");
56  m_data[key] = std::unique_ptr<ValueType>(item);
57  }

Member Data Documentation

◆ m_data

std::map<std::string, std::unique_ptr<IFTDistribution2D > > IRegistry< IFTDistribution2D >::m_data
privateinherited

Definition at line 60 of file IRegistry.h.


The documentation for this class was generated from the following files: