JASSv2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
JASS::instream_document_fasta Class Reference

Child class of instream for creating documents from FASTA genome sequence files. More...

#include <instream_document_fasta.h>

Inheritance diagram for JASS::instream_document_fasta:
Inheritance graph
[legend]
Collaboration diagram for JASS::instream_document_fasta:
Collaboration graph
[legend]

Public Member Functions

 instream_document_fasta (const instream_document_fasta &previous)=delete
 Copy constructor (not available). More...
 
 instream_document_fasta (std::shared_ptr< instream > &source)
 Constructor. More...
 
virtual ~instream_document_fasta ()
 Destructor.
 
virtual void read (document &buffer)
 Read the next document from the source instream into document. More...
 
- Public Member Functions inherited from JASS::instream
 instream (std::shared_ptr< instream > &source, std::shared_ptr< allocator > &memory)
 Constructor. More...
 
 instream (std::shared_ptr< instream > &source)
 Constructor. More...
 
 instream (void)
 Constructor.
 
virtual ~instream ()
 Destructor. More...
 
size_t fetch (void *buffer, size_t bytes)
 fetch() generates a document object, sets its contents to the passed buffer, calls read() and returns the number of bytes of data read More...
 

Static Public Member Functions

static void unittest (void)
 Unit test this class.
 

Protected Member Functions

 instream_document_fasta (std::shared_ptr< instream > &source, size_t buffer_size)
 Protected constructor used to set the size of the internal buffer in the unittest. More...
 
void fetch (void *buffer, size_t bytes)
 Fetch another block of data from the source. More...
 

Protected Attributes

size_t buffer_size
 Size of the disk read buffer. Normally 16MB.
 
uint8_t * buffer
 Pointer to the interal buffer from which documents are extracted. Filled by calling source.read()
 
uint8_t * buffer_end
 Pointer to the end of the buffer (used to prevent read past EOF).
 
size_t buffer_used
 The number of bytes of buffer that have already been used from buffer (buffer + buffer_used is a pointer to the unused data in buffer)
 
- Protected Attributes inherited from JASS::instream
std::shared_ptr< instreamsource
 If this object is reading from another instream then this is that instream.
 
std::shared_ptr< allocatormemory
 Any and all memory allocation must happen using this object.
 

Detailed Description

Child class of instream for creating documents from FASTA genome sequence files.

See the Wikipedia article on the FASTA file format here: https://en.wikipedia.org/wiki/FASTA_format

Constructor & Destructor Documentation

◆ instream_document_fasta() [1/3]

JASS::instream_document_fasta::instream_document_fasta ( std::shared_ptr< instream > &  source,
size_t  buffer_size 
)
protected

Protected constructor used to set the size of the internal buffer in the unittest.

Parameters
source[in] The instream responsible for providing data to this class.
buffer_size[in] The size of the internal buffer filled from source.

◆ instream_document_fasta() [2/3]

JASS::instream_document_fasta::instream_document_fasta ( const instream_document_fasta previous)
delete

Copy constructor (not available).

Parameters
previous[in] The instance to copy.

◆ instream_document_fasta() [3/3]

JASS::instream_document_fasta::instream_document_fasta ( std::shared_ptr< instream > &  source)

Constructor.

Parameters
source[in] The instream responsible for providing data to this class.

Member Function Documentation

◆ fetch()

void JASS::instream_document_fasta::fetch ( void *  buffer,
size_t  bytes 
)
inlineprotected

Fetch another block of data from the source.

Parameters
buffer[out] Write bytes amount of data into this memory location.
bytes[in] Read this amount of data from the source.

◆ read()

void JASS::instream_document_fasta::read ( document buffer)
virtual

Read the next document from the source instream into document.

Parameters
buffer[out] The next document in the source instream.

Implements JASS::instream.


The documentation for this class was generated from the following files: