Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::API::HistoryView Class Reference

This class wraps an algorithm history pointer to add additional functionality when creating a HistoryView. More...

#include <HistoryView.h>

Public Member Functions

void filterBetweenExecDate (Mantid::Types::Core::DateAndTime start, Mantid::Types::Core::DateAndTime end=Mantid::Types::Core::DateAndTime::getCurrentTime())
 Filter the list of history items to remove any anlgorithms whos start time is outside of the given range. More...
 
const std::vector< HistoryItem > & getAlgorithmsList () const
 Get the list of History Items for this view. More...
 
 HistoryView (const WorkspaceHistory &wsHist)
 
void roll (size_t index)
 Roll an unrolled algorithm history item and remove its children from the view. More...
 
void rollAll ()
 Roll the entire algorithm history back up. More...
 
size_t size () const
 
void unroll (size_t index)
 Unroll an algorithm history to export its child algorithms. More...
 
void unrollAll ()
 Unroll the entire algorithm history. More...
 
virtual ~HistoryView ()=default
 

Private Member Functions

void roll (std::vector< HistoryItem >::iterator &it)
 Roll an unrolled algorithm history item and remove its children from the view. More...
 
void rollChildren (std::vector< HistoryItem >::iterator it)
 Check if our children are unrolled and if so roll them back up. More...
 
void unroll (std::vector< HistoryItem >::iterator &it)
 Unroll an algorithm history to export its child algorithms. More...
 

Private Attributes

std::vector< HistoryItemm_historyItems
 
const WorkspaceHistory m_wsHist
 

Detailed Description

This class wraps an algorithm history pointer to add additional functionality when creating a HistoryView.

This class builds a view of the algorithm history by "unrolling" parent algorithms.

Author
Samuel Jackson, ISIS, RAL
Date
21/01/2008

Definition at line 32 of file HistoryView.h.

Constructor & Destructor Documentation

◆ HistoryView()

Mantid::API::HistoryView::HistoryView ( const WorkspaceHistory wsHist)

◆ ~HistoryView()

virtual Mantid::API::HistoryView::~HistoryView ( )
virtualdefault

Member Function Documentation

◆ filterBetweenExecDate()

void Mantid::API::HistoryView::filterBetweenExecDate ( Mantid::Types::Core::DateAndTime  start,
Mantid::Types::Core::DateAndTime  end = Mantid::Types::Core::DateAndTime::getCurrentTime() 
)

Filter the list of history items to remove any anlgorithms whos start time is outside of the given range.

Parameters
startStart of time range
endEnd of time range

Definition at line 183 of file HistoryView.cpp.

References m_historyItems.

◆ getAlgorithmsList()

const std::vector< HistoryItem > & Mantid::API::HistoryView::getAlgorithmsList ( ) const
inline

Get the list of History Items for this view.

Returns
vector of history items for this view.

Definition at line 47 of file HistoryView.h.

◆ roll() [1/2]

void Mantid::API::HistoryView::roll ( size_t  index)

Roll an unrolled algorithm history item and remove its children from the view.

This removes each of the child algorithm histories (if any) and marks the parent as being "rolled up". Note that this will recursively "roll up" any child history objects that are also unrolled. This method does nothing if the history object has no children.

Parameters
index:: index of the history object to unroll
Exceptions
std::out_of_rangeif the index is larger than the number of history items.

Definition at line 120 of file HistoryView.cpp.

References index, m_historyItems, and roll().

Referenced by roll(), rollAll(), and rollChildren().

◆ roll() [2/2]

void Mantid::API::HistoryView::roll ( std::vector< HistoryItem >::iterator &  it)
private

Roll an unrolled algorithm history item and remove its children from the view.

This removes each of the child algorithm histories (if any) and marks the parent as being "rolled up". Note that this will recursively "roll up" any child history objects that are also unrolled. This method does nothing if the history object has no children.

Parameters
it:: iterator to the list of history item objects at the positon to roll

Definition at line 161 of file HistoryView.cpp.

References m_historyItems, and rollChildren().

◆ rollAll()

void Mantid::API::HistoryView::rollAll ( )

Roll the entire algorithm history back up.

This is method will roll up the entire history for every algorithm by calling roll on each element in the list. Only top level algorithms with be visible after calling this method.

Definition at line 98 of file HistoryView.cpp.

References m_historyItems, and roll().

◆ rollChildren()

void Mantid::API::HistoryView::rollChildren ( std::vector< HistoryItem >::iterator  it)
private

Check if our children are unrolled and if so roll them back up.

Parameters
it:: iterator pointing to the item whose children will be rolled up.

Definition at line 136 of file HistoryView.cpp.

References roll().

Referenced by roll().

◆ size()

size_t Mantid::API::HistoryView::size ( ) const
inline

Definition at line 49 of file HistoryView.h.

◆ unroll() [1/2]

void Mantid::API::HistoryView::unroll ( size_t  index)

Unroll an algorithm history to export its child algorithms.

This places each of the child algorithm histories into the HistoryView object. The parent is retained as a marker so we can "roll" the history back up if we want. This method does nothing if the history object has no children

Parameters
index:: index of the history object to unroll
Exceptions
std::out_of_rangeif the index is larger than the number of history items.

Definition at line 34 of file HistoryView.cpp.

References index, m_historyItems, and unroll().

Referenced by unroll(), and unrollAll().

◆ unroll() [2/2]

void Mantid::API::HistoryView::unroll ( std::vector< HistoryItem >::iterator &  it)
private

Unroll an algorithm history to export its child algorithms.

This places each of the child algorithm histories into the HistoryView object. The parent is retained as a marker so we can "roll" the history back up if we want. This method does nothing if the history object has no children

Parameters
it:: iterator to the list of history item objects at the position to unroll

Definition at line 56 of file HistoryView.cpp.

References history, and m_historyItems.

◆ unrollAll()

void Mantid::API::HistoryView::unrollAll ( )

Unroll the entire algorithm history.

This is method will unroll the entire history for every algorithm by calling unroll on each element in the list. Every child algorithm with be visible after calling this method.

Definition at line 81 of file HistoryView.cpp.

References m_historyItems, and unroll().

Member Data Documentation

◆ m_historyItems

std::vector<HistoryItem> Mantid::API::HistoryView::m_historyItems
private

Definition at line 57 of file HistoryView.h.

Referenced by filterBetweenExecDate(), HistoryView(), roll(), rollAll(), unroll(), and unrollAll().

◆ m_wsHist

const WorkspaceHistory Mantid::API::HistoryView::m_wsHist
private

Definition at line 56 of file HistoryView.h.


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