13#if BOOST_VERSION == 106900
14#ifndef BOOST_PENDING_INTEGER_LOG2_HPP
15#define BOOST_PENDING_INTEGER_LOG2_HPP
16#include <boost/integer/integer_log2.hpp>
20#include <boost/uuid/uuid.hpp>
21#include <boost/uuid/uuid_generators.hpp>
22#include <boost/uuid/uuid_io.hpp>
31using Kernel::Property;
33using Kernel::PropertyHistory;
36using Types::Core::DateAndTime;
40static boost::uuids::random_generator uuidGen;
52 const double &duration, std::size_t uexeccount)
53 : m_name(alg->name()), m_version(alg->version()), m_executionDate(start), m_executionDuration(duration),
54 m_execCount(uexeccount), m_childHistories() {
58 m_uuid = boost::uuids::to_string(uuidGen());
77 const double &duration, std::size_t uexeccount)
78 : m_name(
std::move(name)), m_version(vers), m_executionDate(start), m_executionDuration(duration),
79 m_execCount(uexeccount), m_childHistories(), m_uuid(
std::move(uuid)) {}
91 const std::vector<Property *> &properties = alg->
getProperties();
92 std::transform(properties.cbegin(), properties.cend(), std::back_inserter(
m_properties),
93 [](
const auto &property) { return std::make_shared<PropertyHistory>(property->createHistory()); });
106 const double &duration, std::size_t uexeccount) {
131 const unsigned int &direction) {
140 if (
this == &(*childHist)) {
160 throw std::out_of_range(
"AlgorithmHistory::getAlgorithmHistory() - Index out of range");
181 [&
name](
const auto &
history) { return history->name() == name; });
185 return (*found)->value();
206 execDate.replace(execDate.find(
"T"), 1,
" ");
207 os << std::string(indent,
' ') <<
"Algorithm: " <<
m_name;
208 os << std::string(indent,
' ') <<
" v" <<
m_version <<
'\n';
210 os << std::string(indent,
' ') <<
"Execution Date: " << execDate <<
'\n';
211 os << std::string(indent,
' ') <<
"Execution Duration: " <<
m_executionDuration <<
" seconds\n";
212 os << std::string(indent,
' ') <<
"UUID: " <<
m_uuid <<
'\n';
213 os << std::string(indent,
' ') <<
"Parameters:\n";
216 property->printSelf(os, indent + 2, maxPropertyLength);
261 std::stringstream algNumber;
263 algNumber <<
"MantidAlgorithm_" << algCount;
265 std::stringstream algData;
268 file->makeGroup(algNumber.str(),
"NXnote",
true);
269 file->writeData(
"author", std::string(
"mantid"));
270 file->writeData(
"description", std::string(
"Mantid Algorithm data"));
271 file->writeData(
"data", algData.str());
275 history->saveNexus(file, algCount);
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
std::vector< history_type > history
history information
This class stores information about the Command History used by algorithms on a workspace.
std::size_t m_execCount
count keeps track of execution order of an algorithm
double m_executionDuration
The execution duration of the algorithm.
Mantid::Kernel::PropertyHistories m_properties
The PropertyHistory's defined for the algorithm.
void addChildHistory(const AlgorithmHistory_sptr &childHist)
add a child algorithm history record to this history object
AlgorithmHistory & operator=(const AlgorithmHistory &)
Standard Assignment operator.
std::shared_ptr< IAlgorithm > getChildAlgorithm(const size_t index) const
Create an child algorithm from a history record at a given index.
const AlgorithmHistories & getChildHistories() const
get the child histories of this history object
void saveNexus(::NeXus::File *file, int &algCount) const
Write this history object to a nexus file.
AlgorithmHistories m_childHistories
set of child algorithm histories for this history record
void setProperties(const Algorithm *const alg)
Set the history properties for an algorithm pointer.
Mantid::Types::Core::DateAndTime m_executionDate
The execution date of the algorithm.
const std::string & getPropertyValue(const std::string &name) const
get the string representation of a specified property
std::string m_uuid
UUID for this algorithm history.
size_t childHistorySize() const
Retrieve the number of child algorithms.
AlgorithmHistory()
Default constructor.
int m_version
The version of the algorithm.
void addExecutionInfo(const Types::Core::DateAndTime &start, const double &duration)
Add details of an algorithm's execution to an existing history object.
const std::string & name() const
get name of algorithm in history const
std::string m_name
The name of the Algorithm.
void fillAlgorithmHistory(const Algorithm *const alg, const Types::Core::DateAndTime &start, const double &duration, std::size_t uexeccount)
Set data on history after it is created.
std::shared_ptr< IAlgorithm > createAlgorithm() const
Create a concrete algorithm based on a history record.
AlgorithmHistory_sptr operator[](const size_t index) const
Add operator[] access.
AlgorithmHistory_sptr getChildAlgorithmHistory(const size_t index) const
Retrieve a child algorithm history by index.
void printSelf(std::ostream &, const int indent=0, const size_t maxPropertyLength=0) const
print contents of object
void addProperty(const std::string &name, const std::string &value, bool isdefault, const unsigned int &direction=99)
Add a property to the history.
Base class from which all concrete algorithm classes should be derived.
int version() const override=0
function to return a version of the algorithm, must be overridden in all algorithms
static IAlgorithm_sptr fromHistory(const AlgorithmHistory &history)
Construct an object from a history entry.
const std::vector< Kernel::Property * > & getProperties() const override
Get the list of managed properties.
const std::string name() const override=0
function to return a name of the algorithm, must be overridden in all algorithms
Exception for when an item is not found in a collection.
MANTID_API_DLL std::ostream & operator<<(std::ostream &, const AlgorithmHistory &)
Prints a text representation.
std::shared_ptr< AlgorithmHistory > AlgorithmHistory_sptr
std::shared_ptr< const PropertyHistory > PropertyHistory_const_sptr
std::shared_ptr< PropertyHistory > PropertyHistory_sptr
std::vector< PropertyHistory_sptr > PropertyHistories
std::string to_string(const wide_integer< Bits, Signed > &n)