BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
InstrumentItemCatalog Class Reference

Description

Definition at line 23 of file InstrumentItemCatalog.h.

Classes

struct  UiInfo
 

Public Types

using CatalogedType = InstrumentItem
 
enum class  Type : uint8_t { GISAS = 0 , Offspec = 1 , Specular = 2 , DepthProbe = 3 }
 

Static Public Member Functions

static InstrumentItemcreate (Type type)
 Creates the item of the given type. More...
 
static Type type (const InstrumentItem *item)
 Returns the enum type of the given item. More...
 
static QVector< Typetypes ()
 Available types of items. More...
 
static UiInfo uiInfo (Type t)
 UiInfo on the given type. More...
 

Member Typedef Documentation

◆ CatalogedType

Member Enumeration Documentation

◆ Type

enum InstrumentItemCatalog::Type : uint8_t
strong
Enumerator
GISAS 
Offspec 
Specular 
DepthProbe 

Definition at line 28 of file InstrumentItemCatalog.h.

28 : uint8_t { GISAS = 0, Offspec = 1, Specular = 2, DepthProbe = 3 };

Member Function Documentation

◆ create()

InstrumentItem * InstrumentItemCatalog::create ( Type  type)
static

Creates the item of the given type.

Definition at line 19 of file InstrumentItemCatalog.cpp.

20 {
21  switch (type) {
22  case Type::GISAS:
23  return new GISASInstrumentItem();
24  case Type::Offspec:
25  return new OffspecInstrumentItem();
26  case Type::Specular:
27  return new SpecularInstrumentItem();
28  case Type::DepthProbe:
29  return new DepthProbeInstrumentItem();
30  }
31  ASSERT(false);
32 }
static Type type(const InstrumentItem *item)
Returns the enum type of the given item.

References DepthProbe, GISAS, Offspec, Specular, and type().

Referenced by InstrumentItem::createCopy().

Here is the call graph for this function:

◆ type()

InstrumentItemCatalog::Type InstrumentItemCatalog::type ( const InstrumentItem item)
static

Returns the enum type of the given item.

Definition at line 54 of file InstrumentItemCatalog.cpp.

55 {
56  if (dynamic_cast<const GISASInstrumentItem*>(item))
57  return Type::GISAS;
58  if (dynamic_cast<const OffspecInstrumentItem*>(item))
59  return Type::Offspec;
60  if (dynamic_cast<const SpecularInstrumentItem*>(item))
61  return Type::Specular;
62  if (dynamic_cast<const DepthProbeInstrumentItem*>(item))
63  return Type::DepthProbe;
64 
65  ASSERT(false);
66 }

References DepthProbe, GISAS, Offspec, and Specular.

Referenced by create(), InstrumentItem::createCopy(), and uiInfo().

◆ types()

QVector< InstrumentItemCatalog::Type > InstrumentItemCatalog::types ( )
static

Available types of items.

Definition at line 34 of file InstrumentItemCatalog.cpp.

References DepthProbe, GISAS, Offspec, and Specular.

◆ uiInfo()

InstrumentItemCatalog::UiInfo InstrumentItemCatalog::uiInfo ( Type  t)
static

UiInfo on the given type.

Definition at line 39 of file InstrumentItemCatalog.cpp.

40 {
41  switch (type) {
42  case Type::GISAS:
43  return {"GISAS", ""};
44  case Type::Offspec:
45  return {"Off specular", ""};
46  case Type::Specular:
47  return {"Specular", ""};
48  case Type::DepthProbe:
49  return {"Depth probe", ""};
50  }
51  ASSERT(false);
52 }

References DepthProbe, GISAS, Offspec, Specular, and type().

Here is the call graph for this function:

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