GenericSamInterface.h

00001 /*
00002  *  Copyright (C) 2010  Regents of the University of Michigan
00003  *
00004  *   This program is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #ifndef __GENERIC_SAM_INTERFACE_H__
00019 #define __GENERIC_SAM_INTERFACE_H__
00020 
00021 #include "SamStatus.h"
00022 #include "InputFile.h"
00023 #include "SamFileHeader.h"
00024 #include "SamRecord.h"
00025 
00026 class GenericSamInterface
00027 {
00028 public:
00029     GenericSamInterface();
00030     virtual ~GenericSamInterface();
00031    
00032     // Pure virtual method that reads the header section from the specified file
00033     // and stores it in the passed in header.
00034     // Will be implemented specifically for sam/bam files.
00035     virtual SamStatus::Status readHeader(IFILE filePtr, 
00036                                          SamFileHeader& header) = 0;
00037 
00038     // Pure virtual method that writes the specified header into the specified
00039     // file.
00040     // Will be implemented specifically for sam/bam files.
00041     virtual SamStatus::Status writeHeader(IFILE filePtr, 
00042                                           SamFileHeader& header) = 0;
00043 
00044     // Pure virtual method that reads the next record from the specified file 
00045     // and stores it in the passed in record.
00046     // Will be implemented specifically for sam/bam files.
00047     // TODO On error, a more detailed message is appended to statusMsg.
00048     virtual void readRecord(IFILE filePtr, SamFileHeader& header, 
00049                             SamRecord& record, 
00050                             SamStatus& samStatus) = 0;
00051    
00052     // Pure virtual method that writes the specified record into the specified
00053     // file.
00054     // Will be implemented specifically for sam/bam files.
00055     virtual SamStatus::Status writeRecord(IFILE filePtr, SamFileHeader& header,
00056                                           SamRecord& record,
00057                                           SamRecord::SequenceTranslation translation) = 0;
00058 
00059 };
00060 
00061 #endif
Generated on Tue Sep 6 17:51:59 2011 for libStatGen Software by  doxygen 1.6.3