BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Holds info about single tag for SessionItem. More...
Public Member Functions | |
TagInfo () | |
TagInfo (std::string name, int min, int max, std::vector< std::string > modelTypes) | |
bool | isSinglePropertyTag () const |
Returns true if this tag is used to store single properties. More... | |
bool | isValidChild (const std::string &modelType) const |
Returns true if given modelType matches the list of possible model types. More... | |
int | max () const |
bool | maximumReached () const |
int | min () const |
std::vector< std::string > | modelTypes () const |
std::string | name () const |
bool | operator!= (const TagInfo &other) const |
bool | operator== (const TagInfo &other) const |
Static Public Member Functions | |
static TagInfo | propertyTag (std::string name, std::string model_type) |
Constructs tag intended for single property. More... | |
static TagInfo | universalTag (std::string name, std::vector< std::string > modelTypes={}) |
Constructs universal tag intended for unlimited amount of various items. More... | |
Private Attributes | |
int | m_max |
int | m_min |
std::vector< std::string > | m_modelTypes |
std::string | m_name |
Holds info about single tag for SessionItem.
The tag specifies information about children that can be added to a SessionItem. A tag has a name, min, max allowed number of children, and vector of all modelTypes that children can have.
ModelView::TagInfo::TagInfo | ( | ) |
Definition at line 21 of file taginfo.cpp.
ModelView::TagInfo::TagInfo | ( | std::string | name, |
int | min, | ||
int | max, | ||
std::vector< std::string > | modelTypes | ||
) |
Definition at line 23 of file taginfo.cpp.
bool ModelView::TagInfo::isSinglePropertyTag | ( | ) | const |
Returns true if this tag is used to store single properties.
Properties are children that are created in SessionItem constructor using ::addProperty method.
Definition at line 75 of file taginfo.cpp.
Referenced by TEST_F().
bool ModelView::TagInfo::isValidChild | ( | const std::string & | modelType | ) | const |
Returns true if given modelType matches the list of possible model types.
Definition at line 67 of file taginfo.cpp.
References ModelView::Utils::Contains().
Referenced by ModelView::SessionItemContainer::is_valid_item(), and TEST_F().
int ModelView::TagInfo::max | ( | ) | const |
Definition at line 55 of file taginfo.cpp.
Referenced by ModelView::SessionItemContainer::maximum_reached(), TEST_F(), and ModelView::JsonTagInfoConverter::to_json().
bool ModelView::TagInfo::maximumReached | ( | ) | const |
int ModelView::TagInfo::min | ( | ) | const |
Definition at line 50 of file taginfo.cpp.
Referenced by ModelView::SessionItemContainer::minimum_reached(), TEST_F(), and ModelView::JsonTagInfoConverter::to_json().
std::vector< std::string > ModelView::TagInfo::modelTypes | ( | ) | const |
Definition at line 60 of file taginfo.cpp.
Referenced by TEST_F(), and ModelView::JsonTagInfoConverter::to_json().
std::string ModelView::TagInfo::name | ( | ) | const |
Definition at line 45 of file taginfo.cpp.
Referenced by ModelView::JsonItemContainerConverter::from_json(), ModelView::SessionItemContainer::name(), ModelView::SessionItemTags::registerTag(), TEST_F(), and ModelView::JsonTagInfoConverter::to_json().
bool ModelView::TagInfo::operator!= | ( | const TagInfo & | other | ) | const |
Definition at line 86 of file taginfo.cpp.
bool ModelView::TagInfo::operator== | ( | const TagInfo & | other | ) | const |
|
static |
Constructs tag intended for single property.
Definition at line 40 of file taginfo.cpp.
References RealSpace::Particles::name().
Referenced by ModelView::CompoundItem::addProperty(), and TEST_F().
|
static |
Constructs universal tag intended for unlimited amount of various items.
Definition at line 34 of file taginfo.cpp.
References RealSpace::Particles::name().
Referenced by ModelView::ContainerItem::ContainerItem(), ModelView::GraphViewportItem::GraphViewportItem(), ModelView::GroupItem::GroupItem(), ToyItems::LayerItem::LayerItem(), gui2::MaterialContainerItem::MaterialContainerItem(), gui2::MultiLayerItem::MultiLayerItem(), ToyItems::MultiLayerItem::MultiLayerItem(), StandardChildrenStrategiesTest::TestItem::TestItem(), SessionModel::SessionModelImpl::createRootItem(), TEST(), and TEST_F().
|
private |
Definition at line 60 of file taginfo.h.
Referenced by TagInfo(), and operator==().
|
private |
Definition at line 59 of file taginfo.h.
Referenced by TagInfo(), and operator==().
|
private |
Definition at line 61 of file taginfo.h.
Referenced by operator==().
|
private |
Definition at line 58 of file taginfo.h.
Referenced by TagInfo(), and operator==().