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

Go to the SVN repository for this file.

1 /* $Id$
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  */
27 
28 /// @file FormatRpsDbParameters_.hpp
29 /// Data storage class.
30 ///
31 /// This file was generated by application DATATOOL
32 /// using the following specifications:
33 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/scoremat/scoremat.asn">scoremat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/scoremat/scoremat.def">scoremat.def</a>
36 ///
37 /// ATTENTION:
38 /// Don't edit or commit this file into CVS as this file will
39 /// be overridden (by DATATOOL) without warning!
40 
41 #ifndef OBJECTS_SCOREMAT_FORMATRPSDBPARAMETERS_BASE_HPP
42 #define OBJECTS_SCOREMAT_FORMATRPSDBPARAMETERS_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_ScoreMat
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// This structure is used to create the RPS-BLAST database auxiliary file
69 /// (*.aux) and it contains parameters set at creation time of the PSSM.
70 /// Also, the matrixName field is used by formatrpsdb to build a PSSM from
71 /// a Pssm structure which only contains PssmIntermediateData.
72 ///
73 /// CFormatRpsDbParameters_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CFormatRpsDbParameters_Base(void);
84 
85  // type info
87 
88  // types
89  typedef string TMatrixName;
90  typedef int TGapOpen;
91  typedef int TGapExtend;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_matrixName,
97  e_gapOpen,
98  e_gapExtend
99  };
101 
102  // getters
103  // setters
104 
105  /// name of the underlying score matrix whose frequency ratios were
106  /// used in PSSM construction (e.g.: BLOSUM62)
107  /// Check if a value has been assigned to MatrixName data member.
108  ///
109  /// Data member MatrixName is mandatory;
110  /// its type is defined as 'typedef string TMatrixName'
111  /// @return
112  /// - true, if a value has been assigned.
113  /// - false, otherwise.
114  bool IsSetMatrixName(void) const;
115 
116  /// Check if it is safe to call GetMatrixName method.
117  ///
118  /// @return
119  /// - true, if the data member is getatable.
120  /// - false, otherwise.
121  bool CanGetMatrixName(void) const;
122 
123  /// Reset MatrixName data member.
124  void ResetMatrixName(void);
125 
126  /// Get the MatrixName member data.
127  ///
128  /// @return
129  /// Reference to the member data.
130  const TMatrixName& GetMatrixName(void) const;
131 
132  /// Assign a value to MatrixName data member.
133  ///
134  /// @param value
135  /// Value to assign
136  void SetMatrixName(const TMatrixName& value);
137  void SetMatrixName(TMatrixName&& value);
138 
139  /// Assign a value to MatrixName data member.
140  ///
141  /// @return
142  /// Reference to the data value.
143  TMatrixName& SetMatrixName(void);
144 
145  /// gap opening penalty corresponding to the matrix above
146  /// Check if a value has been assigned to GapOpen data member.
147  ///
148  /// Data member GapOpen is optional;
149  /// its type is defined as 'typedef int TGapOpen'
150  /// @return
151  /// - true, if a value has been assigned.
152  /// - false, otherwise.
153  bool IsSetGapOpen(void) const;
154 
155  /// Check if it is safe to call GetGapOpen method.
156  ///
157  /// @return
158  /// - true, if the data member is getatable.
159  /// - false, otherwise.
160  bool CanGetGapOpen(void) const;
161 
162  /// Reset GapOpen data member.
163  void ResetGapOpen(void);
164 
165  /// Get the GapOpen member data.
166  ///
167  /// @return
168  /// Copy of the member data.
169  TGapOpen GetGapOpen(void) const;
170 
171  /// Assign a value to GapOpen data member.
172  ///
173  /// @param value
174  /// Value to assign
175  void SetGapOpen(TGapOpen value);
176 
177  /// Assign a value to GapOpen data member.
178  ///
179  /// @return
180  /// Reference to the data value.
181  TGapOpen& SetGapOpen(void);
182 
183  /// gap extension penalty corresponding to the matrix above
184  /// Check if a value has been assigned to GapExtend data member.
185  ///
186  /// Data member GapExtend is optional;
187  /// its type is defined as 'typedef int TGapExtend'
188  /// @return
189  /// - true, if a value has been assigned.
190  /// - false, otherwise.
191  bool IsSetGapExtend(void) const;
192 
193  /// Check if it is safe to call GetGapExtend method.
194  ///
195  /// @return
196  /// - true, if the data member is getatable.
197  /// - false, otherwise.
198  bool CanGetGapExtend(void) const;
199 
200  /// Reset GapExtend data member.
201  void ResetGapExtend(void);
202 
203  /// Get the GapExtend member data.
204  ///
205  /// @return
206  /// Copy of the member data.
207  TGapExtend GetGapExtend(void) const;
208 
209  /// Assign a value to GapExtend data member.
210  ///
211  /// @param value
212  /// Value to assign
213  void SetGapExtend(TGapExtend value);
214 
215  /// Assign a value to GapExtend data member.
216  ///
217  /// @return
218  /// Reference to the data value.
219  TGapExtend& SetGapExtend(void);
220 
221  /// Reset the whole object
222  virtual void Reset(void);
223 
224 
225 private:
226  // Prohibit copy constructor and assignment operator
229 
230  // data
231  Uint4 m_set_State[1];
232  string m_MatrixName;
235 };
236 
237 /* @} */
238 
239 
240 
241 
242 
243 ///////////////////////////////////////////////////////////
244 ///////////////////// inline methods //////////////////////
245 ///////////////////////////////////////////////////////////
246 inline
248 {
249  return ((m_set_State[0] & 0x3) != 0);
250 }
251 
252 inline
254 {
255  return IsSetMatrixName();
256 }
257 
258 inline
260 {
261  if (!CanGetMatrixName()) {
262  ThrowUnassigned(0);
263  }
264  return m_MatrixName;
265 }
266 
267 inline
269 {
271  m_set_State[0] |= 0x3;
272 }
273 
274 inline
276 {
277  m_MatrixName = std::forward<CFormatRpsDbParameters_Base::TMatrixName>(value);
278  m_set_State[0] |= 0x3;
279 }
280 
281 inline
283 {
284 #ifdef _DEBUG
285  if (!IsSetMatrixName()) {
287  }
288 #endif
289  m_set_State[0] |= 0x1;
290  return m_MatrixName;
291 }
292 
293 inline
295 {
296  return ((m_set_State[0] & 0xc) != 0);
297 }
298 
299 inline
301 {
302  return IsSetGapOpen();
303 }
304 
305 inline
307 {
308  m_GapOpen = 0;
309  m_set_State[0] &= ~0xc;
310 }
311 
312 inline
314 {
315  if (!CanGetGapOpen()) {
316  ThrowUnassigned(1);
317  }
318  return m_GapOpen;
319 }
320 
321 inline
323 {
324  m_GapOpen = value;
325  m_set_State[0] |= 0xc;
326 }
327 
328 inline
330 {
331 #ifdef _DEBUG
332  if (!IsSetGapOpen()) {
333  memset(&m_GapOpen,UnassignedByte(),sizeof(m_GapOpen));
334  }
335 #endif
336  m_set_State[0] |= 0x4;
337  return m_GapOpen;
338 }
339 
340 inline
342 {
343  return ((m_set_State[0] & 0x30) != 0);
344 }
345 
346 inline
348 {
349  return IsSetGapExtend();
350 }
351 
352 inline
354 {
355  m_GapExtend = 0;
356  m_set_State[0] &= ~0x30;
357 }
358 
359 inline
361 {
362  if (!CanGetGapExtend()) {
363  ThrowUnassigned(2);
364  }
365  return m_GapExtend;
366 }
367 
368 inline
370 {
371  m_GapExtend = value;
372  m_set_State[0] |= 0x30;
373 }
374 
375 inline
377 {
378 #ifdef _DEBUG
379  if (!IsSetGapExtend()) {
380  memset(&m_GapExtend,UnassignedByte(),sizeof(m_GapExtend));
381  }
382 #endif
383  m_set_State[0] |= 0x10;
384  return m_GapExtend;
385 }
386 
387 ///////////////////////////////////////////////////////////
388 ////////////////// end of inline methods //////////////////
389 ///////////////////////////////////////////////////////////
390 
391 
392 
393 
394 
395 END_objects_SCOPE // namespace ncbi::objects::
396 
398 
399 
400 #endif // OBJECTS_SCOREMAT_FORMATRPSDBPARAMETERS_BASE_HPP
This structure is used to create the RPS-BLAST database auxiliary file (*.aux) and it contains parame...
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
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_SCOREMAT_EXPORT
Definition: ncbi_export.h:736
const TMatrixName & GetMatrixName(void) const
Get the MatrixName member data.
bool CanGetGapExtend(void) const
Check if it is safe to call GetGapExtend method.
bool CanGetGapOpen(void) const
Check if it is safe to call GetGapOpen method.
bool IsSetGapOpen(void) const
gap opening penalty corresponding to the matrix above Check if a value has been assigned to GapOpen d...
TGapExtend GetGapExtend(void) const
Get the GapExtend member data.
void ResetGapExtend(void)
Reset GapExtend data member.
bool CanGetMatrixName(void) const
Check if it is safe to call GetMatrixName method.
TMatrixName & SetMatrixName(void)
Assign a value to MatrixName data member.
CFormatRpsDbParameters_Base(const CFormatRpsDbParameters_Base &)
bool IsSetMatrixName(void) const
name of the underlying score matrix whose frequency ratios were used in PSSM construction (e....
TGapOpen GetGapOpen(void) const
Get the GapOpen member data.
void ResetGapOpen(void)
Reset GapOpen data member.
bool IsSetGapExtend(void) const
gap extension penalty corresponding to the matrix above Check if a value has been assigned to GapExte...
CFormatRpsDbParameters_Base & operator=(const CFormatRpsDbParameters_Base &)
TGapExtend & SetGapExtend(void)
Assign a value to GapExtend data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
TGapOpen & SetGapOpen(void)
Assign a value to GapOpen data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Apr 14 05:26:39 2024 by modify_doxy.py rev. 669887