NCBI C++ ToolKit
mask_bdb_reader.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: mask_bdb_reader.hpp 78368 2017-06-13 18:26:55Z rackerst $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Aleksandr Morgulis
27  *
28  * File Description:
29  * Header file for CMaskBDBReader class.
30  *
31  */
32 
33 #ifndef CMASK_BDB_READER_H
34 #define CMASK_BDB_READER_H
35 
37 
39 
41 
42 /**
43  **\brief Class for reading sequences from BLAST databases.
44  **/
46 {
47 public:
48 
49  /**
50  **\brief Object constructor.
51  **
52  **\param dbname BLAST database to read data from.
53  **
54  **/
55  CMaskBDBReader( const string & dbname, bool is_nucl = true)
56  : CMaskReader( cin ),
57  seqdb_( new CSeqDB( dbname, (is_nucl
58  ? CSeqDB::eNucleotide
59  : CSeqDB::eProtein)) ),
60  oid_( 0 )
61  {}
62 
63  /**
64  **\brief Object destructor.
65  **
66  **/
67  virtual ~CMaskBDBReader() {}
68 
69  /**
70  **\brief Read next sequence from the database.
71  **
72  **\return pointer (reference counting) to the object
73  ** containing information about the sequence, or
74  ** CRef( NULL ) if end of file is reached.
75  **
76  **/
78 
79 private:
80 
81  CRef< CSeqDB > seqdb_; /**< BLAST database object. */
82  CSeqDB::TOID oid_; /**< Current OID (to be read). */
83 };
84 
86 
87 #endif
88 
Class for reading sequences from BLAST databases.
virtual ~CMaskBDBReader()
Object destructor.
CRef< CSeqDB > seqdb_
BLAST database object.
CSeqDB::TOID oid_
Current OID (to be read).
CMaskBDBReader(const string &dbname, bool is_nucl=true)
Object constructor.
Virtual base class for all input readers.
Definition: mask_reader.hpp:50
virtual CRef< objects::CSeq_entry > GetNextSequence()=0
Read the next sequence from the source stream.
CSeqDB.
Definition: seqdb.hpp:161
int TOID
Sequence type accepted and returned for OID indices.
Definition: seqdb.hpp:216
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_XOBJREAD_EXPORT
Definition: ncbi_export.h:1315
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6929
Defines BLAST database access classes.
Modified on Thu Apr 11 15:04:03 2024 by modify_doxy.py rev. 669887