BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Supports navigation through SessionModel. More...
Public Types | |
using | const_iterator = container_t::const_iterator |
using | container_t = std::vector< PathElement > |
using | iterator = container_t::iterator |
using | PathElement = int |
Public Member Functions | |
Path ()=default | |
void | append (PathElement element) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | prepend (PathElement element) |
std::string | str () const |
Returns string representing path ("0,0,1,3"). More... | |
Static Public Member Functions | |
static Path | fromString (const std::string &str) |
Constructs Path object from string containing sequence of integers ("0,0,1,3"). More... | |
static Path | fromVector (const std::vector< int > &data) |
Constructs Path object from vector of integers.. More... | |
Private Attributes | |
container_t | m_data |
Supports navigation through SessionModel.
Contains a chain of indexes that have to be used to reach the desired SessionItem starting from the root item. Path class plays a role of simplified QModelIndex for SessionModel. Used for undo/redo only. Example of tree:
using ModelView::Path::const_iterator = container_t::const_iterator |
using ModelView::Path::container_t = std::vector<PathElement> |
using ModelView::Path::iterator = container_t::iterator |
using ModelView::Path::PathElement = int |
|
default |
void Path::append | ( | Path::PathElement | element | ) |
Definition at line 57 of file path.cpp.
References m_data.
Referenced by fromString(), and TEST_F().
Path::iterator Path::begin | ( | ) |
Path::const_iterator Path::begin | ( | ) | const |
Path::iterator Path::end | ( | ) |
Path::const_iterator Path::end | ( | ) | const |
|
static |
Constructs Path object from string containing sequence of integers ("0,0,1,3").
Definition at line 25 of file path.cpp.
References append(), and str().
Referenced by TEST_F().
|
static |
void Path::prepend | ( | Path::PathElement | element | ) |
std::string Path::str | ( | ) | const |
Returns string representing path ("0,0,1,3").
Definition at line 49 of file path.cpp.
References m_data.
Referenced by fromString(), and TEST_F().
|
private |