libStatGen Software 1
|
This class is used to track the status results of some methods in the BAM classes. More...
#include <StatGenStatus.h>
Public Types | |
enum | Status { SUCCESS = 0 , UNKNOWN , NO_MORE_RECS , FAIL_IO , FAIL_ORDER , FAIL_PARSE , INVALID_SORT , INVALID , FAIL_MEM } |
Return value enum for StatGenFile methods. More... | |
Public Member Functions | |
StatGenStatus (ErrorHandler::HandlingType handleType=ErrorHandler::EXCEPTION) | |
Constructor that takes in the handling type, defaulting it to exception. More... | |
~StatGenStatus () | |
Destructor. More... | |
void | reset () |
Reset this status to a default state. More... | |
void | setHandlingType (ErrorHandler::HandlingType handleType) |
Set how to handle the errors when they are set. More... | |
void | setStatus (Status newStatus, const char *newMessage) |
Set the status with the specified status enum and message. More... | |
void | addError (Status newStatus, const char *newMessage) |
Add the specified error message to the status message, setting the status to newStatus if the current status is SUCCESS. More... | |
void | addError (StatGenStatus newStatus) |
Add the specified status to the status message, setting the status to newStatus if the current status is SUCCESS. More... | |
Status | getStatus () const |
Return the enum for this status object. More... | |
const char * | getStatusMessage () const |
Return the status message for this object. More... | |
StatGenStatus & | operator= (Status newStatus) |
Overload operator = to set the StatGen status type to the passed in status and to clear the message string. More... | |
StatGenStatus & | operator= (StatGenStatus newStatus) |
Overload operator = to copy the specified status object to this one. More... | |
bool | operator!= (const StatGenStatus::Status &compStatus) const |
Overload operator != to determine if the passed in type is not equal to this status's type. More... | |
bool | operator== (const StatGenStatus::Status &compStatus) const |
Overload operator == to determine if the passed in type is equal to this status's type. More... | |
Static Public Member Functions | |
static const char * | getStatusString (StatGenStatus::Status statusEnum) |
Return a string representation of the passed in status enum. More... | |
static bool | isContinuableStatus (StatGenStatus::Status status) |
Returns whether or not it is "safe" to keep processing the file after the specified status return. More... | |
This class is used to track the status results of some methods in the BAM classes.
It contains a status enum that describing the status.
Definition at line 26 of file StatGenStatus.h.
Return value enum for StatGenFile methods.
Definition at line 31 of file StatGenStatus.h.
StatGenStatus::StatGenStatus | ( | ErrorHandler::HandlingType | handleType = ErrorHandler::EXCEPTION | ) |
Constructor that takes in the handling type, defaulting it to exception.
Definition at line 55 of file StatGenStatus.cpp.
References reset().
StatGenStatus::~StatGenStatus | ( | ) |
void StatGenStatus::addError | ( | StatGenStatus | newStatus | ) |
Add the specified status to the status message, setting the status to newStatus if the current status is SUCCESS.
Definition at line 122 of file StatGenStatus.cpp.
References SUCCESS.
void StatGenStatus::addError | ( | Status | newStatus, |
const char * | newMessage | ||
) |
Add the specified error message to the status message, setting the status to newStatus if the current status is SUCCESS.
Definition at line 99 of file StatGenStatus.cpp.
References getStatusString(), and SUCCESS.
StatGenStatus::Status StatGenStatus::getStatus | ( | ) | const |
Return the enum for this status object.
Definition at line 142 of file StatGenStatus.cpp.
Referenced by SamFile::GetStatus(), and SamRecord::writeRecordBuffer().
const char * StatGenStatus::getStatusMessage | ( | ) | const |
Return the status message for this object.
Definition at line 149 of file StatGenStatus.cpp.
Referenced by SamFile::GetStatusMessage().
|
static |
Return a string representation of the passed in status enum.
Definition at line 33 of file StatGenStatus.cpp.
Referenced by addError(), and setStatus().
|
static |
Returns whether or not it is "safe" to keep processing the file after the specified status return.
Definition at line 41 of file StatGenStatus.cpp.
References FAIL_PARSE, INVALID, INVALID_SORT, and SUCCESS.
bool StatGenStatus::operator!= | ( | const StatGenStatus::Status & | compStatus | ) | const |
Overload operator != to determine if the passed in type is not equal to this status's type.
Definition at line 182 of file StatGenStatus.cpp.
StatGenStatus & StatGenStatus::operator= | ( | StatGenStatus | newStatus | ) |
Overload operator = to copy the specified status object to this one.
Definition at line 171 of file StatGenStatus.cpp.
StatGenStatus & StatGenStatus::operator= | ( | StatGenStatus::Status | newStatus | ) |
Overload operator = to set the StatGen status type to the passed in status and to clear the message string.
Definition at line 157 of file StatGenStatus.cpp.
References SUCCESS.
bool StatGenStatus::operator== | ( | const StatGenStatus::Status & | compStatus | ) | const |
Overload operator == to determine if the passed in type is equal to this status's type.
Definition at line 190 of file StatGenStatus.cpp.
void StatGenStatus::reset | ( | ) |
Reset this status to a default state.
Definition at line 69 of file StatGenStatus.cpp.
References UNKNOWN.
Referenced by StatGenStatus().
void StatGenStatus::setHandlingType | ( | ErrorHandler::HandlingType | handleType | ) |
Set how to handle the errors when they are set.
Definition at line 76 of file StatGenStatus.cpp.
void StatGenStatus::setStatus | ( | Status | newStatus, |
const char * | newMessage | ||
) |
Set the status with the specified status enum and message.
Definition at line 83 of file StatGenStatus.cpp.
References getStatusString(), and SUCCESS.
Referenced by SamRecord::addIntTag(), SamRecord::addTag(), SamRecord::getNextSamTag(), SamFile::getNumMappedReadsFromIndex(), SamFile::getNumUnMappedReadsFromIndex(), SamRecord::getTagsString(), SamRecord::isValid(), SamFile::OpenForRead(), SamFile::OpenForWrite(), SamFile::ReadBamIndex(), SamFile::ReadHeader(), SamFile::ReadRecord(), SamRecord::rmTag(), SamRecord::rmTags(), SamRecord::setBuffer(), SamRecord::setBufferFromFile(), SamRecord::setReadName(), SamFile::SetReadSection(), SamFile::validateSortOrder(), SamFile::WriteHeader(), SamFile::WriteRecord(), and SamRecord::writeRecordBuffer().