PosList Class Reference

Store refID/position, but does not store values < 0. More...

#include <PosList.h>

Inheritance diagram for PosList:
Inheritance graph
[legend]
Collaboration diagram for PosList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PosList (int numRefs, int numPositions)
 Reserves space for numRefs reference ids and numPositions for each id.
void addPosition (int refID, int refPosition)
 Add the specified reference id/position (negative values will not be added).
bool hasPosition (int refID, int refPosition)
 Returns whether or not this list contains the specified reference ID and position (negative values will automatically return false).

Protected Member Functions

 PosList (const PosList &p)
void initVars ()

Protected Attributes

std::vector< std::vector< bool > > myPosList
int myNumRefs
int myNumPos

Detailed Description

Store refID/position, but does not store values < 0.

Definition at line 24 of file PosList.h.


Member Function Documentation

bool PosList::hasPosition ( int  refID,
int  refPosition 
)

Returns whether or not this list contains the specified reference ID and position (negative values will automatically return false).

Definition at line 81 of file PosList.cpp.

Referenced by Pileup< PILEUP_TYPE, FUNC_CLASS >::processAlignmentRegion().

00082 {
00083     // Check for negative numbers, if so, just return false, not found.
00084     if((refID < 0) || (refPosition < 0))
00085     {
00086         return(false);
00087     }
00088     bool found = false;
00089     try
00090     {
00091         if((myPosList.at(refID)).at(refPosition))
00092         {
00093             found = true;
00094         }
00095     }
00096     catch (std::out_of_range& oor)
00097     {
00098             // Nothing to do here, if it was out of range, then
00099             // the position was not found (already set to false).
00100     }
00101     return(found);
00102 }


The documentation for this class was generated from the following files:
Generated on Tue Sep 6 17:52:04 2011 for libStatGen Software by  doxygen 1.6.3