NCBI C++ ToolKit
Sparse_seg_.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 Sparse_seg_.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_SPARSE_SEG_BASE_HPP
42 #define OBJECTS_SEQALIGN_SPARSE_SEG_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
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 // forward declarations
60 class CScore;
61 class CSeq_id;
62 class CSparse_align;
63 class CSparse_seg_ext;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Seqalign
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 /// ==========================================================================
76 ///
77 /// Sparse-seg follows the semantics of dense-seg and is more optimal for
78 /// representing sparse multiple alignments
79 ///
80 /// ==========================================================================
81 ///
82 /// CSparse_seg_Base --
83 ///
84 
86 {
88 public:
89  // constructor
90  CSparse_seg_Base(void);
91  // destructor
92  virtual ~CSparse_seg_Base(void);
93 
94  // type info
96 
97  // types
99  typedef vector< CRef< CSparse_align > > TRows;
100  typedef vector< CRef< CScore > > TRow_scores;
101  typedef vector< CRef< CSparse_seg_ext > > TExt;
102 
103  // member index
104  enum class E_memberIndex {
105  e__allMandatory = 0,
106  e_master_id,
107  e_rows,
108  e_row_scores,
109  e_ext
110  };
112 
113  // getters
114  // setters
115 
116  /// Check if a value has been assigned to Master_id data member.
117  ///
118  /// Data member Master_id is optional;
119  /// its type is defined as 'typedef CSeq_id TMaster_id'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetMaster_id(void) const;
124 
125  /// Check if it is safe to call GetMaster_id method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetMaster_id(void) const;
131 
132  /// Reset Master_id data member.
133  void ResetMaster_id(void);
134 
135  /// Get the Master_id member data.
136  ///
137  /// @return
138  /// Reference to the member data.
139  const TMaster_id& GetMaster_id(void) const;
140 
141  /// Assign a value to Master_id data member.
142  ///
143  /// @param value
144  /// Reference to value.
145  void SetMaster_id(TMaster_id& value);
146 
147  /// Assign a value to Master_id data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TMaster_id& SetMaster_id(void);
152 
153  /// pairwise alignments constituting this multiple alignment
154  /// Check if a value has been assigned to Rows data member.
155  ///
156  /// Data member Rows is mandatory;
157  /// its type is defined as 'typedef vector< CRef< CSparse_align > > TRows'
158  /// @return
159  /// - true, if a value has been assigned.
160  /// - false, otherwise.
161  bool IsSetRows(void) const;
162 
163  /// Check if it is safe to call GetRows method.
164  ///
165  /// @return
166  /// - true, if the data member is getatable.
167  /// - false, otherwise.
168  bool CanGetRows(void) const;
169 
170  /// Reset Rows data member.
171  void ResetRows(void);
172 
173  /// Get the Rows member data.
174  ///
175  /// @return
176  /// Reference to the member data.
177  const TRows& GetRows(void) const;
178 
179  /// Assign a value to Rows data member.
180  ///
181  /// @return
182  /// Reference to the data value.
183  TRows& SetRows(void);
184 
185  /// per-row scores
186  /// Check if a value has been assigned to Row_scores data member.
187  ///
188  /// Data member Row_scores is optional;
189  /// its type is defined as 'typedef vector< CRef< CScore > > TRow_scores'
190  /// @return
191  /// - true, if a value has been assigned.
192  /// - false, otherwise.
193  bool IsSetRow_scores(void) const;
194 
195  /// Check if it is safe to call GetRow_scores method.
196  ///
197  /// @return
198  /// - true, if the data member is getatable.
199  /// - false, otherwise.
200  bool CanGetRow_scores(void) const;
201 
202  /// Reset Row_scores data member.
203  void ResetRow_scores(void);
204 
205  /// Get the Row_scores member data.
206  ///
207  /// @return
208  /// Reference to the member data.
209  const TRow_scores& GetRow_scores(void) const;
210 
211  /// Assign a value to Row_scores data member.
212  ///
213  /// @return
214  /// Reference to the data value.
215  TRow_scores& SetRow_scores(void);
216 
217  /// index of extra items
218  /// Check if a value has been assigned to Ext data member.
219  ///
220  /// Data member Ext is optional;
221  /// its type is defined as 'typedef vector< CRef< CSparse_seg_ext > > TExt'
222  /// @return
223  /// - true, if a value has been assigned.
224  /// - false, otherwise.
225  bool IsSetExt(void) const;
226 
227  /// Check if it is safe to call GetExt method.
228  ///
229  /// @return
230  /// - true, if the data member is getatable.
231  /// - false, otherwise.
232  bool CanGetExt(void) const;
233 
234  /// Reset Ext data member.
235  void ResetExt(void);
236 
237  /// Get the Ext member data.
238  ///
239  /// @return
240  /// Reference to the member data.
241  const TExt& GetExt(void) const;
242 
243  /// Assign a value to Ext data member.
244  ///
245  /// @return
246  /// Reference to the data value.
247  TExt& SetExt(void);
248 
249  /// Reset the whole object
250  virtual void Reset(void);
251 
252 
253 private:
254  // Prohibit copy constructor and assignment operator
257 
258  // data
259  Uint4 m_set_State[1];
261  vector< CRef< CSparse_align > > m_Rows;
262  vector< CRef< CScore > > m_Row_scores;
263  vector< CRef< CSparse_seg_ext > > m_Ext;
264 };
265 
266 /* @} */
267 
268 
269 
270 
271 
272 ///////////////////////////////////////////////////////////
273 ///////////////////// inline methods //////////////////////
274 ///////////////////////////////////////////////////////////
275 inline
277 {
278  return m_Master_id.NotEmpty();
279 }
280 
281 inline
283 {
284  return IsSetMaster_id();
285 }
286 
287 inline
289 {
290  if (!CanGetMaster_id()) {
291  ThrowUnassigned(0);
292  }
293  return (*m_Master_id);
294 }
295 
296 inline
298 {
299  return ((m_set_State[0] & 0xc) != 0);
300 }
301 
302 inline
304 {
305  return true;
306 }
307 
308 inline
310 {
311  return m_Rows;
312 }
313 
314 inline
316 {
317  m_set_State[0] |= 0x4;
318  return m_Rows;
319 }
320 
321 inline
323 {
324  return ((m_set_State[0] & 0x30) != 0);
325 }
326 
327 inline
329 {
330  return true;
331 }
332 
333 inline
335 {
336  return m_Row_scores;
337 }
338 
339 inline
341 {
342  m_set_State[0] |= 0x10;
343  return m_Row_scores;
344 }
345 
346 inline
348 {
349  return ((m_set_State[0] & 0xc0) != 0);
350 }
351 
352 inline
354 {
355  return true;
356 }
357 
358 inline
360 {
361  return m_Ext;
362 }
363 
364 inline
366 {
367  m_set_State[0] |= 0x40;
368  return m_Ext;
369 }
370 
371 ///////////////////////////////////////////////////////////
372 ////////////////// end of inline methods //////////////////
373 ///////////////////////////////////////////////////////////
374 
375 
376 
377 
378 
379 END_objects_SCOPE // namespace ncbi::objects::
380 
382 
383 
384 #endif // OBJECTS_SEQALIGN_SPARSE_SEG_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
Definition: Score.hpp:57
Base class for all serializable objects.
Definition: serialbase.hpp:150
==========================================================================
Definition: Sparse_seg_.hpp:86
CSparse_seg_ext –.
char value[7]
Definition: config.c:431
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 CanGetRows(void) const
Check if it is safe to call GetRows method.
const TExt & GetExt(void) const
Get the Ext member data.
TRow_scores & SetRow_scores(void)
Assign a value to Row_scores data member.
CRef< TMaster_id > m_Master_id
vector< CRef< CSparse_align > > TRows
Definition: Sparse_seg_.hpp:99
vector< CRef< CScore > > TRow_scores
bool CanGetRow_scores(void) const
Check if it is safe to call GetRow_scores method.
CSparse_seg_Base(const CSparse_seg_Base &)
TExt & SetExt(void)
Assign a value to Ext data member.
vector< CRef< CScore > > m_Row_scores
const TMaster_id & GetMaster_id(void) const
Get the Master_id member data.
TRows & SetRows(void)
Assign a value to Rows data member.
vector< CRef< CSparse_align > > m_Rows
bool CanGetMaster_id(void) const
Check if it is safe to call GetMaster_id method.
bool CanGetExt(void) const
Check if it is safe to call GetExt method.
Uint4 m_set_State[1]
bool IsSetMaster_id(void) const
Check if a value has been assigned to Master_id data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
const TRow_scores & GetRow_scores(void) const
Get the Row_scores member data.
vector< CRef< CSparse_seg_ext > > TExt
CSparse_seg_Base & operator=(const CSparse_seg_Base &)
vector< CRef< CSparse_seg_ext > > m_Ext
bool IsSetExt(void) const
index of extra items Check if a value has been assigned to Ext data member.
CSerialObject Tparent
Definition: Sparse_seg_.hpp:87
const TRows & GetRows(void) const
Get the Rows member data.
bool IsSetRow_scores(void) const
per-row scores Check if a value has been assigned to Row_scores data member.
bool IsSetRows(void) const
pairwise alignments constituting this multiple alignment Check if a value has been assigned to Rows d...
Modified on Sat Dec 02 09:21:05 2023 by modify_doxy.py rev. 669887