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

This class stores information about the parameters used by an algorithm. More...

#include <API/MAntidAPI/PropertyHistory.h>

Public Member Functions

unsigned int direction () const
 get direction flag of algorithm parameter const
 
bool isDefault () const
 get isdefault flag of algorithm parameter const
 
bool isEmptyDefault () const
 get whether algorithm parameter was left as default EMPTY_INT,LONG,DBL const
 
const std::string & name () const
 get name of algorithm parameter const
 
bool operator== (const PropertyHistory &other) const
 this is required for boost.python
 
void printSelf (std::ostream &, const int indent=0, const size_t maxPropertyLength=0) const
 print contents of object
 
 PropertyHistory (Property const *const prop)
 construct a property history from a property object
 
 PropertyHistory (std::string name, std::string value, std::string type, const bool isdefault, const unsigned int direction=99, const bool pythonVariable=false)
 Constructor.
 
bool pythonVariable () const
 
void setValue (const std::string &value)
 set value of algorithm parameter
 
const std::string & type () const
 get type of algorithm parameter const
 
const std::string & value () const
 get value of algorithm parameter const
 
virtual ~PropertyHistory ()=default
 destructor
 

Private Attributes

unsigned int m_direction
 direction of parameter
 
bool m_isDefault
 flag defining if the parameter is a default or a user-defined parameter
 
std::string m_name
 The name of the parameter.
 
bool m_pythonVariable
 Whether the property should be treated as a python variable instead of string when building a script from history.
 
std::string m_type
 The type of the parameter.
 
std::string m_value
 The value of the parameter.
 

Detailed Description

This class stores information about the parameters used by an algorithm.

Author
Dickon Champion, ISIS, RAL
Date
21/01/2008

Definition at line 34 of file PropertyHistory.h.

Constructor & Destructor Documentation

◆ PropertyHistory() [1/2]

Mantid::Kernel::PropertyHistory::PropertyHistory ( std::string  name,
std::string  value,
std::string  type,
const bool  isdefault,
const unsigned int  direction = 99,
const bool  pythonVariable = false 
)

Constructor.

Definition at line 24 of file PropertyHistory.cpp.

◆ PropertyHistory() [2/2]

Mantid::Kernel::PropertyHistory::PropertyHistory ( Property const *const  prop)

construct a property history from a property object

Definition at line 29 of file PropertyHistory.cpp.

◆ ~PropertyHistory()

virtual Mantid::Kernel::PropertyHistory::~PropertyHistory ( )
virtualdefault

destructor

Member Function Documentation

◆ direction()

unsigned int Mantid::Kernel::PropertyHistory::direction ( ) const
inline

get direction flag of algorithm parameter const

Definition at line 54 of file PropertyHistory.h.

Referenced by export_PropertyHistory().

◆ isDefault()

bool Mantid::Kernel::PropertyHistory::isDefault ( ) const
inline

get isdefault flag of algorithm parameter const

Definition at line 52 of file PropertyHistory.h.

Referenced by export_PropertyHistory().

◆ isEmptyDefault()

bool Mantid::Kernel::PropertyHistory::isEmptyDefault ( ) const

get whether algorithm parameter was left as default EMPTY_INT,LONG,DBL const

Returns whether algorithm parameter was left as default EMPTY_INT,LONG,DBL.

Returns
True if param was unset and value = EMPTY_XXX, else false

Definition at line 64 of file PropertyHistory.cpp.

References Mantid::EMPTY_DBL(), Mantid::EMPTY_INT(), Mantid::EMPTY_LONG(), Mantid::Kernel::getUnmangledTypeName(), m_direction, m_isDefault, m_type, m_value, Mantid::Kernel::Direction::Output, and std::to_string().

◆ name()

const std::string & Mantid::Kernel::PropertyHistory::name ( ) const
inline

get name of algorithm parameter const

Definition at line 44 of file PropertyHistory.h.

Referenced by export_PropertyHistory().

◆ operator==()

bool Mantid::Kernel::PropertyHistory::operator== ( const PropertyHistory other) const
inline

this is required for boost.python

Definition at line 63 of file PropertyHistory.h.

References name, and value.

◆ printSelf()

void Mantid::Kernel::PropertyHistory::printSelf ( std::ostream &  os,
const int  indent = 0,
const size_t  maxPropertyLength = 0 
) const

print contents of object

Prints a text representation of itself.

Parameters
os:: The output stream to write to
indent:: an indentation value to make pretty printing of object and sub-objects
maxPropertyLength:: the max length for any property value string (0 = full length)

Definition at line 40 of file PropertyHistory.cpp.

References Mantid::Kernel::Direction::asText(), m_direction, m_isDefault, m_name, m_value, and Mantid::Kernel::Strings::shorten().

Referenced by Mantid::Kernel::operator<<().

◆ pythonVariable()

bool Mantid::Kernel::PropertyHistory::pythonVariable ( ) const
inline

Definition at line 60 of file PropertyHistory.h.

◆ setValue()

void Mantid::Kernel::PropertyHistory::setValue ( const std::string &  value)
inline

set value of algorithm parameter

Definition at line 48 of file PropertyHistory.h.

References m_value, and value.

◆ type()

const std::string & Mantid::Kernel::PropertyHistory::type ( ) const
inline

get type of algorithm parameter const

Definition at line 50 of file PropertyHistory.h.

Referenced by export_PropertyHistory().

◆ value()

const std::string & Mantid::Kernel::PropertyHistory::value ( ) const
inline

get value of algorithm parameter const

Definition at line 46 of file PropertyHistory.h.

References m_value.

Referenced by export_PropertyHistory().

Member Data Documentation

◆ m_direction

unsigned int Mantid::Kernel::PropertyHistory::m_direction
private

direction of parameter

Definition at line 78 of file PropertyHistory.h.

Referenced by isEmptyDefault(), and printSelf().

◆ m_isDefault

bool Mantid::Kernel::PropertyHistory::m_isDefault
private

flag defining if the parameter is a default or a user-defined parameter

Definition at line 76 of file PropertyHistory.h.

Referenced by isEmptyDefault(), and printSelf().

◆ m_name

std::string Mantid::Kernel::PropertyHistory::m_name
private

The name of the parameter.

Definition at line 70 of file PropertyHistory.h.

Referenced by printSelf().

◆ m_pythonVariable

bool Mantid::Kernel::PropertyHistory::m_pythonVariable
private

Whether the property should be treated as a python variable instead of string when building a script from history.

Definition at line 80 of file PropertyHistory.h.

◆ m_type

std::string Mantid::Kernel::PropertyHistory::m_type
private

The type of the parameter.

Definition at line 74 of file PropertyHistory.h.

Referenced by isEmptyDefault().

◆ m_value

std::string Mantid::Kernel::PropertyHistory::m_value
private

The value of the parameter.

Definition at line 72 of file PropertyHistory.h.

Referenced by isEmptyDefault(), and printSelf().


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