| <large>libXpertMassCore and libXpertMassGui Developer Documentation</large>

- libXpertMassCore
- DoubleProp

# MsXpS::libXpertMassCore::DoubleProp Class

class MsXpS::libXpertMassCore::DoubleProp

The DoubleProp class is the specialized class for properties that hold data in the form of double values. More...

Header: | `#include <DoubleProp>`
Inherits: | MsXpS::libXpertMassCore::Prop

- List of all members, including inherited members
- DoubleProp is part of The property system.

## Public Functions

| DoubleProp(const QString &name = QString(), double data = 0)
| DoubleProp(const MsXpS::libXpertMassCore::DoubleProp &other)
virtual | ~DoubleProp()
virtual MsXpS::libXpertMassCore::DoubleProp & | operator=(const MsXpS::libXpertMassCore::DoubleProp &other)

## Reimplemented Public Functions

virtual MsXpS::libXpertMassCore::DoubleProp * | cloneOut() const override
virtual void | deleteData() override
virtual QString | formatXmlElement(int offset, const QString &indent = Utils::xmlIndentationToken) override
virtual bool | renderXmlElement(const QDomElement &element, int version = 1) override

## Detailed Description

A DoubleProp property is a simple property in which the data is a pointer to an allocated double.

## Member Function Documentation

### DoubleProp::DoubleProp(const QString &name = QString(), double data = 0)

Constructs a DoubleProp instance.

- name: The name of the property.
- data: The data of the property.

The integer passed as data is used to dynamically allocate a new double with the same contents and then is set to the member mpa_data pointer.

### DoubleProp::DoubleProp(const MsXpS::libXpertMassCore::DoubleProp &other)

Constructs a DoubleProp instance as a copy of other.

### `[virtual noexcept]` DoubleProp::~DoubleProp()

Destructs this DoubleProp instance.

Deletion of the data is delegated to deleteData().

### `[override virtual]` MsXpS::libXpertMassCore::DoubleProp *DoubleProp::cloneOut() const

Duplicates this DoubleProp instance and returns a pointer to it.

### `[override virtual]` void DoubleProp::deleteData()

Reimplements: Prop::deleteData().

Deletes the member data.

### `[override virtual]` QString DoubleProp::formatXmlElement(int offset, const QString &indent = Utils::xmlIndentationToken)

Reimplements: Prop::formatXmlElement(int offset, const QString &indent).

Formats a string suitable to use as an XML element.

Formats a string suitable to be used as an XML element. Typical double property elements that might be generated in this function look like this:

    <prop>
    <name>SEARCHED_MASS</name>
    <data>1000.234</data>
    </prop>

offset times the indent string must be used as a lead in the formatting of elements.

Returns a dynamically allocated string that needs to be freed after use.

### `[override virtual]` bool DoubleProp::renderXmlElement(const QDomElement &element, int version = 1)

Reimplements: Prop::renderXmlElement(const QDomElement &element, int version).

Parses a double property XML element using a versioned function.

Parses the double property XML element passed as argument and for each encountered data (name and data) will set the data to this DoubleProp instance (this is called XML rendering).

Returns true if parsing was successful, false otherwise.)

### `[virtual]` MsXpS::libXpertMassCore::DoubleProp &DoubleProp::operator=(const MsXpS::libXpertMassCore::DoubleProp &other)

Assigns other to this DoubleProp instance.

Returns a reference to this DoubleProp instance.