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

Go to the SVN repository for this file.

1 /* $Id: seq_masker_score.hpp 33815 2007-05-04 17:18:18Z kazimird $
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 CSeqMaskerScore class.
30  *
31  */
32 
33 #ifndef C_SEQ_MASKER_SCORE_H
34 #define C_SEQ_MASKER_SCORE_H
35 
36 #include <corelib/ncbitype.h>
37 
39 
40 
42 
43 class CSeqMaskerWindow;
44 
45 /**
46  **\brief Abstract base class for score function objects.
47  **
48  ** The specific classes should be derived to provided
49  ** different methods of computing a window score. It uses
50  ** CSeqMaskerWindow interface to get access to information
51  ** about units of the current window.
52  **
53  **/
55 {
56 public:
57 
58  /**
59  **\brief Object constructor
60  **
61  **\param arg_ustat determines which unit score statistics
62  ** should be used
63  **
64  **/
66  : window( 0 ), ustat( arg_ustat ) {}
67 
68  /**
69  **\brief Object destructor
70  **/
71  virtual ~CSeqMaskerScore() {}
72 
73  /**
74  **\brief Get the score of the current window.
75  **
76  **\return the score of the current window
77  **
78  **/
79  virtual Uint4 operator()() = 0;
80 
81  /**
82  **\brief Window advancement notification.
83  **
84  ** If the score function object has to perform some
85  ** action in anticipation of window position advancement
86  ** then PreAdvance() interface has to be called just
87  ** prior to advancing the window with the argument
88  ** indicating by how many base positions the window
89  ** is going to be moved.
90  **
91  **\param step value of window advancement in bases
92  **
93  **/
94  virtual void PreAdvance( Uint4 step ) = 0;
95 
96  /**
97  **\brief Window advancement notification.
98  **
99  ** If the score function object has to perform some
100  ** action after the window position advancement then
101  ** PostAdvance() interface has to be called right
102  ** after the advancement of the window with the argument
103  ** indicating by how many base positions the window
104  ** has been moved.
105  **
106  **\param step value of window advancement in bases
107  **
108  **/
109  virtual void PostAdvance( Uint4 step ) = 0;
110 
111  /**
112  **\brief Set the window object that should be used for
113  ** score computation.
114  **
115  **\param new_window the object implementing CSeqMaskerWindow
116  ** window access interface
117  **
118  **/
119  void SetWindow( const CSeqMaskerWindow & new_window )
120  { window = &new_window; Init(); }
121 
122 protected:
123 
124  /**
125  **\brief Initialize the object.
126  **
127  ** Initialization should follow the call to SetWindow()
128  ** and should take care of any computations necessary to
129  ** initialize the score object.
130  **
131  **/
132  virtual void Init() = 0;
133 
134  /**
135  **\brief Points to the window information object.
136  **/
138 
139  /**
140  **\brief Unit score statistics that should be used by
141  ** the score function object.
142  **/
144 };
145 
147 
148 #endif
Abstract base class for score function objects.
virtual void Init()=0
Initialize the object.
virtual void PreAdvance(Uint4 step)=0
Window advancement notification.
const CRef< CSeqMaskerIstat > & ustat
Unit score statistics that should be used by the score function object.
virtual Uint4 operator()()=0
Get the score of the current window.
CSeqMaskerScore(const CRef< CSeqMaskerIstat > &arg_ustat)
Object constructor.
virtual ~CSeqMaskerScore()
Object destructor.
void SetWindow(const CSeqMaskerWindow &new_window)
Set the window object that should be used for score computation.
const CSeqMaskerWindow * window
Points to the window information object.
virtual void PostAdvance(Uint4 step)=0
Window advancement notification.
Sliding window skipping over the ambiguities.
static void Init(void)
Definition: cursor6.c:76
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
#define NCBI_XALGOWINMASK_EXPORT
Definition: ncbi_export.h:1033
Defines Limits for the types used in NCBI C/C++ toolkit.
Modified on Tue Apr 23 07:39:59 2024 by modify_doxy.py rev. 669887