BamTools  2.5.1
Public Member Functions | List of all members
BamTools::Algorithms::Sort::ByName Struct Reference

Function object for comparing alignments by name. More...

#include <Sort.h>

Inherits AlignmentSortBase.

Public Member Functions

 ByName (const Sort::Order &order=Sort::AscendingOrder)
 
bool operator() (const BamTools::BamAlignment &lhs, const BamTools::BamAlignment &rhs)
 

Detailed Description

Function object for comparing alignments by name.

Default sort order is Sort::AscendingOrder.

std::vector<BamAlignment> a;
// sort by name, in ascending order (the following two lines are equivalent):
std::sort( a.begin(), a.end(), Sort::ByName() );
std::sort( a.begin(), a.end(), Sort::ByName(Sort::AscendingOrder) );
// OR sort in descending order
std::sort( a.begin(), a.end(), Sort::ByName(Sort::DescendingOrder) );

Constructor & Destructor Documentation

◆ ByName()

BamTools::Algorithms::Sort::ByName::ByName ( const Sort::Order order = Sort::AscendingOrder)
inline

Member Function Documentation

◆ operator()()

bool BamTools::Algorithms::Sort::ByName::operator() ( const BamTools::BamAlignment lhs,
const BamTools::BamAlignment rhs 
)
inline

The documentation for this struct was generated from the following file: