BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
tagrow.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/model/mvvm/model/tagrow.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #include "mvvm/model/tagrow.h"
16 
17 //! Constructs new tagrow representing next row in given tag.
18 //! No validity check.
19 
21 {
22  return {tag, row + 1};
23 }
24 
25 //! Constructs new tagrow representing previous row in given tag.
26 //! No validity check.
27 
29 {
30  return {tag, row - 1};
31 }
32 
33 //! Returns TagRow corresponding to the append to tag_name.
34 //! If tag_name =="" the default name will be used in SessionItemTags context.
35 
36 ModelView::TagRow ModelView::TagRow::append(const std::string& tag_name)
37 {
38  return {tag_name, -1};
39 }
40 
41 //! Returns TagRow corresponding to prepending to tag_name.
42 //! If tag_name =="" the default name will be used in SessionItemTags context.
43 
44 ModelView::TagRow ModelView::TagRow::prepend(const std::string& tag_name)
45 {
46  return {tag_name, 0};
47 }
48 
50 {
51  return row == other.row && tag == other.tag;
52 }
53 
55 {
56  return !(*this == other);
57 }
Aggregate to hold (tag, row) information for SessionModel.
Definition: tagrow.h:25
bool operator!=(const TagRow &other) const
Definition: tagrow.cpp:54
static TagRow append(const std::string &tag_name={})
Returns TagRow corresponding to the append to tag_name.
Definition: tagrow.cpp:36
TagRow next() const
Constructs new tagrow representing next row in given tag.
Definition: tagrow.cpp:20
static TagRow prepend(const std::string &tag_name={})
Returns TagRow corresponding to prepending to tag_name.
Definition: tagrow.cpp:44
std::string tag
Definition: tagrow.h:27
bool operator==(const TagRow &other) const
Definition: tagrow.cpp:49
TagRow prev() const
Constructs new tagrow representing previous row in given tag.
Definition: tagrow.cpp:28
Defines class CLASS?