libXpertMass Developer Documentation
  • libXpertMass
  • DoubleProp
  • DoubleProp Class

    class MsXpS::libXpertMass::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::libXpertMass::Prop

    Public Functions

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

    Reimplemented Public Functions

    virtual DoubleProp *cloneOut() const override
    virtual void deleteData() override
    virtual QString *formatXmlElement(int offset, const QString &indent = QString(" ")) 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.

    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 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] DoubleProp *DoubleProp::cloneOut() const

    Duplicates this DoubleProp instance and returns a pointer to it.

    [override virtual] void DoubleProp::deleteData()

    Deletes the member data.

    [override virtual] QString *DoubleProp::formatXmlElement(int offset, const QString &indent = QString(" "))

    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)

    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] DoubleProp &DoubleProp::operator=(const DoubleProp &other)

    Assigns other to this DoubleProp instance.

    Returns a reference to this DoubleProp instance.