BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::TagRow Class Reference

Aggregate to hold (tag, row) information for SessionModel. More...

Public Member Functions

 TagRow ()
 
 TagRow (const char *name, int row=-1)
 
 TagRow (const std::string &name, int row=-1)
 
TagRow next () const
 Constructs new tagrow representing next row in given tag. More...
 
bool operator!= (const TagRow &other) const
 
bool operator== (const TagRow &other) const
 
TagRow prev () const
 Constructs new tagrow representing previous row in given tag. More...
 

Static Public Member Functions

static TagRow append (const std::string &tag_name={})
 Returns TagRow corresponding to the append to tag_name. More...
 
static TagRow prepend (const std::string &tag_name={})
 Returns TagRow corresponding to prepending to tag_name. More...
 

Public Attributes

int row = -1
 
std::string tag = {}
 

Detailed Description

Aggregate to hold (tag, row) information for SessionModel.

Definition at line 25 of file tagrow.h.

Constructor & Destructor Documentation

◆ TagRow() [1/3]

ModelView::TagRow::TagRow ( )
inline

Definition at line 30 of file tagrow.h.

30 {}

◆ TagRow() [2/3]

ModelView::TagRow::TagRow ( const std::string &  name,
int  row = -1 
)
inline

Definition at line 32 of file tagrow.h.

32 : tag(name), row(row) {}
std::string tag
Definition: tagrow.h:27
QString const & name(EShape k)
Definition: particles.cpp:21

◆ TagRow() [3/3]

ModelView::TagRow::TagRow ( const char *  name,
int  row = -1 
)
inline

Definition at line 33 of file tagrow.h.

33 : tag(name), row(row) {}

Member Function Documentation

◆ append()

ModelView::TagRow ModelView::TagRow::append ( const std::string &  tag_name = {})
static

Returns TagRow corresponding to the append to tag_name.

If tag_name =="" the default name will be used in SessionItemTags context.

Definition at line 36 of file tagrow.cpp.

37 {
38  return {tag_name, -1};
39 }

Referenced by StandardChildrenStrategiesTest::TestItem::TestItem(), ModelView::JsonModelConverter::from_json(), ModelView::GroupItem::init_group(), TEST(), and TEST_F().

◆ next()

ModelView::TagRow ModelView::TagRow::next ( ) const

Constructs new tagrow representing next row in given tag.

No validity check.

Definition at line 20 of file tagrow.cpp.

21 {
22  return {tag, row + 1};
23 }

References row, and tag.

Referenced by gui2::MaterialModel::cloneMaterial().

◆ operator!=()

bool ModelView::TagRow::operator!= ( const TagRow other) const

Definition at line 54 of file tagrow.cpp.

55 {
56  return !(*this == other);
57 }

◆ operator==()

bool ModelView::TagRow::operator== ( const TagRow other) const

Definition at line 49 of file tagrow.cpp.

50 {
51  return row == other.row && tag == other.tag;
52 }

References row, and tag.

◆ prepend()

ModelView::TagRow ModelView::TagRow::prepend ( const std::string &  tag_name = {})
static

Returns TagRow corresponding to prepending to tag_name.

If tag_name =="" the default name will be used in SessionItemTags context.

Definition at line 44 of file tagrow.cpp.

45 {
46  return {tag_name, 0};
47 }

Referenced by TEST_F().

◆ prev()

ModelView::TagRow ModelView::TagRow::prev ( ) const

Constructs new tagrow representing previous row in given tag.

No validity check.

Definition at line 28 of file tagrow.cpp.

29 {
30  return {tag, row - 1};
31 }

Member Data Documentation

◆ row

◆ tag


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