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

- libXpertMassCore
- OligomerPair

# MsXpS::libXpertMassCore::OligomerPair Class

class MsXpS::libXpertMassCore::OligomerPair

The OligomerPair class provides abstractions to work with a pair of Oligomer instances. More...

Header: | `#include <MsXpS/libXpertMassCore/OligomerPair.hpp>`
Inherits: | MsXpS::libXpertMassCore::PropListHolder

- List of all members, including inherited members
- OligomerPair is part of libXpertMassCore Mass calculations.

## Public Functions

| OligomerPair(const QString &name, const MsXpS::libXpertMassCore::OligomerSPtr first_csp, const MsXpS::libXpertMassCore::OligomerSPtr second_csp, MsXpS::libXpertMassCore::Enums::MassType mass_type, double error, bool isMatching = false)
| OligomerPair(const MsXpS::libXpertMassCore::OligomerPair &other)
virtual | ~OligomerPair()
int | firstCharge()
double | getError() const
const MsXpS::libXpertMassCore::OligomerSPtr | getFirst() const
double | getFirstMass()
MsXpS::libXpertMassCore::Enums::MassType | getMassType() const
QString | getName()
const MsXpS::libXpertMassCore::OligomerSPtr | getSecond() const
double | getSecondMass()
bool | isMatching() const
int | secondCharge()
void | setError(double error)
void | setMassType(MsXpS::libXpertMassCore::Enums::MassType mass_type)
void | setMatching(bool is_matching)
MsXpS::libXpertMassCore::OligomerPair & | operator=(const MsXpS::libXpertMassCore::OligomerPair &other)

## Protected Variables

double | m_error
bool | m_isMatching
MsXpS::libXpertMassCore::Enums::MassType | m_massType
QString | m_name
MsXpS::libXpertMassCore::OligomerSPtr | msp_first
MsXpS::libXpertMassCore::OligomerSPtr | msp_second

## Detailed Description

## Member Function Documentation

### OligomerPair::OligomerPair(const QString &name, const MsXpS::libXpertMassCore::OligomerSPtr first_csp, const MsXpS::libXpertMassCore::OligomerSPtr second_csp, MsXpS::libXpertMassCore::Enums::MassType mass_type, double error, bool isMatching = false)

Constructs an OligomerPair.

The OligomerPair instance is constructed with these arguments:

- name The name of this OligomerPair
- first_csp The first Oligomer
- first_csp The second Oligomer
- mass_type Type of mass that is being dealt with
- error The error
- isMatching If there is a match

first_csp and second_csp cannot be nullptr.

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

Constructs the OligomerPair as a copy of other.

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

Desstructs the OligomerPair.

### int OligomerPair::firstCharge()

Returns the charge of the first Oligomer as calculated in the Oligomer's Ionizer member.

See also Ionizer.

### double OligomerPair::getError() const

Returns the error.

### const MsXpS::libXpertMassCore::OligomerSPtr OligomerPair::getFirst() const

Returns the first Oligomer.

### double OligomerPair::getFirstMass()

Returns the mass of the first Oligomer of the type set in the member Enums::MassType.

### MsXpS::libXpertMassCore::Enums::MassType OligomerPair::getMassType() const

Returns the mass type.

### QString OligomerPair::getName()

Returns the name.

### const MsXpS::libXpertMassCore::OligomerSPtr OligomerPair::getSecond() const

Returns the second Oligomer.

### double OligomerPair::getSecondMass()

Returns the mass of the second Oligomer of the type set in the member Enums::MassType.

### bool OligomerPair::isMatching() const

Returns the matching.

### int OligomerPair::secondCharge()

Returns the charge of the second Oligomer as calculated in the Oligomer's Ionizer member.

See also Ionizer.

### void OligomerPair::setError(double error)

Sets the error.

### void OligomerPair::setMassType(MsXpS::libXpertMassCore::Enums::MassType mass_type)

Sets the mass_type.

### void OligomerPair::setMatching(bool is_matching)

Sets the matching to is_matching.

See also isMatching().

### MsXpS::libXpertMassCore::OligomerPair &OligomerPair::operator=(const MsXpS::libXpertMassCore::OligomerPair &other)

Assigns other to this Oligomer instance.

## Member Variable Documentation

### double OligomerPair::m_error

This variable holds the error on the mass values.

### bool OligomerPair::m_isMatching

Tells if the OligomerPair is matching.

The concept of matching depends on the use case for this class.

### MsXpS::libXpertMassCore::Enums::MassType OligomerPair::m_massType

This variable holds the mass type that is to be handled.

### QString OligomerPair::m_name

This variable holds the name of the OligomerPair.

### MsXpS::libXpertMassCore::OligomerSPtr OligomerPair::msp_first

This variable holds the first Oligomer of the pair.

### MsXpS::libXpertMassCore::OligomerSPtr OligomerPair::msp_second

This variable holds the second Oligomer of the pair.