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

- libXpertMassCore
- CrossLinkedRegion

# MsXpS::libXpertMassCore::CrossLinkedRegion Class

class MsXpS::libXpertMassCore::CrossLinkedRegion

The CrossLinkedRegion class provides abstractions to work with cross-links and detect the region of oligomers that are linked together. More...

Header: | `#include <CrossLinkedRegion.hpp>`

- List of all members, including inherited members
- CrossLinkedRegion is part of Aqueous chemical reactions.

## Public Functions

| CrossLinkedRegion()
| CrossLinkedRegion(std::size_t index_start, std::size_t index_stop)
| CrossLinkedRegion(const MsXpS::libXpertMassCore::CrossLinkedRegion &other)
| ~CrossLinkedRegion()
std::size_t | appendCrossLink(const MsXpS::libXpertMassCore::CrossLinkSPtr &cross_link_sp)
std::size_t | appendCrossLinks(const std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> &cross_links)
const std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> & | getCrossLinksCstRef() const
std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> & | getCrossLinksRef()
std::size_t | getStartIndex()
std::size_t | getStopIndex()
std::size_t | removeCrossLink(MsXpS::libXpertMassCore::CrossLinkSPtr &cross_link_sp)
std::size_t | removeCrossLinkAt(std::size_t index)
void | setStartIndex(std::size_t index)
void | setStopIndex(std::size_t index)
MsXpS::libXpertMassCore::CrossLinkedRegion & | operator=(const MsXpS::libXpertMassCore::CrossLinkedRegion &other)

## Protected Variables

std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> | m_crossLinks
std::size_t | m_startIndex
std::size_t | m_stopIndex

## Detailed Description

In the following representation, a polymer sequence has a number of CrossLink instances that are intertwined:

               [3] [4] [5] [6]        [9]    [11]     [13]
    o---o---o---o---o--o---o---o---o---o---o---o---o---o---o
                |   |__|   |       |   |       |       |
                |          +-----------+       +-------+
                |                  |
                +------------------+

In this example, there are two cross-linked regions: [3–9] and [11–13].

The first cross-linked region has a start index of 3 and a stop index of 9 and involves three cross-links.

The second cross-linked region only involves a single cross-link involving two monomers at indices 11 and 13.

This class is most useful when performing fragmentations of Oligomer instances.

## Member Function Documentation

### CrossLinkedRegion::CrossLinkedRegion()

### CrossLinkedRegion::CrossLinkedRegion(std::size_t index_start, std::size_t index_stop)

Constructs a CrossLinkedRegion instance with indices index_start and index_stop.

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

Constructs a CrossLinkedRegion instance as a copy of other.

The copy of the CrossLink instances is shallow (the shared pointers are copied).

### `[noexcept]` CrossLinkedRegion::~CrossLinkedRegion()

Destructs a CrossLinkedRegion instance.

### std::size_t CrossLinkedRegion::appendCrossLink(const MsXpS::libXpertMassCore::CrossLinkSPtr &cross_link_sp)

Adds a the cross_link_sp CrossLink to the back of the CrossLink container.

Returns the size of the container of CrossLink instances.

### std::size_t CrossLinkedRegion::appendCrossLinks(const std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> &cross_links)

Adds the CrossLink item in the cross_links container to the back of the member CrossLink container.

Returns the size of the container of CrossLink instances.

### const std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> &CrossLinkedRegion::getCrossLinksCstRef() const

Returns a const reference to the container of CrossLink instances.

### std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> &CrossLinkedRegion::getCrossLinksRef()

Returns a reference to the container of CrossLink instances.

### std::size_t CrossLinkedRegion::getStartIndex()

Returns the start index of this instance.

### std::size_t CrossLinkedRegion::getStopIndex()

Returns the stop index of this instance.

### std::size_t CrossLinkedRegion::removeCrossLink(MsXpS::libXpertMassCore::CrossLinkSPtr &cross_link_sp)

Removes the cross_link_sp CrossLink item from the member CrossLink container.

Returns the size of the container of CrossLink instances.

### std::size_t CrossLinkedRegion::removeCrossLinkAt(std::size_t index)

Removes the CrossLink at index from the member CrossLink container.

Returns the size of the container of CrossLink instances.

### void CrossLinkedRegion::setStartIndex(std::size_t index)

Sets the start index of this instance to index.

### void CrossLinkedRegion::setStopIndex(std::size_t index)

Sets the stop index of this instance to index.

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

Assigns other to this instance.

The copy of the CrossLink instances is shallow (the shared pointers are copied).

## Member Variable Documentation

### std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> CrossLinkedRegion::m_crossLinks

This variable holds the CrossLink instances that are contained in this CrossLinkedRegion instance.

### std::size_t CrossLinkedRegion::m_startIndex

This variable holds the start index of this cross-linked region.

### std::size_t CrossLinkedRegion::m_stopIndex

This variable holds the stop index of this cross-linked region.