NCBI C++ ToolKit
Bioseq_.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 Bioseq_.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/seq/seq.asn">seq.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seq/seq.def">seq.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_SEQ_BIOSEQ_BASE_HPP
42 #define OBJECTS_SEQ_BIOSEQ_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 CSeq_annot;
61 class CSeq_descr;
62 class CSeq_id;
63 class CSeq_inst;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Sequence
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///*** Sequence ********************************
76 ///*
77 ///
78 /// CBioseq_Base --
79 ///
80 
82 {
84 public:
85  // constructor
86  CBioseq_Base(void);
87  // destructor
88  virtual ~CBioseq_Base(void);
89 
90  // type info
92 
93  // types
94  typedef list< CRef< CSeq_id > > TId;
95  typedef CSeq_descr TDescr;
96  typedef CSeq_inst TInst;
97  typedef list< CRef< CSeq_annot > > TAnnot;
98 
99  // member index
100  enum class E_memberIndex {
101  e__allMandatory = 0,
102  e_id,
103  e_descr,
104  e_inst,
105  e_annot
106  };
108 
109  // getters
110  // setters
111 
112  /// equivalent identifiers
113  /// Check if a value has been assigned to Id data member.
114  ///
115  /// Data member Id is mandatory;
116  /// its type is defined as 'typedef list< CRef< CSeq_id > > TId'
117  /// @return
118  /// - true, if a value has been assigned.
119  /// - false, otherwise.
120  bool IsSetId(void) const;
121 
122  /// Check if it is safe to call GetId method.
123  ///
124  /// @return
125  /// - true, if the data member is getatable.
126  /// - false, otherwise.
127  bool CanGetId(void) const;
128 
129  /// Reset Id data member.
130  void ResetId(void);
131 
132  /// Get the Id member data.
133  ///
134  /// @return
135  /// Reference to the member data.
136  const TId& GetId(void) const;
137 
138  /// Assign a value to Id data member.
139  ///
140  /// @return
141  /// Reference to the data value.
142  TId& SetId(void);
143 
144  /// descriptors
145  /// Check if a value has been assigned to Descr data member.
146  ///
147  /// Data member Descr is optional;
148  /// its type is defined as 'typedef CSeq_descr TDescr'
149  /// @return
150  /// - true, if a value has been assigned.
151  /// - false, otherwise.
152  bool IsSetDescr(void) const;
153 
154  /// Check if it is safe to call GetDescr method.
155  ///
156  /// @return
157  /// - true, if the data member is getatable.
158  /// - false, otherwise.
159  bool CanGetDescr(void) const;
160 
161  /// Reset Descr data member.
162  void ResetDescr(void);
163 
164  /// Get the Descr member data.
165  ///
166  /// @return
167  /// Reference to the member data.
168  const TDescr& GetDescr(void) const;
169 
170  /// Assign a value to Descr data member.
171  ///
172  /// @param value
173  /// Reference to value.
174  void SetDescr(TDescr& value);
175 
176  /// Assign a value to Descr data member.
177  ///
178  /// @return
179  /// Reference to the data value.
180  TDescr& SetDescr(void);
181 
182  /// the sequence data
183  /// Check if a value has been assigned to Inst data member.
184  ///
185  /// Data member Inst is mandatory;
186  /// its type is defined as 'typedef CSeq_inst TInst'
187  /// @return
188  /// - true, if a value has been assigned.
189  /// - false, otherwise.
190  bool IsSetInst(void) const;
191 
192  /// Check if it is safe to call GetInst method.
193  ///
194  /// @return
195  /// - true, if the data member is getatable.
196  /// - false, otherwise.
197  bool CanGetInst(void) const;
198 
199  /// Reset Inst data member.
200  void ResetInst(void);
201 
202  /// Get the Inst member data.
203  ///
204  /// @return
205  /// Reference to the member data.
206  const TInst& GetInst(void) const;
207 
208  /// Assign a value to Inst data member.
209  ///
210  /// @param value
211  /// Reference to value.
212  void SetInst(TInst& value);
213 
214  /// Assign a value to Inst data member.
215  ///
216  /// @return
217  /// Reference to the data value.
218  TInst& SetInst(void);
219 
220  /// Check if a value has been assigned to Annot data member.
221  ///
222  /// Data member Annot is optional;
223  /// its type is defined as 'typedef list< CRef< CSeq_annot > > TAnnot'
224  /// @return
225  /// - true, if a value has been assigned.
226  /// - false, otherwise.
227  bool IsSetAnnot(void) const;
228 
229  /// Check if it is safe to call GetAnnot method.
230  ///
231  /// @return
232  /// - true, if the data member is getatable.
233  /// - false, otherwise.
234  bool CanGetAnnot(void) const;
235 
236  /// Reset Annot data member.
237  void ResetAnnot(void);
238 
239  /// Get the Annot member data.
240  ///
241  /// @return
242  /// Reference to the member data.
243  const TAnnot& GetAnnot(void) const;
244 
245  /// Assign a value to Annot data member.
246  ///
247  /// @return
248  /// Reference to the data value.
249  TAnnot& SetAnnot(void);
250 
251  /// Reset the whole object
252  virtual void Reset(void);
253 
254 
255 private:
256  // Prohibit copy constructor and assignment operator
259 
260  // data
261  Uint4 m_set_State[1];
262  list< CRef< CSeq_id > > m_Id;
265  list< CRef< CSeq_annot > > m_Annot;
266 };
267 
268 /* @} */
269 
270 
271 
272 
273 
274 ///////////////////////////////////////////////////////////
275 ///////////////////// inline methods //////////////////////
276 ///////////////////////////////////////////////////////////
277 inline
278 bool CBioseq_Base::IsSetId(void) const
279 {
280  return ((m_set_State[0] & 0x3) != 0);
281 }
282 
283 inline
284 bool CBioseq_Base::CanGetId(void) const
285 {
286  return true;
287 }
288 
289 inline
291 {
292  return m_Id;
293 }
294 
295 inline
297 {
298  m_set_State[0] |= 0x1;
299  return m_Id;
300 }
301 
302 inline
303 bool CBioseq_Base::IsSetDescr(void) const
304 {
305  return m_Descr.NotEmpty();
306 }
307 
308 inline
310 {
311  return IsSetDescr();
312 }
313 
314 inline
316 {
317  if (!CanGetDescr()) {
318  ThrowUnassigned(1);
319  }
320  return (*m_Descr);
321 }
322 
323 inline
324 bool CBioseq_Base::IsSetInst(void) const
325 {
326  return m_Inst.NotEmpty();
327 }
328 
329 inline
330 bool CBioseq_Base::CanGetInst(void) const
331 {
332  return true;
333 }
334 
335 inline
337 {
338  if ( !m_Inst ) {
339  const_cast<CBioseq_Base*>(this)->ResetInst();
340  }
341  return (*m_Inst);
342 }
343 
344 inline
346 {
347  if ( !m_Inst ) {
348  ResetInst();
349  }
350  return (*m_Inst);
351 }
352 
353 inline
354 bool CBioseq_Base::IsSetAnnot(void) const
355 {
356  return ((m_set_State[0] & 0xc0) != 0);
357 }
358 
359 inline
361 {
362  return true;
363 }
364 
365 inline
367 {
368  return m_Annot;
369 }
370 
371 inline
373 {
374  m_set_State[0] |= 0x40;
375  return m_Annot;
376 }
377 
378 ///////////////////////////////////////////////////////////
379 ////////////////// end of inline methods //////////////////
380 ///////////////////////////////////////////////////////////
381 
382 
383 
384 
385 
386 END_objects_SCOPE // namespace ncbi::objects::
387 
389 
390 
391 #endif // OBJECTS_SEQ_BIOSEQ_BASE_HPP
*** Sequence ******************************** *
Definition: Bioseq_.hpp:82
CRef –.
Definition: ncbiobj.hpp:618
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
void ThrowUnassigned(TMemberIndex index) const
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_SEQ_EXPORT
Definition: ncbi_export.h:825
list< CRef< CSeq_id > > m_Id
Definition: Bioseq_.hpp:262
TId & SetId(void)
Assign a value to Id data member.
Definition: Bioseq_.hpp:296
const TInst & GetInst(void) const
Get the Inst member data.
Definition: Bioseq_.hpp:336
bool CanGetAnnot(void) const
Check if it is safe to call GetAnnot method.
Definition: Bioseq_.hpp:360
bool IsSetAnnot(void) const
Check if a value has been assigned to Annot data member.
Definition: Bioseq_.hpp:354
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
Definition: Bioseq_.hpp:372
const TAnnot & GetAnnot(void) const
Get the Annot member data.
Definition: Bioseq_.hpp:366
CRef< TDescr > m_Descr
Definition: Bioseq_.hpp:263
const TId & GetId(void) const
Get the Id member data.
Definition: Bioseq_.hpp:290
CRef< TInst > m_Inst
Definition: Bioseq_.hpp:264
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
Definition: Bioseq_.hpp:309
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
Definition: Bioseq_.hpp:324
Uint4 m_set_State[1]
Definition: Bioseq_.hpp:261
list< CRef< CSeq_id > > TId
Definition: Bioseq_.hpp:94
TInst & SetInst(void)
Assign a value to Inst data member.
Definition: Bioseq_.hpp:345
bool IsSetDescr(void) const
descriptors Check if a value has been assigned to Descr data member.
Definition: Bioseq_.hpp:303
CBioseq_Base & operator=(const CBioseq_Base &)
bool CanGetId(void) const
Check if it is safe to call GetId method.
Definition: Bioseq_.hpp:284
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Bioseq_.hpp:107
DECLARE_INTERNAL_TYPE_INFO()
CSerialObject Tparent
Definition: Bioseq_.hpp:83
list< CRef< CSeq_annot > > m_Annot
Definition: Bioseq_.hpp:265
CSeq_inst TInst
Definition: Bioseq_.hpp:96
bool IsSetId(void) const
equivalent identifiers Check if a value has been assigned to Id data member.
Definition: Bioseq_.hpp:278
list< CRef< CSeq_annot > > TAnnot
Definition: Bioseq_.hpp:97
void ResetInst(void)
Reset Inst data member.
Definition: Bioseq_.cpp:77
CBioseq_Base(const CBioseq_Base &)
const TDescr & GetDescr(void) const
Get the Descr member data.
Definition: Bioseq_.hpp:315
bool CanGetInst(void) const
Check if it is safe to call GetInst method.
Definition: Bioseq_.hpp:330
CSeq_descr TDescr
Definition: Bioseq_.hpp:95
Modified on Wed Mar 27 11:25:40 2024 by modify_doxy.py rev. 669887