NCBI C++ ToolKit
Biostruc_align_.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 Biostruc_align_.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/ncbimime/ncbimime.asn">ncbimime.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/ncbimime/ncbimime.def">ncbimime.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_NCBIMIME_BIOSTRUC_ALIGN_BASE_HPP
42 #define OBJECTS_NCBIMIME_BIOSTRUC_ALIGN_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
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 CBiostruc;
64 class CSeq_annot;
65 class CSeq_entry;
66 
67 
68 // generated classes
69 
70 
71 /** @addtogroup dataspec_NCBI_Mime
72  *
73  * @{
74  */
75 
76 /////////////////////////////////////////////////////////////////////////////
77 ///
78 /// CBiostruc_align_Base --
79 ///
80 
82 {
84 public:
85  // constructor
87  // destructor
88  virtual ~CBiostruc_align_Base(void);
89 
90  // type info
92 
93  // types
94  typedef CBiostruc TMaster;
95  typedef list< CRef< CBiostruc > > TSlaves;
97  typedef list< CRef< CSeq_entry > > TSequences;
98  typedef list< CRef< CSeq_annot > > TSeqalign;
101 
102  // member index
103  enum class E_memberIndex {
104  e__allMandatory = 0,
105  e_master,
106  e_slaves,
107  e_alignments,
108  e_sequences,
109  e_seqalign,
110  e_style_dictionary,
111  e_user_annotations
112  };
114 
115  // getters
116  // setters
117 
118  /// Check if a value has been assigned to Master data member.
119  ///
120  /// Data member Master is mandatory;
121  /// its type is defined as 'typedef CBiostruc TMaster'
122  /// @return
123  /// - true, if a value has been assigned.
124  /// - false, otherwise.
125  bool IsSetMaster(void) const;
126 
127  /// Check if it is safe to call GetMaster method.
128  ///
129  /// @return
130  /// - true, if the data member is getatable.
131  /// - false, otherwise.
132  bool CanGetMaster(void) const;
133 
134  /// Reset Master data member.
135  void ResetMaster(void);
136 
137  /// Get the Master member data.
138  ///
139  /// @return
140  /// Reference to the member data.
141  const TMaster& GetMaster(void) const;
142 
143  /// Assign a value to Master data member.
144  ///
145  /// @param value
146  /// Reference to value.
147  void SetMaster(TMaster& value);
148 
149  /// Assign a value to Master data member.
150  ///
151  /// @return
152  /// Reference to the data value.
153  TMaster& SetMaster(void);
154 
155  /// Check if a value has been assigned to Slaves data member.
156  ///
157  /// Data member Slaves is mandatory;
158  /// its type is defined as 'typedef list< CRef< CBiostruc > > TSlaves'
159  /// @return
160  /// - true, if a value has been assigned.
161  /// - false, otherwise.
162  bool IsSetSlaves(void) const;
163 
164  /// Check if it is safe to call GetSlaves method.
165  ///
166  /// @return
167  /// - true, if the data member is getatable.
168  /// - false, otherwise.
169  bool CanGetSlaves(void) const;
170 
171  /// Reset Slaves data member.
172  void ResetSlaves(void);
173 
174  /// Get the Slaves member data.
175  ///
176  /// @return
177  /// Reference to the member data.
178  const TSlaves& GetSlaves(void) const;
179 
180  /// Assign a value to Slaves data member.
181  ///
182  /// @return
183  /// Reference to the data value.
184  TSlaves& SetSlaves(void);
185 
186  /// structure alignments
187  /// Check if a value has been assigned to Alignments data member.
188  ///
189  /// Data member Alignments is mandatory;
190  /// its type is defined as 'typedef CBiostruc_annot_set TAlignments'
191  /// @return
192  /// - true, if a value has been assigned.
193  /// - false, otherwise.
194  bool IsSetAlignments(void) const;
195 
196  /// Check if it is safe to call GetAlignments method.
197  ///
198  /// @return
199  /// - true, if the data member is getatable.
200  /// - false, otherwise.
201  bool CanGetAlignments(void) const;
202 
203  /// Reset Alignments data member.
204  void ResetAlignments(void);
205 
206  /// Get the Alignments member data.
207  ///
208  /// @return
209  /// Reference to the member data.
210  const TAlignments& GetAlignments(void) const;
211 
212  /// Assign a value to Alignments data member.
213  ///
214  /// @param value
215  /// Reference to value.
216  void SetAlignments(TAlignments& value);
217 
218  /// Assign a value to Alignments data member.
219  ///
220  /// @return
221  /// Reference to the data value.
222  TAlignments& SetAlignments(void);
223 
224  /// sequences
225  /// Check if a value has been assigned to Sequences data member.
226  ///
227  /// Data member Sequences is mandatory;
228  /// its type is defined as 'typedef list< CRef< CSeq_entry > > TSequences'
229  /// @return
230  /// - true, if a value has been assigned.
231  /// - false, otherwise.
232  bool IsSetSequences(void) const;
233 
234  /// Check if it is safe to call GetSequences method.
235  ///
236  /// @return
237  /// - true, if the data member is getatable.
238  /// - false, otherwise.
239  bool CanGetSequences(void) const;
240 
241  /// Reset Sequences data member.
242  void ResetSequences(void);
243 
244  /// Get the Sequences member data.
245  ///
246  /// @return
247  /// Reference to the member data.
248  const TSequences& GetSequences(void) const;
249 
250  /// Assign a value to Sequences data member.
251  ///
252  /// @return
253  /// Reference to the data value.
254  TSequences& SetSequences(void);
255 
256  /// Check if a value has been assigned to Seqalign data member.
257  ///
258  /// Data member Seqalign is mandatory;
259  /// its type is defined as 'typedef list< CRef< CSeq_annot > > TSeqalign'
260  /// @return
261  /// - true, if a value has been assigned.
262  /// - false, otherwise.
263  bool IsSetSeqalign(void) const;
264 
265  /// Check if it is safe to call GetSeqalign method.
266  ///
267  /// @return
268  /// - true, if the data member is getatable.
269  /// - false, otherwise.
270  bool CanGetSeqalign(void) const;
271 
272  /// Reset Seqalign data member.
273  void ResetSeqalign(void);
274 
275  /// Get the Seqalign member data.
276  ///
277  /// @return
278  /// Reference to the member data.
279  const TSeqalign& GetSeqalign(void) const;
280 
281  /// Assign a value to Seqalign data member.
282  ///
283  /// @return
284  /// Reference to the data value.
285  TSeqalign& SetSeqalign(void);
286 
287  /// Check if a value has been assigned to Style_dictionary data member.
288  ///
289  /// Data member Style_dictionary is optional;
290  /// its type is defined as 'typedef CCn3d_style_dictionary TStyle_dictionary'
291  /// @return
292  /// - true, if a value has been assigned.
293  /// - false, otherwise.
294  bool IsSetStyle_dictionary(void) const;
295 
296  /// Check if it is safe to call GetStyle_dictionary method.
297  ///
298  /// @return
299  /// - true, if the data member is getatable.
300  /// - false, otherwise.
301  bool CanGetStyle_dictionary(void) const;
302 
303  /// Reset Style_dictionary data member.
304  void ResetStyle_dictionary(void);
305 
306  /// Get the Style_dictionary member data.
307  ///
308  /// @return
309  /// Reference to the member data.
310  const TStyle_dictionary& GetStyle_dictionary(void) const;
311 
312  /// Assign a value to Style_dictionary data member.
313  ///
314  /// @param value
315  /// Reference to value.
316  void SetStyle_dictionary(TStyle_dictionary& value);
317 
318  /// Assign a value to Style_dictionary data member.
319  ///
320  /// @return
321  /// Reference to the data value.
322  TStyle_dictionary& SetStyle_dictionary(void);
323 
324  /// Check if a value has been assigned to User_annotations data member.
325  ///
326  /// Data member User_annotations is optional;
327  /// its type is defined as 'typedef CCn3d_user_annotations TUser_annotations'
328  /// @return
329  /// - true, if a value has been assigned.
330  /// - false, otherwise.
331  bool IsSetUser_annotations(void) const;
332 
333  /// Check if it is safe to call GetUser_annotations method.
334  ///
335  /// @return
336  /// - true, if the data member is getatable.
337  /// - false, otherwise.
338  bool CanGetUser_annotations(void) const;
339 
340  /// Reset User_annotations data member.
341  void ResetUser_annotations(void);
342 
343  /// Get the User_annotations member data.
344  ///
345  /// @return
346  /// Reference to the member data.
347  const TUser_annotations& GetUser_annotations(void) const;
348 
349  /// Assign a value to User_annotations data member.
350  ///
351  /// @param value
352  /// Reference to value.
353  void SetUser_annotations(TUser_annotations& value);
354 
355  /// Assign a value to User_annotations data member.
356  ///
357  /// @return
358  /// Reference to the data value.
359  TUser_annotations& SetUser_annotations(void);
360 
361  /// Reset the whole object
362  virtual void Reset(void);
363 
364 
365 private:
366  // Prohibit copy constructor and assignment operator
369 
370  // data
371  Uint4 m_set_State[1];
373  list< CRef< CBiostruc > > m_Slaves;
375  list< CRef< CSeq_entry > > m_Sequences;
376  list< CRef< CSeq_annot > > m_Seqalign;
379 };
380 
381 /* @} */
382 
383 
384 
385 
386 
387 ///////////////////////////////////////////////////////////
388 ///////////////////// inline methods //////////////////////
389 ///////////////////////////////////////////////////////////
390 inline
392 {
393  return m_Master.NotEmpty();
394 }
395 
396 inline
398 {
399  return true;
400 }
401 
402 inline
404 {
405  if ( !m_Master ) {
406  const_cast<CBiostruc_align_Base*>(this)->ResetMaster();
407  }
408  return (*m_Master);
409 }
410 
411 inline
413 {
414  if ( !m_Master ) {
415  ResetMaster();
416  }
417  return (*m_Master);
418 }
419 
420 inline
422 {
423  return ((m_set_State[0] & 0xc) != 0);
424 }
425 
426 inline
428 {
429  return true;
430 }
431 
432 inline
434 {
435  return m_Slaves;
436 }
437 
438 inline
440 {
441  m_set_State[0] |= 0x4;
442  return m_Slaves;
443 }
444 
445 inline
447 {
448  return m_Alignments.NotEmpty();
449 }
450 
451 inline
453 {
454  return true;
455 }
456 
457 inline
459 {
460  if ( !m_Alignments ) {
461  const_cast<CBiostruc_align_Base*>(this)->ResetAlignments();
462  }
463  return (*m_Alignments);
464 }
465 
466 inline
468 {
469  if ( !m_Alignments ) {
470  ResetAlignments();
471  }
472  return (*m_Alignments);
473 }
474 
475 inline
477 {
478  return ((m_set_State[0] & 0xc0) != 0);
479 }
480 
481 inline
483 {
484  return true;
485 }
486 
487 inline
489 {
490  return m_Sequences;
491 }
492 
493 inline
495 {
496  m_set_State[0] |= 0x40;
497  return m_Sequences;
498 }
499 
500 inline
502 {
503  return ((m_set_State[0] & 0x300) != 0);
504 }
505 
506 inline
508 {
509  return true;
510 }
511 
512 inline
514 {
515  return m_Seqalign;
516 }
517 
518 inline
520 {
521  m_set_State[0] |= 0x100;
522  return m_Seqalign;
523 }
524 
525 inline
527 {
528  return m_Style_dictionary.NotEmpty();
529 }
530 
531 inline
533 {
534  return IsSetStyle_dictionary();
535 }
536 
537 inline
539 {
540  if (!CanGetStyle_dictionary()) {
541  ThrowUnassigned(5);
542  }
543  return (*m_Style_dictionary);
544 }
545 
546 inline
548 {
549  return m_User_annotations.NotEmpty();
550 }
551 
552 inline
554 {
555  return IsSetUser_annotations();
556 }
557 
558 inline
560 {
561  if (!CanGetUser_annotations()) {
562  ThrowUnassigned(6);
563  }
564  return (*m_User_annotations);
565 }
566 
567 ///////////////////////////////////////////////////////////
568 ////////////////// end of inline methods //////////////////
569 ///////////////////////////////////////////////////////////
570 
571 
572 
573 
574 
575 END_objects_SCOPE // namespace ncbi::objects::
576 
578 
579 
580 #endif // OBJECTS_NCBIMIME_BIOSTRUC_ALIGN_BASE_HPP
CBiostruc_align_Base –.
CBiostruc_annot_set –.
CCn3d_style_dictionary –.
CCn3d_user_annotations –.
CRef –.
Definition: ncbiobj.hpp:618
Definition: Seq_entry.hpp:56
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_NCBIMIME_EXPORT
Definition: ncbi_export.h:648
TSlaves & SetSlaves(void)
Assign a value to Slaves data member.
bool CanGetAlignments(void) const
Check if it is safe to call GetAlignments method.
bool IsSetUser_annotations(void) const
Check if a value has been assigned to User_annotations data member.
CCn3d_style_dictionary TStyle_dictionary
bool IsSetSlaves(void) const
Check if a value has been assigned to Slaves data member.
TSequences & SetSequences(void)
Assign a value to Sequences data member.
const TUser_annotations & GetUser_annotations(void) const
Get the User_annotations member data.
const TSequences & GetSequences(void) const
Get the Sequences member data.
bool CanGetStyle_dictionary(void) const
Check if it is safe to call GetStyle_dictionary method.
list< CRef< CSeq_entry > > m_Sequences
CRef< TStyle_dictionary > m_Style_dictionary
list< CRef< CSeq_annot > > TSeqalign
CBiostruc_annot_set TAlignments
const TMaster & GetMaster(void) const
Get the Master member data.
TSeqalign & SetSeqalign(void)
Assign a value to Seqalign data member.
const TAlignments & GetAlignments(void) const
Get the Alignments member data.
TAlignments & SetAlignments(void)
Assign a value to Alignments data member.
list< CRef< CBiostruc > > TSlaves
void ResetMaster(void)
Reset Master data member.
bool IsSetSequences(void) const
sequences Check if a value has been assigned to Sequences data member.
list< CRef< CSeq_entry > > TSequences
CCn3d_user_annotations TUser_annotations
bool CanGetSlaves(void) const
Check if it is safe to call GetSlaves method.
bool CanGetMaster(void) const
Check if it is safe to call GetMaster method.
const TSeqalign & GetSeqalign(void) const
Get the Seqalign member data.
bool CanGetUser_annotations(void) const
Check if it is safe to call GetUser_annotations method.
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
bool CanGetSequences(void) const
Check if it is safe to call GetSequences method.
TMaster & SetMaster(void)
Assign a value to Master data member.
bool IsSetAlignments(void) const
structure alignments Check if a value has been assigned to Alignments data member.
CBiostruc_align_Base & operator=(const CBiostruc_align_Base &)
bool IsSetStyle_dictionary(void) const
Check if a value has been assigned to Style_dictionary data member.
const TStyle_dictionary & GetStyle_dictionary(void) const
Get the Style_dictionary member data.
bool IsSetSeqalign(void) const
Check if a value has been assigned to Seqalign data member.
const TSlaves & GetSlaves(void) const
Get the Slaves member data.
bool IsSetMaster(void) const
Check if a value has been assigned to Master data member.
list< CRef< CSeq_annot > > m_Seqalign
CBiostruc_align_Base(const CBiostruc_align_Base &)
bool CanGetSeqalign(void) const
Check if it is safe to call GetSeqalign method.
CRef< TMaster > m_Master
CRef< TUser_annotations > m_User_annotations
list< CRef< CBiostruc > > m_Slaves
void ResetAlignments(void)
Reset Alignments data member.
CRef< TAlignments > m_Alignments
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Jul 10 14:37:08 2024 by modify_doxy.py rev. 669887