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

- libXpertMassCore
- PropListHolder

# MsXpS::libXpertMassCore::PropListHolder Class

class MsXpS::libXpertMassCore::PropListHolder

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

Header: | `#include <MsXpS/libXpertMassCore/PropListHolder.hpp>`
Inherited By: | MsXpS::libXpertMassCore::Modif, MsXpS::libXpertMassCore::Monomer, MsXpS::libXpertMassCore::Oligomer, MsXpS::libXpertMassCore::OligomerPair, and MsXpS::libXpertMassCore::PkaPhPi

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

## Public Functions

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

## Protected Variables

QList<MsXpS::libXpertMassCore::Prop *> | m_propList

## Detailed Description

See also Modif, Monomer, Oligomer, and PkaPhPi.

## Member Function Documentation

### PropListHolder::PropListHolder()

Constructs a PropListHolder instance.

### PropListHolder::PropListHolder(const MsXpS::libXpertMassCore::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(MsXpS::libXpertMassCore::Prop *prop)

Adds prop to the member list of Prop instances.

Returns true.

### MsXpS::libXpertMassCore::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, MsXpS::libXpertMassCore::Prop **prop_pp = nullptr)

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

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

Returns the index of the found Prop instance.

### QList<MsXpS::libXpertMassCore::Prop *> &PropListHolder::propList()

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

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

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

### bool PropListHolder::removeProp(MsXpS::libXpertMassCore::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]` MsXpS::libXpertMassCore::PropListHolder &PropListHolder::operator=(const MsXpS::libXpertMassCore::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<MsXpS::libXpertMassCore::Prop *> PropListHolder::m_propList

This variable holds the m_propList stores pointer to Prop instances.