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

Go to the SVN repository for this file.

1 /* $Id: seq_masker_ostat_bin.hpp 66705 2015-03-19 14:07:19Z morgulis $
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  * Definition of CSeqMaskerOstatBin class.
30  *
31  */
32 
33 #ifndef C_SEQ_MASKER_OSTAT_BIN_H
34 #define C_SEQ_MASKER_OSTAT_BIN_H
35 
36 #include <string>
37 #include <vector>
38 
40 
42 
43 /**
44  **\brief Compute and save counts information in simple binary format.
45  **/
47 {
48 public:
49 
50  /// Format version.
52 
53  /**
54  **\brief Object constructor.
55  **\param name the name of the output file stream
56  **/
57  explicit CSeqMaskerOstatBin(
58  const string & name, string const & metadata );
59 
60  /**
61  **\brief Object constructor.
62  **\param os the output stream
63  **/
64  explicit CSeqMaskerOstatBin( CNcbiOstream & os, string const & metadata );
65 
66  /**
67  **\brief Object destructor.
68  **/
69  virtual ~CSeqMaskerOstatBin();
70 
71  /** Get actual counts format version. */
72  virtual CSeqMaskerVersion const & GetStatFmtVersion() const {
73  return FormatVersion;
74  }
75 
76 protected:
77 
78  /**
79  **\brief Write count information for the unit to the binary output.
80  **\param unit the unit
81  **\param count the number of times the unit and its reverse complement
82  ** appears in the genome
83  **/
84  virtual void doSetUnitCount( Uint4 unit, Uint4 count );
85 
86  /**
87  **\brief Write data to output file.
88  **/
89  virtual void doFinalize();
90 
91 private:
92 
93  /**\internal
94  **\brief Write a 32 bit value to the output binary stream.
95  **\param word a 32 bit value
96  **/
97  void write_word( Uint4 word );
98 };
99 
101 
102 #endif
Compute and save counts information in simple binary format.
virtual CSeqMaskerVersion const & GetStatFmtVersion() const
Get actual counts format version.
static CSeqMaskerVersion FormatVersion
Format version.
Base class for computing and saving unit counts data.
virtual void doFinalize()
virtual void doSetUnitCount(Uint4, Uint4)=0
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
#define NCBI_XALGOWINMASK_EXPORT
Definition: ncbi_export.h:1033
Modified on Sat Apr 13 11:50:41 2024 by modify_doxy.py rev. 669887