libXpertMass Developer Documentation
  • libXpertMass
  • PropListHolder
  • PropListHolder Class

    class MsXpS::libXpertMass::PropListHolder

    The PropListHolder class is the base class for a number of classes that need storing Prop instances. More...

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

    MsXpS::libXpertMass::Modif, MsXpS::libXpertMass::Monomer, MsXpS::libXpertMass::Oligomer, and MsXpS::libXpertMass::PkaPhPi

    Public Functions

    PropListHolder()
    PropListHolder(const PropListHolder &other)
    virtual ~PropListHolder()
    bool appendProp(Prop *prop)
    Prop *prop(const QString &name, int *index = 0)
    int propIndex(const QString &name, Prop *prop = 0)
    const QList<Prop *> &propList() const
    QList<Prop *> &propList()
    bool removeProp(Prop *prop)
    bool removeProp(const QString &name)
    virtual PropListHolder &operator=(const PropListHolder &other)

    Protected Variables

    QList<Prop *> m_propList

    Detailed Description

    See also Modif, Monomer, Oligomer, and PkaPhPi.

    Member Function Documentation

    PropListHolder::PropListHolder()

    Constructs a PropListHolder instance.

    PropListHolder::PropListHolder(const PropListHolder &other)

    Constructs a PropListHolder instance as a copy of other.

    The Prop instances in the other PropListHolder instance's member list of Prop instances are duplicated and stored in this instance using their own copy constructor.

    [virtual noexcept] PropListHolder::~PropListHolder()

    Destructs this PropListHolder instance.

    bool PropListHolder::appendProp(Prop *prop)

    Adds prop to the member list of Prop instances.

    Returns true.

    Prop *PropListHolder::prop(const QString &name, int *index = 0)

    Searches in the member list of Prop instances a Prop having name.

    If the Prop instance was found and index is non-nullptr, its index in the list is set to this parameter.

    Returns the found Prop instance.

    int PropListHolder::propIndex(const QString &name, Prop *prop = 0)

    Searches in the member list of Prop instances a Prop having name.

    If the Prop instance was found and prop is non-nullptr, its pointer is set to this parameter.

    Returns the index of the found Prop instance.

    const QList<Prop *> &PropListHolder::propList() const

    Returns a const reference to the member list of Prop instances.

    QList<Prop *> &PropListHolder::propList()

    Returns a non-const reference to the member list of Prop instances.

    bool PropListHolder::removeProp(Prop *prop)

    Removes prop from the member list of Prop instances.

    Returns true if prop was removed, false otherwise.

    bool PropListHolder::removeProp(const QString &name)

    Removes the Prop instance having name from the member list of Prop instances.

    If more than one Prop instance by the name are in the list, only the first encountered Prop instance is removed.

    Returns true if a Prop instance was removed, false otherwise.

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

    Assigns other to this PropListHolder instance.

    The Prop instances in the other PropListHolder instance's member list of Prop instances are duplicated and stored in this instance using their own copy constructor.

    Returns a reference to this PropListHolder instance.

    Member Variable Documentation

    QList<Prop *> PropListHolder::m_propList

    This variable holds the m_propList stores pointer to Prop instances.