BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Profile2DComponents Class Reference

Description

Predefined Fourier transformed distributions for functional tests.

Definition at line 29 of file Profile2DComponents.h.

Inheritance diagram for Profile2DComponents:
[legend]
Collaboration diagram for Profile2DComponents:
[legend]

Public Member Functions

 Profile2DComponents ()
 
const IProfile2DgetItem (const std::string &key) const
 
std::vector< std::string > keys () const
 
size_t size () const
 

Protected Member Functions

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

Private Attributes

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

Constructor & Destructor Documentation

◆ Profile2DComponents()

Profile2DComponents::Profile2DComponents ( )

Definition at line 18 of file Profile2DComponents.cpp.

20 {
21  add("Profile2DCauchy", new Profile2DCauchy(0.5, 1.0, 0));
22  add("Profile2DGauss", new Profile2DGauss(0.5, 1.0, 0));
23  add("Profile2DGate", new Profile2DGate(0.5, 1.0, 0));
24  add("Profile2DCone", new Profile2DCone(0.5, 1.0, 0));
25  add("Profile2DVoigt", new Profile2DVoigt(0.5, 1.0, 0, 0.2));
26 }
void add(const std::string &key, IProfile2D *item)
Definition: IRegistry.h:53
Two-dimensional Cauchy distribution in Fourier space; corresponds to a normalized exp(-r) in real spa...
Definition: Profiles2D.h:71
Two-dimensional cone distribution in Fourier space; corresponds to 1-r if r<1 (and 0 otherwise) in re...
Definition: Profiles2D.h:155
Two-dimensional gate distribution in Fourier space; corresponds to normalized constant if r<1 (and 0 ...
Definition: Profiles2D.h:127
Two-dimensional Gauss distribution in Fourier space; corresponds to normalized exp(-r^2/2) in real sp...
Definition: Profiles2D.h:99
Two-dimensional Voigt distribution in Fourier space; corresponds to eta*Gauss + (1-eta)*Cauchy.
Definition: Profiles2D.h:182

References IRegistry< IProfile2D >::add().

Here is the call graph for this function:

Member Function Documentation

◆ add()

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

Definition at line 53 of file IRegistry.h.

54  {
55  ASSERT(m_data.find(key) == m_data.end());
56  m_data[key] = std::unique_ptr<ValueType>(item);
57  }
#define ASSERT(condition)
Definition: Assert.h:45
std::map< std::string, std::unique_ptr< IProfile2D > > m_data
Definition: IRegistry.h:60

◆ getItem()

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

Definition at line 35 of file IRegistry.h.

36  {
37  auto it = m_data.find(key);
38  ASSERT(it != m_data.end());
39  return it->second.get();
40  }

◆ keys()

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

Definition at line 42 of file IRegistry.h.

43  {
44  std::vector<std::string> result;
45  for (const auto& it : m_data)
46  result.push_back(it.first);
47  return result;
48  }

◆ size()

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

Definition at line 50 of file IRegistry.h.

50 { return m_data.size(); }

Member Data Documentation

◆ m_data

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

Definition at line 60 of file IRegistry.h.


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