Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
Mantid::Geometry::Parameter Class Referenceabstract

Base class for parameters of an instrument. More...

#include <Geometry/Parameter.h>

Inheritance diagram for Mantid::Geometry::Parameter:
Mantid::Geometry::ParameterType< Type >

Public Member Functions

virtual std::string asString () const
 Returns the value of the property as a string. More...
 
virtual Parameterclone () const =0
 type-independent clone method; More...
 
virtual void fromString (const std::string &value)
 Set the value of the property via a string. More...
 
virtual const std::string & getDescription () const
 get description More...
 
virtual std::string getShortDescription () const
 get short description More...
 
const std::string & name () const
 Parameter name. More...
 
const char * nameAsCString () const
 Parameter name. More...
 
bool operator== (const Parameter &rhs) const
 Equality operator. More...
 
virtual void setDescription (const std::string &source)
 set description: More...
 
virtual void setVisible (const bool &visible)
 set visibility: More...
 
const std::string & type () const
 Parameter type. More...
 
template<class T >
const T & value ()
 Returns the parameter value of type T if the parameter has type ParameterType<T> More...
 
const bool & visible () const
 Parameter visibility in InstrumentViewer. More...
 
virtual ~Parameter ()=default
 Virtual destructor. More...
 

Protected Member Functions

 Parameter ()
 Constructor. More...
 
template<class T >
void set (const T &t)
 Sets the value of type T to the parameter if it has type ParameterType<T> Throws an exception if the types don't match. More...
 

Private Attributes

std::string m_description
 whether the parameter should be visible in InstrumentViewer More...
 
std::string m_name
 The name of the property. More...
 
std::string m_str_value
 Parameter value as a string. More...
 
std::string m_type
 The type of the property. More...
 
bool m_visible
 

Friends

class ParameterFactory
 
class ParameterMap
 

Detailed Description

Base class for parameters of an instrument.

Author
Roman Tolchenov, Tessella Support Services plc
Date
2/12/2008

Definition at line 37 of file Parameter.h.

Constructor & Destructor Documentation

◆ ~Parameter()

virtual Mantid::Geometry::Parameter::~Parameter ( )
virtualdefault

Virtual destructor.

◆ Parameter()

Mantid::Geometry::Parameter::Parameter ( )
inlineprotected

Constructor.

Definition at line 90 of file Parameter.h.

Member Function Documentation

◆ asString()

virtual std::string Mantid::Geometry::Parameter::asString ( ) const
inlinevirtual

Returns the value of the property as a string.

Reimplemented in Mantid::Geometry::ParameterType< Type >, Mantid::Geometry::ParameterType< Type >, and Mantid::Geometry::ParameterType< Type >.

Definition at line 55 of file Parameter.h.

◆ clone()

virtual Parameter * Mantid::Geometry::Parameter::clone ( ) const
pure virtual

type-independent clone method;

Implemented in Mantid::Geometry::ParameterType< Type >.

◆ fromString()

virtual void Mantid::Geometry::Parameter::fromString ( const std::string &  value)
inlinevirtual

Set the value of the property via a string.

Reimplemented in Mantid::Geometry::ParameterType< Type >, and Mantid::Geometry::ParameterType< Type >.

Definition at line 58 of file Parameter.h.

References value.

◆ getDescription()

virtual const std::string & Mantid::Geometry::Parameter::getDescription ( ) const
inlinevirtual

get description

Definition at line 66 of file Parameter.h.

◆ getShortDescription()

std::string Mantid::Geometry::Parameter::getShortDescription ( ) const
virtual

get short description

Returns
short description of the property (e.g. tooltip). The short description defined as all in the full description up to double LF symbol. (Python agreement on a short description of a function or method)

If no double LF symbol found in the description string, full string is returned.

Definition at line 63 of file Parameter.cpp.

References m_description.

◆ name()

const std::string & Mantid::Geometry::Parameter::name ( ) const
inline

Parameter name.

Definition at line 45 of file Parameter.h.

Referenced by Mantid::Geometry::ParameterMap::contains().

◆ nameAsCString()

const char * Mantid::Geometry::Parameter::nameAsCString ( ) const
inline

Parameter name.

Definition at line 47 of file Parameter.h.

◆ operator==()

bool Mantid::Geometry::Parameter::operator== ( const Parameter rhs) const
inline

Equality operator.

Definition at line 72 of file Parameter.h.

References rhs.

◆ set()

template<class T >
void Mantid::Geometry::Parameter::set ( const T &  t)
protected

Sets the value of type T to the parameter if it has type ParameterType<T> Throws an exception if the types don't match.

Sets the value of the parameter.

Parameters
t:: Value to set
Template Parameters
TThe concrete type
Parameters
t:: value of the parameter

Definition at line 153 of file Parameter.h.

◆ setDescription()

virtual void Mantid::Geometry::Parameter::setDescription ( const std::string &  source)
inlinevirtual

set description:

Definition at line 64 of file Parameter.h.

◆ setVisible()

virtual void Mantid::Geometry::Parameter::setVisible ( const bool &  visible)
inlinevirtual

set visibility:

Definition at line 70 of file Parameter.h.

◆ type()

const std::string & Mantid::Geometry::Parameter::type ( ) const
inline

Parameter type.

Definition at line 43 of file Parameter.h.

◆ value()

template<class T >
const T & Mantid::Geometry::Parameter::value

Returns the parameter value of type T if the parameter has type ParameterType<T>

The value of the parameter.

Template Parameters
TThe concrete type
Returns
A const reference to the value of the parameter

Definition at line 142 of file Parameter.h.

◆ visible()

const bool & Mantid::Geometry::Parameter::visible ( ) const
inline

Parameter visibility in InstrumentViewer.

Definition at line 49 of file Parameter.h.

Friends And Related Function Documentation

◆ ParameterFactory

friend class ParameterFactory
friend

Definition at line 88 of file Parameter.h.

◆ ParameterMap

friend class ParameterMap
friend

Definition at line 80 of file Parameter.h.

Member Data Documentation

◆ m_description

std::string Mantid::Geometry::Parameter::m_description
private

whether the parameter should be visible in InstrumentViewer

parameter's description – string containing the description of this parameter

Definition at line 101 of file Parameter.h.

Referenced by getShortDescription().

◆ m_name

std::string Mantid::Geometry::Parameter::m_name
private

The name of the property.

Definition at line 96 of file Parameter.h.

◆ m_str_value

std::string Mantid::Geometry::Parameter::m_str_value
private

Parameter value as a string.

Definition at line 97 of file Parameter.h.

◆ m_type

std::string Mantid::Geometry::Parameter::m_type
private

The type of the property.

Definition at line 94 of file Parameter.h.

◆ m_visible

bool Mantid::Geometry::Parameter::m_visible
private

Definition at line 98 of file Parameter.h.


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