Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Static Public Member Functions | List of all members
gamgee::Cigar Class Reference

Utility class to manage the memory of the cigar structure. More...

#include <cigar.h>

Public Member Functions

 Cigar (const std::shared_ptr< bam1_t > &sam_record)
 creates a Cigar object that points to htslib memory already allocated More...
 
 Cigar (const Cigar &other)
 creates a deep copy of a Cigar object More...
 
 Cigar (Cigar &&other) noexcept
 moves a Cigar object, transferring ownership of the underlying htslib memory More...
 
Cigaroperator= (const Cigar &other)
 creates a deep copy of a Cigar object More...
 
Cigaroperator= (Cigar &&other) noexcept
 moves a Cigar object, transferring ownership of the underlying htslib memory More...
 
 ~Cigar ()=default
 default destruction is sufficient, since our shared_ptr will handle deallocation More...
 
uint32_t operator[] (const uint32_t index) const
 use freely as you would an array. More...
 
uint32_t size () const
 number of base qualities in the container More...
 
std::string to_string () const
 returns a string representation of this cigar More...
 

Static Public Member Functions

static CigarOperator cigar_op (const uint32_t cigar_element)
 gets the operator of an individual cigar element More...
 
static uint32_t cigar_oplen (const uint32_t cigar_element)
 gets the length of an individual cigar element More...
 

Detailed Description

Utility class to manage the memory of the cigar structure.

Constructor & Destructor Documentation

gamgee::Cigar::Cigar ( const std::shared_ptr< bam1_t > &  sam_record)
explicit

creates a Cigar object that points to htslib memory already allocated

Note
the resulting Cigar object shares ownership of the pre-allocated memory via shared_ptr reference counting
gamgee::Cigar::Cigar ( const Cigar other)

creates a deep copy of a Cigar object

Note
the copy will have exclusive ownership over the newly-allocated htslib memory
gamgee::Cigar::Cigar ( Cigar &&  other)
noexcept

moves a Cigar object, transferring ownership of the underlying htslib memory

gamgee::Cigar::~Cigar ( )
default

default destruction is sufficient, since our shared_ptr will handle deallocation

Member Function Documentation

static CigarOperator gamgee::Cigar::cigar_op ( const uint32_t  cigar_element)
inlinestatic

gets the operator of an individual cigar element

static uint32_t gamgee::Cigar::cigar_oplen ( const uint32_t  cigar_element)
inlinestatic

gets the length of an individual cigar element

Cigar & gamgee::Cigar::operator= ( const Cigar other)

creates a deep copy of a Cigar object

Note
the copy will have exclusive ownership over the newly-allocated htslib memory

< check for self assignment

< shared_ptr assignment will take care of deallocating old sam record if necessary

Cigar & gamgee::Cigar::operator= ( Cigar &&  other)
noexcept

moves a Cigar object, transferring ownership of the underlying htslib memory

uint32_t gamgee::Cigar::operator[] ( const uint32_t  index) const

use freely as you would an array.

access an individual cigar element by index

Note
currently implemented as read only
Returns
cigar element at the specified index as an encoded uint32_t. use cigar_op() and cigar_oplen() to unpack the cigar operator and length
uint32_t gamgee::Cigar::size ( ) const
inline

number of base qualities in the container

string gamgee::Cigar::to_string ( ) const

returns a string representation of this cigar


The documentation for this class was generated from the following files: