libXpertMass Developer Documentation
  • libXpertMass
  • Prop
  • Prop Class

    class MsXpS::libXpertMass::Prop

    The Prop class is the abstract base class for a number of specialized properties. More...

    Header: #include <Prop.hpp>
    Inherited By:

    MsXpS::libXpertMass::ChemicalGroupProp, MsXpS::libXpertMass::DoubleProp, MsXpS::libXpertMass::IntProp, MsXpS::libXpertMass::ModifProp, MsXpS::libXpertMass::NoDeletePointerProp, and MsXpS::libXpertMass::StringProp

    Public Functions

    Prop()
    Prop(const QString &name)
    Prop(const Prop &other)
    virtual ~Prop()
    virtual void *data() const
    const QString &name()
    void setData(void *data)
    void setName(QString &name)
    virtual Prop &operator=(const Prop &other)

    Protected Variables

    QString m_name
    void *mpa_data

    Detailed Description

    Properties are libmass' way of extending the capabilities of objects. A property is merely an encapsulation of:

    In order to perform tasks in the derived classes using dynamic binding, virtual functions are available to derived classes to perform:

    Derived classes should be named according the following scheme: XxxYyyZzzzProp, like StringProp or MonomerProp or ModifProp.

    Note: When a derived class is created, it should register itself to the system by registering its name in the propAllocator(const QString &) function. This function will be able to allocate a property using the proper constructor based on the property name that is passed as argument. It returns a pointer to the newly allocated instance.

    The classes that benefit from this Property-based extension mechanism all derive from PropListHolder.

    See also StringProp and PropListHolder.

    Member Function Documentation

    Prop::Prop()

    Constructs a Prop instance.

    Prop::Prop(const QString &name)

    Constructs a Prop instance with name.

    Prop::Prop(const Prop &other)

    Constructs a Prop instance as a copy of other.

    Note: The data are not duplicated.

    [virtual noexcept] Prop::~Prop()

    Destructs this Prop instance.

    [virtual] void *Prop::data() const

    Returns the data.

    See also setData().

    const QString &Prop::name()

    Returns the name.

    See also setName().

    void Prop::setData(void *data)

    Sets the data

    See also data().

    void Prop::setName(QString &name)

    Sets the name.

    See also name().

    [virtual] Prop &Prop::operator=(const Prop &other)

    Assigns other to this Prop instance.

    Member Variable Documentation

    QString Prop::m_name

    This variable holds the name of the property. Initialized to "NOT_SET".

    void *Prop::mpa_data

    This variable holds the allocated data belonging to this Prop instance. Initialized to nullptr.