NCBI C++ ToolKit
Cdd_tree_.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 Cdd_tree_.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/cdd/cdd.asn">cdd.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/cdd/cdd.def">cdd.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_CDD_CDD_TREE_BASE_HPP
42 #define OBJECTS_CDD_CDD_TREE_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 // forward declarations
60 class CCdd_descr_set;
61 class CCdd_id;
62 class CCdd_id_set;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_Cdd
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 /// the Cdd-tree stores the hierarchy of CDDs. These objects are stored separate
75 /// from the CDs to allow for fast retrieval and use as an 'index' into CDs
76 /// all the components in a CD-tree match components in the full-sized CD
77 /// and should be synchronized
78 ///
79 /// CCdd_tree_Base --
80 ///
81 
83 {
85 public:
86  // constructor
87  CCdd_tree_Base(void);
88  // destructor
89  virtual ~CCdd_tree_Base(void);
90 
91  // type info
93 
94  // types
95  typedef string TName;
96  typedef CCdd_id_set TId;
98  typedef CCdd_id TParent;
102 
103  // member index
104  enum class E_memberIndex {
105  e__allMandatory = 0,
106  e_name,
107  e_id,
108  e_description,
109  e_parent,
110  e_children,
111  e_siblings,
112  e_neighbors
113  };
115 
116  // getters
117  // setters
118 
119  /// short name copied from CD
120  /// Check if a value has been assigned to Name data member.
121  ///
122  /// Data member Name is mandatory;
123  /// its type is defined as 'typedef string TName'
124  /// @return
125  /// - true, if a value has been assigned.
126  /// - false, otherwise.
127  bool IsSetName(void) const;
128 
129  /// Check if it is safe to call GetName method.
130  ///
131  /// @return
132  /// - true, if the data member is getatable.
133  /// - false, otherwise.
134  bool CanGetName(void) const;
135 
136  /// Reset Name data member.
137  void ResetName(void);
138 
139  /// Get the Name member data.
140  ///
141  /// @return
142  /// Reference to the member data.
143  const TName& GetName(void) const;
144 
145  /// Assign a value to Name data member.
146  ///
147  /// @param value
148  /// Value to assign
149  void SetName(const TName& value);
150  void SetName(TName&& value);
151 
152  /// Assign a value to Name data member.
153  ///
154  /// @return
155  /// Reference to the data value.
156  TName& SetName(void);
157 
158  /// IDs copied from CD
159  /// Check if a value has been assigned to Id data member.
160  ///
161  /// Data member Id is mandatory;
162  /// its type is defined as 'typedef CCdd_id_set TId'
163  /// @return
164  /// - true, if a value has been assigned.
165  /// - false, otherwise.
166  bool IsSetId(void) const;
167 
168  /// Check if it is safe to call GetId method.
169  ///
170  /// @return
171  /// - true, if the data member is getatable.
172  /// - false, otherwise.
173  bool CanGetId(void) const;
174 
175  /// Reset Id data member.
176  void ResetId(void);
177 
178  /// Get the Id member data.
179  ///
180  /// @return
181  /// Reference to the member data.
182  const TId& GetId(void) const;
183 
184  /// Assign a value to Id data member.
185  ///
186  /// @param value
187  /// Reference to value.
188  void SetId(TId& value);
189 
190  /// Assign a value to Id data member.
191  ///
192  /// @return
193  /// Reference to the data value.
194  TId& SetId(void);
195 
196  /// description copied from CD
197  /// Check if a value has been assigned to Description data member.
198  ///
199  /// Data member Description is optional;
200  /// its type is defined as 'typedef CCdd_descr_set TDescription'
201  /// @return
202  /// - true, if a value has been assigned.
203  /// - false, otherwise.
204  bool IsSetDescription(void) const;
205 
206  /// Check if it is safe to call GetDescription method.
207  ///
208  /// @return
209  /// - true, if the data member is getatable.
210  /// - false, otherwise.
211  bool CanGetDescription(void) const;
212 
213  /// Reset Description data member.
214  void ResetDescription(void);
215 
216  /// Get the Description member data.
217  ///
218  /// @return
219  /// Reference to the member data.
220  const TDescription& GetDescription(void) const;
221 
222  /// Assign a value to Description data member.
223  ///
224  /// @param value
225  /// Reference to value.
226  void SetDescription(TDescription& value);
227 
228  /// Assign a value to Description data member.
229  ///
230  /// @return
231  /// Reference to the data value.
232  TDescription& SetDescription(void);
233 
234  /// CD is the result of a split/merge
235  /// Check if a value has been assigned to Parent data member.
236  ///
237  /// Data member Parent is optional;
238  /// its type is defined as 'typedef CCdd_id TParent'
239  /// @return
240  /// - true, if a value has been assigned.
241  /// - false, otherwise.
242  bool IsSetParent(void) const;
243 
244  /// Check if it is safe to call GetParent method.
245  ///
246  /// @return
247  /// - true, if the data member is getatable.
248  /// - false, otherwise.
249  bool CanGetParent(void) const;
250 
251  /// Reset Parent data member.
252  void ResetParent(void);
253 
254  /// Get the Parent member data.
255  ///
256  /// @return
257  /// Reference to the member data.
258  const TParent& GetParent(void) const;
259 
260  /// Assign a value to Parent data member.
261  ///
262  /// @param value
263  /// Reference to value.
264  void SetParent(TParent& value);
265 
266  /// Assign a value to Parent data member.
267  ///
268  /// @return
269  /// Reference to the data value.
270  TParent& SetParent(void);
271 
272  /// this CD has been split
273  /// Check if a value has been assigned to Children data member.
274  ///
275  /// Data member Children is optional;
276  /// its type is defined as 'typedef CCdd_id_set TChildren'
277  /// @return
278  /// - true, if a value has been assigned.
279  /// - false, otherwise.
280  bool IsSetChildren(void) const;
281 
282  /// Check if it is safe to call GetChildren method.
283  ///
284  /// @return
285  /// - true, if the data member is getatable.
286  /// - false, otherwise.
287  bool CanGetChildren(void) const;
288 
289  /// Reset Children data member.
290  void ResetChildren(void);
291 
292  /// Get the Children member data.
293  ///
294  /// @return
295  /// Reference to the member data.
296  const TChildren& GetChildren(void) const;
297 
298  /// Assign a value to Children data member.
299  ///
300  /// @param value
301  /// Reference to value.
302  void SetChildren(TChildren& value);
303 
304  /// Assign a value to Children data member.
305  ///
306  /// @return
307  /// Reference to the data value.
308  TChildren& SetChildren(void);
309 
310  /// related CDs (have common hits)
311  /// Check if a value has been assigned to Siblings data member.
312  ///
313  /// Data member Siblings is optional;
314  /// its type is defined as 'typedef CCdd_id_set TSiblings'
315  /// @return
316  /// - true, if a value has been assigned.
317  /// - false, otherwise.
318  bool IsSetSiblings(void) const;
319 
320  /// Check if it is safe to call GetSiblings method.
321  ///
322  /// @return
323  /// - true, if the data member is getatable.
324  /// - false, otherwise.
325  bool CanGetSiblings(void) const;
326 
327  /// Reset Siblings data member.
328  void ResetSiblings(void);
329 
330  /// Get the Siblings member data.
331  ///
332  /// @return
333  /// Reference to the member data.
334  const TSiblings& GetSiblings(void) const;
335 
336  /// Assign a value to Siblings data member.
337  ///
338  /// @param value
339  /// Reference to value.
340  void SetSiblings(TSiblings& value);
341 
342  /// Assign a value to Siblings data member.
343  ///
344  /// @return
345  /// Reference to the data value.
346  TSiblings& SetSiblings(void);
347 
348  /// co-occurring CDs (non-overlapping
349  /// hits to same sequences)
350  /// Check if a value has been assigned to Neighbors data member.
351  ///
352  /// Data member Neighbors is optional;
353  /// its type is defined as 'typedef CCdd_id_set TNeighbors'
354  /// @return
355  /// - true, if a value has been assigned.
356  /// - false, otherwise.
357  bool IsSetNeighbors(void) const;
358 
359  /// Check if it is safe to call GetNeighbors method.
360  ///
361  /// @return
362  /// - true, if the data member is getatable.
363  /// - false, otherwise.
364  bool CanGetNeighbors(void) const;
365 
366  /// Reset Neighbors data member.
367  void ResetNeighbors(void);
368 
369  /// Get the Neighbors member data.
370  ///
371  /// @return
372  /// Reference to the member data.
373  const TNeighbors& GetNeighbors(void) const;
374 
375  /// Assign a value to Neighbors data member.
376  ///
377  /// @param value
378  /// Reference to value.
379  void SetNeighbors(TNeighbors& value);
380 
381  /// Assign a value to Neighbors data member.
382  ///
383  /// @return
384  /// Reference to the data value.
385  TNeighbors& SetNeighbors(void);
386 
387  /// Reset the whole object
388  virtual void Reset(void);
389 
390 
391 private:
392  // Prohibit copy constructor and assignment operator
395 
396  // data
397  Uint4 m_set_State[1];
398  string m_Name;
405 };
406 
407 /* @} */
408 
409 
410 
411 
412 
413 ///////////////////////////////////////////////////////////
414 ///////////////////// inline methods //////////////////////
415 ///////////////////////////////////////////////////////////
416 inline
418 {
419  return ((m_set_State[0] & 0x3) != 0);
420 }
421 
422 inline
424 {
425  return IsSetName();
426 }
427 
428 inline
430 {
431  if (!CanGetName()) {
432  ThrowUnassigned(0);
433  }
434  return m_Name;
435 }
436 
437 inline
439 {
440  m_Name = value;
441  m_set_State[0] |= 0x3;
442 }
443 
444 inline
446 {
447  m_Name = std::forward<CCdd_tree_Base::TName>(value);
448  m_set_State[0] |= 0x3;
449 }
450 
451 inline
453 {
454 #ifdef _DEBUG
455  if (!IsSetName()) {
457  }
458 #endif
459  m_set_State[0] |= 0x1;
460  return m_Name;
461 }
462 
463 inline
464 bool CCdd_tree_Base::IsSetId(void) const
465 {
466  return m_Id.NotEmpty();
467 }
468 
469 inline
470 bool CCdd_tree_Base::CanGetId(void) const
471 {
472  return true;
473 }
474 
475 inline
477 {
478  if ( !m_Id ) {
479  const_cast<CCdd_tree_Base*>(this)->ResetId();
480  }
481  return (*m_Id);
482 }
483 
484 inline
486 {
487  if ( !m_Id ) {
488  ResetId();
489  }
490  return (*m_Id);
491 }
492 
493 inline
495 {
496  return m_Description.NotEmpty();
497 }
498 
499 inline
501 {
502  return IsSetDescription();
503 }
504 
505 inline
507 {
508  if (!CanGetDescription()) {
509  ThrowUnassigned(2);
510  }
511  return (*m_Description);
512 }
513 
514 inline
516 {
517  return m_Parent.NotEmpty();
518 }
519 
520 inline
522 {
523  return IsSetParent();
524 }
525 
526 inline
528 {
529  if (!CanGetParent()) {
530  ThrowUnassigned(3);
531  }
532  return (*m_Parent);
533 }
534 
535 inline
537 {
538  return m_Children.NotEmpty();
539 }
540 
541 inline
543 {
544  return IsSetChildren();
545 }
546 
547 inline
549 {
550  if (!CanGetChildren()) {
551  ThrowUnassigned(4);
552  }
553  return (*m_Children);
554 }
555 
556 inline
558 {
559  return m_Siblings.NotEmpty();
560 }
561 
562 inline
564 {
565  return IsSetSiblings();
566 }
567 
568 inline
570 {
571  if (!CanGetSiblings()) {
572  ThrowUnassigned(5);
573  }
574  return (*m_Siblings);
575 }
576 
577 inline
579 {
580  return m_Neighbors.NotEmpty();
581 }
582 
583 inline
585 {
586  return IsSetNeighbors();
587 }
588 
589 inline
591 {
592  if (!CanGetNeighbors()) {
593  ThrowUnassigned(6);
594  }
595  return (*m_Neighbors);
596 }
597 
598 ///////////////////////////////////////////////////////////
599 ////////////////// end of inline methods //////////////////
600 ///////////////////////////////////////////////////////////
601 
602 
603 
604 
605 
606 END_objects_SCOPE // namespace ncbi::objects::
607 
609 
610 
611 #endif // OBJECTS_CDD_CDD_TREE_BASE_HPP
CCdd_descr_set –.
CCdd_id_set –.
Definition: Cdd_id_set.hpp:66
CCdd_id –.
Definition: Cdd_id.hpp:66
the Cdd-tree stores the hierarchy of CDDs.
Definition: Cdd_tree_.hpp:83
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
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_CDD_EXPORT
Definition: ncbi_export.h:368
TId & SetId(void)
Assign a value to Id data member.
Definition: Cdd_tree_.hpp:485
bool IsSetName(void) const
short name copied from CD Check if a value has been assigned to Name data member.
Definition: Cdd_tree_.hpp:417
DECLARE_INTERNAL_TYPE_INFO()
const TSiblings & GetSiblings(void) const
Get the Siblings member data.
Definition: Cdd_tree_.hpp:569
bool CanGetNeighbors(void) const
Check if it is safe to call GetNeighbors method.
Definition: Cdd_tree_.hpp:584
const TId & GetId(void) const
Get the Id member data.
Definition: Cdd_tree_.hpp:476
CCdd_descr_set TDescription
Definition: Cdd_tree_.hpp:97
const TDescription & GetDescription(void) const
Get the Description member data.
Definition: Cdd_tree_.hpp:506
bool CanGetId(void) const
Check if it is safe to call GetId method.
Definition: Cdd_tree_.hpp:470
CCdd_id TParent
Definition: Cdd_tree_.hpp:98
bool IsSetParent(void) const
CD is the result of a split/merge Check if a value has been assigned to Parent data member.
Definition: Cdd_tree_.hpp:515
CCdd_id_set TChildren
Definition: Cdd_tree_.hpp:99
CCdd_tree_Base & operator=(const CCdd_tree_Base &)
bool CanGetParent(void) const
Check if it is safe to call GetParent method.
Definition: Cdd_tree_.hpp:521
CRef< TSiblings > m_Siblings
Definition: Cdd_tree_.hpp:403
CCdd_id_set TSiblings
Definition: Cdd_tree_.hpp:100
bool IsSetId(void) const
IDs copied from CD Check if a value has been assigned to Id data member.
Definition: Cdd_tree_.hpp:464
bool IsSetSiblings(void) const
related CDs (have common hits) Check if a value has been assigned to Siblings data member.
Definition: Cdd_tree_.hpp:557
bool CanGetName(void) const
Check if it is safe to call GetName method.
Definition: Cdd_tree_.hpp:423
bool CanGetSiblings(void) const
Check if it is safe to call GetSiblings method.
Definition: Cdd_tree_.hpp:563
const TParent & GetParent(void) const
Get the Parent member data.
Definition: Cdd_tree_.hpp:527
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
Definition: Cdd_tree_.hpp:114
bool IsSetNeighbors(void) const
co-occurring CDs (non-overlapping hits to same sequences) Check if a value has been assigned to Neigh...
Definition: Cdd_tree_.hpp:578
const TNeighbors & GetNeighbors(void) const
Get the Neighbors member data.
Definition: Cdd_tree_.hpp:590
CCdd_id_set TId
Definition: Cdd_tree_.hpp:96
bool CanGetChildren(void) const
Check if it is safe to call GetChildren method.
Definition: Cdd_tree_.hpp:542
bool IsSetDescription(void) const
description copied from CD Check if a value has been assigned to Description data member.
Definition: Cdd_tree_.hpp:494
CCdd_id_set TNeighbors
Definition: Cdd_tree_.hpp:101
CRef< TNeighbors > m_Neighbors
Definition: Cdd_tree_.hpp:404
CCdd_tree_Base(const CCdd_tree_Base &)
const TChildren & GetChildren(void) const
Get the Children member data.
Definition: Cdd_tree_.hpp:548
TName & SetName(void)
Assign a value to Name data member.
Definition: Cdd_tree_.hpp:452
CRef< TChildren > m_Children
Definition: Cdd_tree_.hpp:402
CRef< TDescription > m_Description
Definition: Cdd_tree_.hpp:400
bool IsSetChildren(void) const
this CD has been split Check if a value has been assigned to Children data member.
Definition: Cdd_tree_.hpp:536
CRef< TParent > m_Parent
Definition: Cdd_tree_.hpp:401
bool CanGetDescription(void) const
Check if it is safe to call GetDescription method.
Definition: Cdd_tree_.hpp:500
const TName & GetName(void) const
Get the Name member data.
Definition: Cdd_tree_.hpp:429
void ResetId(void)
Reset Id data member.
Definition: Cdd_tree_.cpp:59
CRef< TId > m_Id
Definition: Cdd_tree_.hpp:399
Uint4 m_set_State[1]
Definition: Cdd_tree_.hpp:397
CSerialObject Tparent
Definition: Cdd_tree_.hpp:84
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:03:20 2024 by modify_doxy.py rev. 669887