Newer
Older
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
namespace Mantid
{
namespace Kernel
{
/** Constructor
* @param name The name of the property
* @param type The type of the property
*/
Property::Property( const std::string &name, const std::type_info &type ) :
m_isDefault( true ),
m_name( name ),
m_documentation( "" ),
m_typeinfo( &type )
{
}
/// Copy constructor
Property::Property( const Property& right ) :
m_isDefault( right.m_isDefault ),
m_name( right.m_name ),
m_documentation( right.m_documentation ),
m_typeinfo( right.m_typeinfo )
{
}
/// Virtual destructor
Property::~Property()
{
}
/// Copy assignment operator. Does nothing.
Property& Property::operator=( const Property& right )
{
return *this;
}
/** Get the property's name
* @return The name of the property
*/
const std::string& Property::name() const
{
return m_name;
}
/** Get the property's documentation string
* @return The documentation string
*/
const std::string& Property::documentation() const
{
return m_documentation;
}
/** Get the property type_info
* @return The type of the property
*/
const std::type_info* Property::type_info() const
{
return m_typeinfo;
}
/** Returns the type of the property as a string.
* Note that this is implementation dependent.
* @return The property type
*/
const std::string Property::type() const
{
return m_typeinfo->name();
}
/** Checks whether the property has a valid value.
* Note: always returns true unless overridden
* @return True if the property's value is a valid one
*/
const bool Property::isValid()
{
// Always true at present
return true;
}
/** Returns true if the property has not been changed since initialisation
* @return True if the property still has its default value
*/
const bool Property::isDefault() const
{
return m_isDefault;
}
/** Sets the property's (optional) documentation string
* @param documentation The string containing the descriptive comment
*/
void Property::setDocumentation( const std::string& documentation )
{
m_documentation = documentation;
}
} // namespace Kernel
} // namespace Mantid