Newer
Older
Russell Taylor
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidKernel/PropertyHistory.h"
namespace Mantid
{
namespace Kernel
{
/// Constructor
PropertyHistory::PropertyHistory(const std::string& name, const std::string& value,
const std::string& type, const bool& isdefault, const unsigned int& direction) :
m_name(name),m_value(value),m_type(type),m_isDefault(isdefault),m_direction(direction)
{}
/// Destructor
PropertyHistory::~PropertyHistory()
{}
/**
* Standard Copy Constructor
* \param A :: PropertyHistory Item to copy
*/
PropertyHistory::PropertyHistory(const PropertyHistory& A) :
m_name(A.m_name),m_value(A.m_value),
m_type(A.m_type),m_isDefault(A.m_isDefault),m_direction(A.m_direction)
{}
/**
* Standard Assignment operator
* \param A :: PropertyHistory Item to assign to 'this'
*/
PropertyHistory& PropertyHistory::operator=(const PropertyHistory& A)
{
if (this!=&A)
{
m_name=A.m_name;
m_value=A.m_value;
m_type=A.m_type;
m_isDefault=A.m_isDefault;
m_direction=A.m_direction;
}
return *this;
}
/** Prints a text representation of itself
* @param os The ouput stream to write to
* @param indent an indentation value to make pretty printing of object and sub-objects
*/
void PropertyHistory::printSelf(std::ostream& os, const int indent) const
{
os << std::string(indent,' ') << "Name: " << m_name;
os << ", Value: " << m_value;
os << ", Default?: "<< (m_isDefault ? "Yes" : "No");
os << ", Direction: " << Kernel::Direction::asText(m_direction) << std::endl;
Russell Taylor
committed
}
/** Prints a text representation
* @param os The ouput stream to write to
* @param AP The PropertyHistory to output
* @returns The ouput stream
*/
std::ostream& operator<<(std::ostream& os, const PropertyHistory& AP)
{
AP.printSelf(os);
return os;
}
} // namespace Kernel
} // namespace Mantid