Skip to content
Snippets Groups Projects
HistoryView.h 1.91 KiB
Newer Older
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
//     NScD Oak Ridge National Laboratory, European Spallation Source
//     & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_API_HISTORYVIEW_H_
#define MANTID_API_HISTORYVIEW_H_

//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidAPI/HistoryItem.h"
#include "MantidAPI/WorkspaceHistory.h"
#include "MantidKernel/DateAndTime.h"

#include <list>
#include <vector>

namespace Mantid {
namespace API {
    This class builds a view of the algorithm history by "unrolling" parent
   algorithms.

    @author Samuel Jackson, ISIS, RAL
    @date 21/01/2008
    */

class MANTID_API_DLL HistoryView {
  HistoryView(const WorkspaceHistory &wsHist);
  virtual ~HistoryView() = default;
  void unroll(size_t index);
  void unrollAll();
  void roll(size_t index);
  void rollAll();
LamarMoore's avatar
LamarMoore committed
  void
  filterBetweenExecDate(Mantid::Types::Core::DateAndTime start,
                        Mantid::Types::Core::DateAndTime end =
                            Mantid::Types::Core::DateAndTime::getCurrentTime());
   * Get the list of History Items for this view.
   *
   * @returns vector of history items for this view.
   */
  const std::vector<HistoryItem> &getAlgorithmsList() const {
    return m_historyItems;
  };
  size_t size() const { return m_historyItems.size(); }
  void unroll(std::vector<HistoryItem>::iterator &it);
  void roll(std::vector<HistoryItem>::iterator &it);
  void rollChildren(std::vector<HistoryItem>::iterator it);
  const WorkspaceHistory m_wsHist;
  std::vector<HistoryItem> m_historyItems;
};

} // namespace API
} // namespace Mantid

#endif /*MANTID_API_HISTORYVIEW_H_*/