BamTools::SamProgramChain Class Reference
Sorted container "chain" of SamProgram records.
More...
#include <SamProgramChain.h>
List of all members.
Detailed Description
Sorted container "chain" of SamProgram records.
Provides methods for operating on a collection of SamProgram records.
- Note:
- Underlying container is *NOT* ordered by linkage, but by order of appearance in SamHeader and subsequent Add() calls. Using the current iterators will not allow you to step through the header's program history. Instead use First()/Last() to access oldest/newest records, respectively.
Constructor & Destructor Documentation
SamProgramChain::SamProgramChain |
( |
void |
|
) |
|
SamProgramChain::~SamProgramChain |
( |
void |
|
) |
|
Member Function Documentation
void SamProgramChain::Add |
( |
std::vector< SamProgram > & |
programs |
) |
|
Appends a batch of programs to the end of the chain.
This is an overloaded function.
- Parameters:
-
[in] | programs | batch of program records to append |
- See also:
- Add()
void SamProgramChain::Add |
( |
SamProgram & |
program |
) |
|
Appends a program to program chain.
Duplicate entries are silently discarded.
- Note:
- Underlying container is *NOT* ordered by linkage, but by order of appearance in SamHeader and subsequent Add() calls. Using the current iterators will not allow you to step through the header's program history. Instead use First()/Last() to access oldest/newest records, respectively.
- Parameters:
-
[in] | program | entry to be appended |
- Returns:
- an STL const_iterator pointing to the first (oldest) program record
This is an overloaded function.
- See also:
- ConstBegin(), End(), First()
void SamProgramChain::Clear |
( |
void |
|
) |
|
Clears all program records.
- Returns:
- an STL const_iterator pointing to the imaginary entry after the last (newest) program record
- See also:
- ConstBegin(), End(), Last()
bool SamProgramChain::Contains |
( |
const std::string & |
programId |
) |
const |
Returns true if chains has a program record with this ID.
- Parameters:
-
[in] | programId | search for program matching this ID |
- Returns:
true
if chain contains a program record with this ID
bool SamProgramChain::Contains |
( |
const SamProgram & |
program |
) |
const |
Returns true if chains has this program record (matching on ID).
This is an overloaded function.
- Parameters:
-
- Returns:
true
if chain contains program (matching on ID)
- Returns:
- an STL const_iterator pointing to the imaginary entry after the last (newest) program record
This is an overloaded function.
- See also:
- Begin(), ConstEnd(), Last()
- Returns:
- an STL iterator pointing to the imaginary entry after the last (newest) program record
- See also:
- Begin(), ConstEnd(), Last()
const SamProgram & SamProgramChain::First |
( |
void |
|
) |
const |
Fetches first (oldest) record in the chain.
This is an overloaded function.
- Warning:
- This function will fail if the chain is empty. If this is possible, check the result of IsEmpty() before calling this function.
- Returns:
- a read-only reference to the first (oldest) program entry
- See also:
- Begin(), ConstBegin(), Last()
Fetches first (oldest) record in the chain.
- Warning:
- This function will fail if the chain is empty. If this is possible, check the result of IsEmpty() before calling this function.
- Returns:
- a modifiable reference to the first (oldest) program entry
- See also:
- Begin(), Last()
bool SamProgramChain::IsEmpty |
( |
void |
|
) |
const |
Returns true
if chain contains no records.
- See also:
- Size()
const SamProgram & SamProgramChain::Last |
( |
void |
|
) |
const |
Fetches last (newest) record in the chain.
This is an overloaded function.
- Warning:
- This function will fail if the chain is empty. If this is possible, check the result of IsEmpty() before calling this function.
- Returns:
- a read-only reference to the last (newest) program entry
- See also:
- End(), ConstEnd(), First()
Fetches last (newest) record in the chain.
- Warning:
- This function will fail if the chain is empty. If this is possible, check the result of IsEmpty() before calling this function.
- Returns:
- a modifiable reference to the last (newest) program entry
- See also:
- End(), First()
SamProgram & SamProgramChain::operator[] |
( |
const std::string & |
programId |
) |
|
Retrieves the modifiable SamProgram record that matches programId.
- Warning:
- If the chain contains no read group matching this ID, this function will print an error and terminate. Check the return value of Contains() if this may be possible.
- Parameters:
-
[in] | programId | ID of program record to retrieve |
- Returns:
- a modifiable reference to the SamProgram associated with the ID
int SamProgramChain::Size |
( |
void |
|
) |
const |
Returns number of program records in the chain.
- See also:
- IsEmpty()
The documentation for this class was generated from the following files: