NCBI C++ ToolKit
Domain_parent_.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 Domain_parent_.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_DOMAIN_PARENT_BASE_HPP
42 #define OBJECTS_CDD_DOMAIN_PARENT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // forward declarations
56 class CCdd_id;
57 class CSeq_annot;
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_Cdd
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 /// the Domain-parent records an evolutionary relationship which may not be
70 /// as simple as a classical parent-child relationship in a typical hierarchy,
71 /// i.e. where a CD is merely a specific subgroup ("child") of a more general
72 /// diverse alignment model ("parent"). A CD alignment model may be the result
73 /// of an ancient fusion event, combining two or more domains into a bigger unit
74 /// which has subsequently undergone a divergent evolutionary process similar to
75 /// what may have happened to a single "domain". A CD alignment model may
76 /// also reflect the result of a deletion event, where a specific subgroup
77 /// lacks part of a (set of) domain(s), but where the part present is found to
78 /// be highly similar to a putative "parent", with some added evidence for
79 /// an actual deletion, like from the distribution of truncated copies in phylogenetic
80 /// lineages. Deletion events which affect different parts of a set of
81 /// duplicated domain architectures may be indistinguishable from actual
82 /// fission events, which means that we may want to represent the latter as
83 /// deletions after duplication and do not need a special case for fissions.
84 ///
85 /// CDomain_parent_Base --
86 ///
87 
89 {
91 public:
92  // constructor
93  CDomain_parent_Base(void);
94  // destructor
95  virtual ~CDomain_parent_Base(void);
96 
97  // type info
99 
101  eParent_type_classical = 0, ///< the classification of parent child relations
102  eParent_type_fusion = 1,
103  eParent_type_deletion = 2,
104  eParent_type_permutation = 3,
105  eParent_type_other = 255
106  };
107 
108  /// Access to EParent_type's attributes (values, names) as defined in spec
109  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EParent_type)(void);
110 
111  // types
112  typedef int TParent_type;
115 
116  // member index
117  enum class E_memberIndex {
118  e__allMandatory = 0,
119  e_parent_type,
120  e_parentid,
121  e_seqannot
122  };
124 
125  // getters
126  // setters
127 
128  /// Check if a value has been assigned to Parent_type data member.
129  ///
130  /// Data member Parent_type is mandatory;
131  /// its type is defined as 'typedef int TParent_type'
132  /// @return
133  /// - true, if a value has been assigned.
134  /// - false, otherwise.
135  bool IsSetParent_type(void) const;
136 
137  /// Check if it is safe to call GetParent_type method.
138  ///
139  /// @return
140  /// - true, if the data member is getatable.
141  /// - false, otherwise.
142  bool CanGetParent_type(void) const;
143 
144  /// Reset Parent_type data member.
145  void ResetParent_type(void);
146 
147  /// Get the Parent_type member data.
148  ///
149  /// @return
150  /// Copy of the member data.
151  TParent_type GetParent_type(void) const;
152 
153  /// Assign a value to Parent_type data member.
154  ///
155  /// @param value
156  /// Value to assign
157  void SetParent_type(TParent_type value);
158 
159  /// Assign a value to Parent_type data member.
160  ///
161  /// @return
162  /// Reference to the data value.
163  TParent_type& SetParent_type(void);
164 
165  /// identify the section parent by accession
166  /// Check if a value has been assigned to Parentid data member.
167  ///
168  /// Data member Parentid is mandatory;
169  /// its type is defined as 'typedef CCdd_id TParentid'
170  /// @return
171  /// - true, if a value has been assigned.
172  /// - false, otherwise.
173  bool IsSetParentid(void) const;
174 
175  /// Check if it is safe to call GetParentid method.
176  ///
177  /// @return
178  /// - true, if the data member is getatable.
179  /// - false, otherwise.
180  bool CanGetParentid(void) const;
181 
182  /// Reset Parentid data member.
183  void ResetParentid(void);
184 
185  /// Get the Parentid member data.
186  ///
187  /// @return
188  /// Reference to the member data.
189  const TParentid& GetParentid(void) const;
190 
191  /// Assign a value to Parentid data member.
192  ///
193  /// @param value
194  /// Reference to value.
195  void SetParentid(TParentid& value);
196 
197  /// Assign a value to Parentid data member.
198  ///
199  /// @return
200  /// Reference to the data value.
201  TParentid& SetParentid(void);
202 
203  /// contains the sequence alignment linking
204  /// CD alignment models, should align the
205  /// masters/representatives of each CD
206  /// Check if a value has been assigned to Seqannot data member.
207  ///
208  /// Data member Seqannot is optional;
209  /// its type is defined as 'typedef CSeq_annot TSeqannot'
210  /// @return
211  /// - true, if a value has been assigned.
212  /// - false, otherwise.
213  bool IsSetSeqannot(void) const;
214 
215  /// Check if it is safe to call GetSeqannot method.
216  ///
217  /// @return
218  /// - true, if the data member is getatable.
219  /// - false, otherwise.
220  bool CanGetSeqannot(void) const;
221 
222  /// Reset Seqannot data member.
223  void ResetSeqannot(void);
224 
225  /// Get the Seqannot member data.
226  ///
227  /// @return
228  /// Reference to the member data.
229  const TSeqannot& GetSeqannot(void) const;
230 
231  /// Assign a value to Seqannot data member.
232  ///
233  /// @param value
234  /// Reference to value.
235  void SetSeqannot(TSeqannot& value);
236 
237  /// Assign a value to Seqannot data member.
238  ///
239  /// @return
240  /// Reference to the data value.
241  TSeqannot& SetSeqannot(void);
242 
243  /// Reset the whole object
244  virtual void Reset(void);
245 
246 
247 private:
248  // Prohibit copy constructor and assignment operator
251 
252  // data
253  Uint4 m_set_State[1];
257 };
258 
259 /* @} */
260 
261 
262 
263 
264 
265 ///////////////////////////////////////////////////////////
266 ///////////////////// inline methods //////////////////////
267 ///////////////////////////////////////////////////////////
268 inline
270 {
271  return ((m_set_State[0] & 0x3) != 0);
272 }
273 
274 inline
276 {
277  return IsSetParent_type();
278 }
279 
280 inline
282 {
284  m_set_State[0] &= ~0x3;
285 }
286 
287 inline
289 {
290  if (!CanGetParent_type()) {
291  ThrowUnassigned(0);
292  }
293  return m_Parent_type;
294 }
295 
296 inline
298 {
300  m_set_State[0] |= 0x3;
301 }
302 
303 inline
305 {
306 #ifdef _DEBUG
307  if (!IsSetParent_type()) {
308  memset(&m_Parent_type,UnassignedByte(),sizeof(m_Parent_type));
309  }
310 #endif
311  m_set_State[0] |= 0x1;
312  return m_Parent_type;
313 }
314 
315 inline
317 {
318  return m_Parentid.NotEmpty();
319 }
320 
321 inline
323 {
324  return true;
325 }
326 
327 inline
329 {
330  if ( !m_Parentid ) {
331  const_cast<CDomain_parent_Base*>(this)->ResetParentid();
332  }
333  return (*m_Parentid);
334 }
335 
336 inline
338 {
339  if ( !m_Parentid ) {
340  ResetParentid();
341  }
342  return (*m_Parentid);
343 }
344 
345 inline
347 {
348  return m_Seqannot.NotEmpty();
349 }
350 
351 inline
353 {
354  return IsSetSeqannot();
355 }
356 
357 inline
359 {
360  if (!CanGetSeqannot()) {
361  ThrowUnassigned(2);
362  }
363  return (*m_Seqannot);
364 }
365 
366 ///////////////////////////////////////////////////////////
367 ////////////////// end of inline methods //////////////////
368 ///////////////////////////////////////////////////////////
369 
370 
371 
372 
373 
374 END_objects_SCOPE // namespace ncbi::objects::
375 
377 
378 
379 #endif // OBJECTS_CDD_DOMAIN_PARENT_BASE_HPP
CCdd_id –.
Definition: Cdd_id.hpp:66
the Domain-parent records an evolutionary relationship which may not be as simple as a classical pare...
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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
void ResetParent_type(void)
Reset Parent_type data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool IsSetParent_type(void) const
Check if a value has been assigned to Parent_type data member.
CDomain_parent_Base & operator=(const CDomain_parent_Base &)
CRef< TSeqannot > m_Seqannot
const TSeqannot & GetSeqannot(void) const
Get the Seqannot member data.
CSerialObject Tparent
bool CanGetParentid(void) const
Check if it is safe to call GetParentid method.
bool CanGetParent_type(void) const
Check if it is safe to call GetParent_type method.
TParent_type GetParent_type(void) const
Get the Parent_type member data.
bool IsSetSeqannot(void) const
contains the sequence alignment linking CD alignment models, should align the masters/representatives...
TParentid & SetParentid(void)
Assign a value to Parentid data member.
CRef< TParentid > m_Parentid
const TParentid & GetParentid(void) const
Get the Parentid member data.
bool IsSetParentid(void) const
identify the section parent by accession Check if a value has been assigned to Parentid data member.
bool CanGetSeqannot(void) const
Check if it is safe to call GetSeqannot method.
CDomain_parent_Base(const CDomain_parent_Base &)
void ResetParentid(void)
Reset Parentid data member.
TParent_type & SetParent_type(void)
Assign a value to Parent_type data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Thu Apr 25 08:19:13 2024 by modify_doxy.py rev. 669887