NCBI C++ ToolKit
Dense_diag_.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 Dense_diag_.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/seqalign/seqalign.asn">seqalign.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqalign/seqalign.def">seqalign.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_SEQALIGN_DENSE_DIAG_BASE_HPP
42 #define OBJECTS_SEQALIGN_DENSE_DIAG_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CScore;
62 class CSeq_id;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_Seqalign
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 /// for (multiway) diagonals
75 ///
76 /// CDense_diag_Base --
77 ///
78 
80 {
82 public:
83  // constructor
84  CDense_diag_Base(void);
85  // destructor
86  virtual ~CDense_diag_Base(void);
87 
88  // type info
90 
91  // types
92  typedef int TDim;
93  typedef vector< CRef< CSeq_id > > TIds;
94  typedef vector< TSeqPos > TStarts;
95  typedef TSeqPos TLen;
96  typedef vector< ENa_strand > TStrands;
97  typedef vector< CRef< CScore > > TScores;
98 
99  // member index
100  enum class E_memberIndex {
101  e__allMandatory = 0,
102  e_dim,
103  e_ids,
104  e_starts,
105  e_len,
106  e_strands,
107  e_scores
108  };
110 
111  // getters
112  // setters
113 
114  /// dimensionality
115  /// Check if a value has been assigned to Dim data member.
116  ///
117  /// Data member Dim is optional with default 2;
118  /// its type is defined as 'typedef int TDim'
119  /// @return
120  /// - true, if a value has been assigned.
121  /// - false, otherwise.
122  bool IsSetDim(void) const;
123 
124  /// Check if it is safe to call GetDim method.
125  ///
126  /// @return
127  /// - true, if the data member is getatable.
128  /// - false, otherwise.
129  bool CanGetDim(void) const;
130 
131  /// Reset Dim data member.
132  void ResetDim(void);
133 
134  /// Assign default value to Dim data member.
135  void SetDefaultDim(void);
136 
137  /// Get the Dim member data.
138  ///
139  /// @return
140  /// Copy of the member data.
141  TDim GetDim(void) const;
142 
143  /// Assign a value to Dim data member.
144  ///
145  /// @param value
146  /// Value to assign
147  void SetDim(TDim value);
148 
149  /// Assign a value to Dim data member.
150  ///
151  /// @return
152  /// Reference to the data value.
153  TDim& SetDim(void);
154 
155  /// sequences in order
156  /// Check if a value has been assigned to Ids data member.
157  ///
158  /// Data member Ids is mandatory;
159  /// its type is defined as 'typedef vector< CRef< CSeq_id > > TIds'
160  /// @return
161  /// - true, if a value has been assigned.
162  /// - false, otherwise.
163  bool IsSetIds(void) const;
164 
165  /// Check if it is safe to call GetIds method.
166  ///
167  /// @return
168  /// - true, if the data member is getatable.
169  /// - false, otherwise.
170  bool CanGetIds(void) const;
171 
172  /// Reset Ids data member.
173  void ResetIds(void);
174 
175  /// Get the Ids member data.
176  ///
177  /// @return
178  /// Reference to the member data.
179  const TIds& GetIds(void) const;
180 
181  /// Assign a value to Ids data member.
182  ///
183  /// @return
184  /// Reference to the data value.
185  TIds& SetIds(void);
186 
187  /// start OFFSETS in ids order
188  /// Check if a value has been assigned to Starts data member.
189  ///
190  /// Data member Starts is mandatory;
191  /// its type is defined as 'typedef vector< TSeqPos > TStarts'
192  /// @return
193  /// - true, if a value has been assigned.
194  /// - false, otherwise.
195  bool IsSetStarts(void) const;
196 
197  /// Check if it is safe to call GetStarts method.
198  ///
199  /// @return
200  /// - true, if the data member is getatable.
201  /// - false, otherwise.
202  bool CanGetStarts(void) const;
203 
204  /// Reset Starts data member.
205  void ResetStarts(void);
206 
207  /// Get the Starts member data.
208  ///
209  /// @return
210  /// Reference to the member data.
211  const TStarts& GetStarts(void) const;
212 
213  /// Assign a value to Starts data member.
214  ///
215  /// @return
216  /// Reference to the data value.
217  TStarts& SetStarts(void);
218 
219  /// len of aligned segments
220  /// Check if a value has been assigned to Len data member.
221  ///
222  /// Data member Len is mandatory;
223  /// its type is defined as 'typedef TSeqPos TLen'
224  /// @return
225  /// - true, if a value has been assigned.
226  /// - false, otherwise.
227  bool IsSetLen(void) const;
228 
229  /// Check if it is safe to call GetLen method.
230  ///
231  /// @return
232  /// - true, if the data member is getatable.
233  /// - false, otherwise.
234  bool CanGetLen(void) const;
235 
236  /// Reset Len data member.
237  void ResetLen(void);
238 
239  /// Get the Len member data.
240  ///
241  /// @return
242  /// Copy of the member data.
243  TLen GetLen(void) const;
244 
245  /// Assign a value to Len data member.
246  ///
247  /// @param value
248  /// Value to assign
249  void SetLen(TLen value);
250 
251  /// Assign a value to Len data member.
252  ///
253  /// @return
254  /// Reference to the data value.
255  TLen& SetLen(void);
256 
257  /// Check if a value has been assigned to Strands data member.
258  ///
259  /// Data member Strands is optional;
260  /// its type is defined as 'typedef vector< ENa_strand > TStrands'
261  /// @return
262  /// - true, if a value has been assigned.
263  /// - false, otherwise.
264  bool IsSetStrands(void) const;
265 
266  /// Check if it is safe to call GetStrands method.
267  ///
268  /// @return
269  /// - true, if the data member is getatable.
270  /// - false, otherwise.
271  bool CanGetStrands(void) const;
272 
273  /// Reset Strands data member.
274  void ResetStrands(void);
275 
276  /// Get the Strands member data.
277  ///
278  /// @return
279  /// Reference to the member data.
280  const TStrands& GetStrands(void) const;
281 
282  /// Assign a value to Strands data member.
283  ///
284  /// @return
285  /// Reference to the data value.
286  TStrands& SetStrands(void);
287 
288  /// Check if a value has been assigned to Scores data member.
289  ///
290  /// Data member Scores is optional;
291  /// its type is defined as 'typedef vector< CRef< CScore > > TScores'
292  /// @return
293  /// - true, if a value has been assigned.
294  /// - false, otherwise.
295  bool IsSetScores(void) const;
296 
297  /// Check if it is safe to call GetScores method.
298  ///
299  /// @return
300  /// - true, if the data member is getatable.
301  /// - false, otherwise.
302  bool CanGetScores(void) const;
303 
304  /// Reset Scores data member.
305  void ResetScores(void);
306 
307  /// Get the Scores member data.
308  ///
309  /// @return
310  /// Reference to the member data.
311  const TScores& GetScores(void) const;
312 
313  /// Assign a value to Scores data member.
314  ///
315  /// @return
316  /// Reference to the data value.
317  TScores& SetScores(void);
318 
319  /// Reset the whole object
320  virtual void Reset(void);
321 
322 
323 private:
324  // Prohibit copy constructor and assignment operator
327 
328  // data
329  Uint4 m_set_State[1];
330  int m_Dim;
331  vector< CRef< CSeq_id > > m_Ids;
332  vector< TSeqPos > m_Starts;
334  vector< ENa_strand > m_Strands;
335  vector< CRef< CScore > > m_Scores;
336 };
337 
338 /* @} */
339 
340 
341 
342 
343 
344 ///////////////////////////////////////////////////////////
345 ///////////////////// inline methods //////////////////////
346 ///////////////////////////////////////////////////////////
347 inline
349 {
350  return ((m_set_State[0] & 0x3) != 0);
351 }
352 
353 inline
355 {
356  return true;
357 }
358 
359 inline
361 {
362  m_Dim = 2;
363  m_set_State[0] &= ~0x3;
364 }
365 
366 inline
368 {
369  ResetDim();
370 }
371 
372 inline
374 {
375  return m_Dim;
376 }
377 
378 inline
380 {
381  m_Dim = value;
382  m_set_State[0] |= 0x3;
383 }
384 
385 inline
387 {
388 #ifdef _DEBUG
389  if (!IsSetDim()) {
390  memset(&m_Dim,UnassignedByte(),sizeof(m_Dim));
391  }
392 #endif
393  m_set_State[0] |= 0x1;
394  return m_Dim;
395 }
396 
397 inline
399 {
400  return ((m_set_State[0] & 0xc) != 0);
401 }
402 
403 inline
405 {
406  return true;
407 }
408 
409 inline
411 {
412  return m_Ids;
413 }
414 
415 inline
417 {
418  m_set_State[0] |= 0x4;
419  return m_Ids;
420 }
421 
422 inline
424 {
425  return ((m_set_State[0] & 0x30) != 0);
426 }
427 
428 inline
430 {
431  return true;
432 }
433 
434 inline
436 {
437  return m_Starts;
438 }
439 
440 inline
442 {
443  m_set_State[0] |= 0x10;
444  return m_Starts;
445 }
446 
447 inline
449 {
450  return ((m_set_State[0] & 0xc0) != 0);
451 }
452 
453 inline
455 {
456  return IsSetLen();
457 }
458 
459 inline
461 {
462  m_Len = 0;
463  m_set_State[0] &= ~0xc0;
464 }
465 
466 inline
468 {
469  if (!CanGetLen()) {
470  ThrowUnassigned(3);
471  }
472  return m_Len;
473 }
474 
475 inline
477 {
478  m_Len = value;
479  m_set_State[0] |= 0xc0;
480 }
481 
482 inline
484 {
485 #ifdef _DEBUG
486  if (!IsSetLen()) {
487  memset(&m_Len,UnassignedByte(),sizeof(m_Len));
488  }
489 #endif
490  m_set_State[0] |= 0x40;
491  return m_Len;
492 }
493 
494 inline
496 {
497  return ((m_set_State[0] & 0x300) != 0);
498 }
499 
500 inline
502 {
503  return true;
504 }
505 
506 inline
508 {
509  return m_Strands;
510 }
511 
512 inline
514 {
515  m_set_State[0] |= 0x100;
516  return m_Strands;
517 }
518 
519 inline
521 {
522  return ((m_set_State[0] & 0xc00) != 0);
523 }
524 
525 inline
527 {
528  return true;
529 }
530 
531 inline
533 {
534  return m_Scores;
535 }
536 
537 inline
539 {
540  m_set_State[0] |= 0x400;
541  return m_Scores;
542 }
543 
544 ///////////////////////////////////////////////////////////
545 ////////////////// end of inline methods //////////////////
546 ///////////////////////////////////////////////////////////
547 
548 
549 
550 
551 
552 END_objects_SCOPE // namespace ncbi::objects::
553 
555 
556 
557 #endif // OBJECTS_SEQALIGN_DENSE_DIAG_BASE_HPP
void SetScores(objects::CSeq_align &seq_align, objects::CScope &scope, const string &matrix_name="BLOSUM62")
for (multiway) diagonals
Definition: Dense_diag_.hpp:80
Definition: Score.hpp:57
Base class for all serializable objects.
Definition: serialbase.hpp:150
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
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_SEQALIGN_EXPORT
Definition: ncbi_export.h:744
bool CanGetScores(void) const
Check if it is safe to call GetScores method.
bool IsSetStarts(void) const
start OFFSETS in ids order Check if a value has been assigned to Starts data member.
bool IsSetDim(void) const
dimensionality Check if a value has been assigned to Dim data member.
void ResetLen(void)
Reset Len data member.
const TScores & GetScores(void) const
Get the Scores member data.
TScores & SetScores(void)
Assign a value to Scores data member.
Uint4 m_set_State[1]
TLen & SetLen(void)
Assign a value to Len data member.
bool CanGetStarts(void) const
Check if it is safe to call GetStarts method.
bool IsSetIds(void) const
sequences in order Check if a value has been assigned to Ids data member.
TStrands & SetStrands(void)
Assign a value to Strands data member.
bool CanGetIds(void) const
Check if it is safe to call GetIds method.
TLen GetLen(void) const
Get the Len member data.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
vector< TSeqPos > TStarts
Definition: Dense_diag_.hpp:94
vector< CRef< CSeq_id > > TIds
Definition: Dense_diag_.hpp:93
TDim GetDim(void) const
Get the Dim member data.
const TIds & GetIds(void) const
Get the Ids member data.
CSerialObject Tparent
Definition: Dense_diag_.hpp:81
TStarts & SetStarts(void)
Assign a value to Starts data member.
void ResetDim(void)
Reset Dim data member.
bool CanGetDim(void) const
Check if it is safe to call GetDim method.
vector< CRef< CSeq_id > > m_Ids
bool IsSetStrands(void) const
Check if a value has been assigned to Strands data member.
vector< ENa_strand > TStrands
Definition: Dense_diag_.hpp:96
vector< CRef< CScore > > TScores
Definition: Dense_diag_.hpp:97
bool CanGetLen(void) const
Check if it is safe to call GetLen method.
const TStrands & GetStrands(void) const
Get the Strands member data.
void SetDefaultDim(void)
Assign default value to Dim data member.
const TStarts & GetStarts(void) const
Get the Starts member data.
bool CanGetStrands(void) const
Check if it is safe to call GetStrands method.
TDim & SetDim(void)
Assign a value to Dim data member.
vector< TSeqPos > m_Starts
vector< CRef< CScore > > m_Scores
vector< ENa_strand > m_Strands
bool IsSetLen(void) const
len of aligned segments Check if a value has been assigned to Len data member.
bool IsSetScores(void) const
Check if a value has been assigned to Scores data member.
CDense_diag_Base & operator=(const CDense_diag_Base &)
CDense_diag_Base(const CDense_diag_Base &)
TIds & SetIds(void)
Assign a value to Ids data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static bool GetIds(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
Modified on Tue May 28 05:53:01 2024 by modify_doxy.py rev. 669887