1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
/*
* Copyright (C) 2010 Regents of the University of Michigan
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GENERIC_SAM_INTERFACE_H__
#define __GENERIC_SAM_INTERFACE_H__
#include "SamStatus.h"
#include "InputFile.h"
#include "SamFileHeader.h"
#include "SamRecord.h"
class GenericSamInterface
{
public:
GenericSamInterface();
virtual ~GenericSamInterface();
// Pure virtual method that reads the header section from the specified file
// and stores it in the passed in header, returns false and sets the status
// on failure.
// Will be implemented specifically for sam/bam files.
virtual bool readHeader(IFILE filePtr, SamFileHeader& header,
SamStatus& status) = 0;
// Pure virtual method that writes the specified header into the specified
// file, returns false and sets the status on failure.
// Will be implemented specifically for sam/bam files.
virtual bool writeHeader(IFILE filePtr, SamFileHeader& header,
SamStatus& status) = 0;
// Pure virtual method that reads the next record from the specified file
// and stores it in the passed in record.
// Will be implemented specifically for sam/bam files.
// TODO On error, a more detailed message is appended to statusMsg.
virtual void readRecord(IFILE filePtr, SamFileHeader& header,
SamRecord& record,
SamStatus& samStatus) = 0;
// Pure virtual method that writes the specified record into the specified
// file.
// Will be implemented specifically for sam/bam files.
virtual SamStatus::Status writeRecord(IFILE filePtr, SamFileHeader& header,
SamRecord& record,
SamRecord::SequenceTranslation translation) = 0;
virtual bool isEOF(IFILE filePtr);
};
#endif
|