BamTools::SamProgramChain Class Reference

Sorted container "chain" of SamProgram records. More...

#include <SamProgramChain.h>

List of all members.

Public Member Functions

 SamProgramChain (void)
 constructor
 SamProgramChain (const SamProgramChain &other)
 copy constructor
 ~SamProgramChain (void)
 destructor
void Add (SamProgram &program)
 Appends a program to program chain.
void Add (std::vector< SamProgram > &programs)
 Appends a batch of programs to the end of the chain.
void Clear (void)
 Clears all program records.
bool Contains (const SamProgram &program) const
 Returns true if chains has this program record (matching on ID).
bool Contains (const std::string &programId) const
 Returns true if chains has a program record with this ID.
SamProgramFirst (void)
 Fetches first (oldest) record in the chain.
const SamProgramFirst (void) const
 Fetches first (oldest) record in the chain.
bool IsEmpty (void) const
 Returns true if chain contains no records.
SamProgramLast (void)
 Fetches last (newest) record in the chain.
const SamProgramLast (void) const
 Fetches last (newest) record in the chain.
int Size (void) const
 Returns number of program records in the chain.
SamProgramoperator[] (const std::string &programId)
 Retrieves the modifiable SamProgram record that matches programId.
SamProgramIterator Begin (void)
SamProgramConstIterator Begin (void) const
SamProgramConstIterator ConstBegin (void) const
SamProgramIterator End (void)
SamProgramConstIterator End (void) const
SamProgramConstIterator ConstEnd (void) const

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   ) 

constructor

SamProgramChain::SamProgramChain ( const SamProgramChain other  ) 

copy constructor

SamProgramChain::~SamProgramChain ( void   ) 

destructor


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
SamProgramConstIterator SamProgramChain::Begin ( void   )  const
Returns:
an STL const_iterator pointing to the first (oldest) program record

This is an overloaded function.

See also:
ConstBegin(), End(), First()
SamProgramIterator SamProgramChain::Begin ( void   ) 
Returns:
an STL iterator pointing to the first (oldest) program record
See also:
ConstBegin(), End(), First()
void SamProgramChain::Clear ( void   ) 

Clears all program records.

SamProgramConstIterator SamProgramChain::ConstBegin ( void   )  const
Returns:
an STL const_iterator pointing to the first (oldest) program record
See also:
Begin(), ConstEnd(), First()
SamProgramConstIterator SamProgramChain::ConstEnd ( void   )  const
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:
[in] program SamProgram to search for
Returns:
true if chain contains program (matching on ID)
SamProgramConstIterator SamProgramChain::End ( void   )  const
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()
SamProgramIterator SamProgramChain::End ( void   ) 
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()
SamProgram & SamProgramChain::First ( void   ) 

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()
SamProgram & SamProgramChain::Last ( void   ) 

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Aug 29 17:43:46 2012 for BamTools by  doxygen 1.6.3