NCBI C++ ToolKit
Prot_ref_.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 Prot_ref_.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/seqfeat/seqfeat.asn">seqfeat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqfeat/seqfeat.def">seqfeat.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_SEQFEAT_PROT_REF_BASE_HPP
42 #define OBJECTS_SEQFEAT_PROT_REF_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 #include <vector>
51 
53 
54 #ifndef BEGIN_objects_SCOPE
55 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
56 # define END_objects_SCOPE END_SCOPE(objects)
57 #endif
58 BEGIN_objects_SCOPE // namespace ncbi::objects::
59 
60 
61 // forward declarations
62 class CDbtag;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_Protein
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 ///*** Prot-ref ***********************************************
75 ///*
76 ///* Reference to a protein name
77 ///*
78 ///
79 /// CProt_ref_Base --
80 ///
81 
83 {
85 public:
86  // constructor
87  CProt_ref_Base(void);
88  // destructor
89  virtual ~CProt_ref_Base(void);
90 
91  // type info
93 
94  /// processing status
95  enum EProcessed {
96  eProcessed_not_set = 0,
97  eProcessed_preprotein = 1,
98  eProcessed_mature = 2,
99  eProcessed_signal_peptide = 3,
100  eProcessed_transit_peptide = 4,
101  eProcessed_propeptide = 5
102  };
103 
104  /// Access to EProcessed's attributes (values, names) as defined in spec
105  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EProcessed)(void);
106 
107  // types
108  typedef list< string > TName;
109  typedef string TDesc;
110  typedef list< string > TEc;
111  typedef list< string > TActivity;
112  typedef vector< CRef< CDbtag > > TDb;
114 
115  // member index
116  enum class E_memberIndex {
117  e__allMandatory = 0,
118  e_name,
119  e_desc,
120  e_ec,
121  e_activity,
122  e_db,
123  e_processed
124  };
126 
127  // getters
128  // setters
129 
130  /// protein name
131  /// Check if a value has been assigned to Name data member.
132  ///
133  /// Data member Name is optional;
134  /// its type is defined as 'typedef list< string > TName'
135  /// @return
136  /// - true, if a value has been assigned.
137  /// - false, otherwise.
138  bool IsSetName(void) const;
139 
140  /// Check if it is safe to call GetName method.
141  ///
142  /// @return
143  /// - true, if the data member is getatable.
144  /// - false, otherwise.
145  bool CanGetName(void) const;
146 
147  /// Reset Name data member.
148  void ResetName(void);
149 
150  /// Get the Name member data.
151  ///
152  /// @return
153  /// Reference to the member data.
154  const TName& GetName(void) const;
155 
156  /// Assign a value to Name data member.
157  ///
158  /// @return
159  /// Reference to the data value.
160  TName& SetName(void);
161 
162  /// description (instead of name)
163  /// Check if a value has been assigned to Desc data member.
164  ///
165  /// Data member Desc is optional;
166  /// its type is defined as 'typedef string TDesc'
167  /// @return
168  /// - true, if a value has been assigned.
169  /// - false, otherwise.
170  bool IsSetDesc(void) const;
171 
172  /// Check if it is safe to call GetDesc method.
173  ///
174  /// @return
175  /// - true, if the data member is getatable.
176  /// - false, otherwise.
177  bool CanGetDesc(void) const;
178 
179  /// Reset Desc data member.
180  void ResetDesc(void);
181 
182  /// Get the Desc member data.
183  ///
184  /// @return
185  /// Reference to the member data.
186  const TDesc& GetDesc(void) const;
187 
188  /// Assign a value to Desc data member.
189  ///
190  /// @param value
191  /// Value to assign
192  void SetDesc(const TDesc& value);
193  void SetDesc(TDesc&& value);
194 
195  /// Assign a value to Desc data member.
196  ///
197  /// @return
198  /// Reference to the data value.
199  TDesc& SetDesc(void);
200 
201  /// E.C. number(s)
202  /// Check if a value has been assigned to Ec data member.
203  ///
204  /// Data member Ec is optional;
205  /// its type is defined as 'typedef list< string > TEc'
206  /// @return
207  /// - true, if a value has been assigned.
208  /// - false, otherwise.
209  bool IsSetEc(void) const;
210 
211  /// Check if it is safe to call GetEc method.
212  ///
213  /// @return
214  /// - true, if the data member is getatable.
215  /// - false, otherwise.
216  bool CanGetEc(void) const;
217 
218  /// Reset Ec data member.
219  void ResetEc(void);
220 
221  /// Get the Ec member data.
222  ///
223  /// @return
224  /// Reference to the member data.
225  const TEc& GetEc(void) const;
226 
227  /// Assign a value to Ec data member.
228  ///
229  /// @return
230  /// Reference to the data value.
231  TEc& SetEc(void);
232 
233  /// activities
234  /// Check if a value has been assigned to Activity data member.
235  ///
236  /// Data member Activity is optional;
237  /// its type is defined as 'typedef list< string > TActivity'
238  /// @return
239  /// - true, if a value has been assigned.
240  /// - false, otherwise.
241  bool IsSetActivity(void) const;
242 
243  /// Check if it is safe to call GetActivity method.
244  ///
245  /// @return
246  /// - true, if the data member is getatable.
247  /// - false, otherwise.
248  bool CanGetActivity(void) const;
249 
250  /// Reset Activity data member.
251  void ResetActivity(void);
252 
253  /// Get the Activity member data.
254  ///
255  /// @return
256  /// Reference to the member data.
257  const TActivity& GetActivity(void) const;
258 
259  /// Assign a value to Activity data member.
260  ///
261  /// @return
262  /// Reference to the data value.
263  TActivity& SetActivity(void);
264 
265  /// ids in other dbases
266  /// Check if a value has been assigned to Db data member.
267  ///
268  /// Data member Db is optional;
269  /// its type is defined as 'typedef vector< CRef< CDbtag > > TDb'
270  /// @return
271  /// - true, if a value has been assigned.
272  /// - false, otherwise.
273  bool IsSetDb(void) const;
274 
275  /// Check if it is safe to call GetDb method.
276  ///
277  /// @return
278  /// - true, if the data member is getatable.
279  /// - false, otherwise.
280  bool CanGetDb(void) const;
281 
282  /// Reset Db data member.
283  void ResetDb(void);
284 
285  /// Get the Db member data.
286  ///
287  /// @return
288  /// Reference to the member data.
289  const TDb& GetDb(void) const;
290 
291  /// Assign a value to Db data member.
292  ///
293  /// @return
294  /// Reference to the data value.
295  TDb& SetDb(void);
296 
297  /// Check if a value has been assigned to Processed data member.
298  ///
299  /// Data member Processed is optional with default eProcessed_not_set;
300  /// its type is defined as 'typedef EProcessed TProcessed'
301  /// @return
302  /// - true, if a value has been assigned.
303  /// - false, otherwise.
304  bool IsSetProcessed(void) const;
305 
306  /// Check if it is safe to call GetProcessed method.
307  ///
308  /// @return
309  /// - true, if the data member is getatable.
310  /// - false, otherwise.
311  bool CanGetProcessed(void) const;
312 
313  /// Reset Processed data member.
314  void ResetProcessed(void);
315 
316  /// Assign default value to Processed data member.
317  void SetDefaultProcessed(void);
318 
319  /// Get the Processed member data.
320  ///
321  /// @return
322  /// Copy of the member data.
323  TProcessed GetProcessed(void) const;
324 
325  /// Assign a value to Processed data member.
326  ///
327  /// @param value
328  /// Value to assign
329  void SetProcessed(TProcessed value);
330 
331  /// Assign a value to Processed data member.
332  ///
333  /// @return
334  /// Reference to the data value.
335  TProcessed& SetProcessed(void);
336 
337  /// Reset the whole object
338  virtual void Reset(void);
339 
340 
341 private:
342  // Prohibit copy constructor and assignment operator
345 
346  // data
347  Uint4 m_set_State[1];
348  list< string > m_Name;
349  string m_Desc;
350  list< string > m_Ec;
351  list< string > m_Activity;
352  vector< CRef< CDbtag > > m_Db;
354 };
355 
356 /* @} */
357 
358 
359 
360 
361 
362 ///////////////////////////////////////////////////////////
363 ///////////////////// inline methods //////////////////////
364 ///////////////////////////////////////////////////////////
365 inline
367 {
368  return ((m_set_State[0] & 0x3) != 0);
369 }
370 
371 inline
373 {
374  return true;
375 }
376 
377 inline
379 {
380  return m_Name;
381 }
382 
383 inline
385 {
386  m_set_State[0] |= 0x1;
387  return m_Name;
388 }
389 
390 inline
392 {
393  return ((m_set_State[0] & 0xc) != 0);
394 }
395 
396 inline
398 {
399  return IsSetDesc();
400 }
401 
402 inline
404 {
405  if (!CanGetDesc()) {
406  ThrowUnassigned(1);
407  }
408  return m_Desc;
409 }
410 
411 inline
413 {
414  m_Desc = value;
415  m_set_State[0] |= 0xc;
416 }
417 
418 inline
420 {
421  m_Desc = std::forward<CProt_ref_Base::TDesc>(value);
422  m_set_State[0] |= 0xc;
423 }
424 
425 inline
427 {
428 #ifdef _DEBUG
429  if (!IsSetDesc()) {
431  }
432 #endif
433  m_set_State[0] |= 0x4;
434  return m_Desc;
435 }
436 
437 inline
438 bool CProt_ref_Base::IsSetEc(void) const
439 {
440  return ((m_set_State[0] & 0x30) != 0);
441 }
442 
443 inline
444 bool CProt_ref_Base::CanGetEc(void) const
445 {
446  return true;
447 }
448 
449 inline
451 {
452  return m_Ec;
453 }
454 
455 inline
457 {
458  m_set_State[0] |= 0x10;
459  return m_Ec;
460 }
461 
462 inline
464 {
465  return ((m_set_State[0] & 0xc0) != 0);
466 }
467 
468 inline
470 {
471  return true;
472 }
473 
474 inline
476 {
477  return m_Activity;
478 }
479 
480 inline
482 {
483  m_set_State[0] |= 0x40;
484  return m_Activity;
485 }
486 
487 inline
488 bool CProt_ref_Base::IsSetDb(void) const
489 {
490  return ((m_set_State[0] & 0x300) != 0);
491 }
492 
493 inline
494 bool CProt_ref_Base::CanGetDb(void) const
495 {
496  return true;
497 }
498 
499 inline
501 {
502  return m_Db;
503 }
504 
505 inline
507 {
508  m_set_State[0] |= 0x100;
509  return m_Db;
510 }
511 
512 inline
514 {
515  return ((m_set_State[0] & 0xc00) != 0);
516 }
517 
518 inline
520 {
521  return true;
522 }
523 
524 inline
526 {
528  m_set_State[0] &= ~0xc00;
529 }
530 
531 inline
533 {
534  ResetProcessed();
535 }
536 
537 inline
539 {
540  return m_Processed;
541 }
542 
543 inline
545 {
546  m_Processed = value;
547  m_set_State[0] |= 0xc00;
548 }
549 
550 inline
552 {
553 #ifdef _DEBUG
554  if (!IsSetProcessed()) {
555  memset(&m_Processed,UnassignedByte(),sizeof(m_Processed));
556  }
557 #endif
558  m_set_State[0] |= 0x400;
559  return m_Processed;
560 }
561 
562 ///////////////////////////////////////////////////////////
563 ////////////////// end of inline methods //////////////////
564 ///////////////////////////////////////////////////////////
565 
566 
567 
568 
569 
570 END_objects_SCOPE // namespace ncbi::objects::
571 
573 
574 
575 #endif // OBJECTS_SEQFEAT_PROT_REF_BASE_HPP
Definition: Dbtag.hpp:53
*** Prot-ref *********************************************** * * Reference to a protein name *
Definition: Prot_ref_.hpp:83
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
static string UnassignedString(void)
Definition: serialbase.hpp:175
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_SEQFEAT_EXPORT
Definition: ncbi_export.h:768
TActivity & SetActivity(void)
Assign a value to Activity data member.
Definition: Prot_ref_.hpp:481
DECLARE_INTERNAL_TYPE_INFO()
bool IsSetDesc(void) const
description (instead of name) Check if a value has been assigned to Desc data member.
Definition: Prot_ref_.hpp:391
const TDb & GetDb(void) const
Get the Db member data.
Definition: Prot_ref_.hpp:500
EProcessed
processing status
Definition: Prot_ref_.hpp:95
vector< CRef< CDbtag > > TDb
Definition: Prot_ref_.hpp:112
vector< CRef< CDbtag > > m_Db
Definition: Prot_ref_.hpp:352
CProt_ref_Base(const CProt_ref_Base &)
bool CanGetActivity(void) const
Check if it is safe to call GetActivity method.
Definition: Prot_ref_.hpp:469
list< string > TName
Definition: Prot_ref_.hpp:108
const TActivity & GetActivity(void) const
Get the Activity member data.
Definition: Prot_ref_.hpp:475
list< string > m_Activity
Definition: Prot_ref_.hpp:351
bool CanGetProcessed(void) const
Check if it is safe to call GetProcessed method.
Definition: Prot_ref_.hpp:519
CProt_ref_Base & operator=(const CProt_ref_Base &)
void ResetProcessed(void)
Reset Processed data member.
Definition: Prot_ref_.hpp:525
TEc & SetEc(void)
Assign a value to Ec data member.
Definition: Prot_ref_.hpp:456
TProcessed & SetProcessed(void)
Assign a value to Processed data member.
Definition: Prot_ref_.hpp:551
TDesc & SetDesc(void)
Assign a value to Desc data member.
Definition: Prot_ref_.hpp:426
list< string > m_Name
Definition: Prot_ref_.hpp:348
EProcessed TProcessed
Definition: Prot_ref_.hpp:113
list< string > TActivity
Definition: Prot_ref_.hpp:111
EProcessed m_Processed
Definition: Prot_ref_.hpp:353
const TName & GetName(void) const
Get the Name member data.
Definition: Prot_ref_.hpp:378
bool IsSetDb(void) const
ids in other dbases Check if a value has been assigned to Db data member.
Definition: Prot_ref_.hpp:488
bool IsSetEc(void) const
E.C.
Definition: Prot_ref_.hpp:438
list< string > m_Ec
Definition: Prot_ref_.hpp:350
list< string > TEc
Definition: Prot_ref_.hpp:110
bool CanGetDb(void) const
Check if it is safe to call GetDb method.
Definition: Prot_ref_.hpp:494
CSerialObject Tparent
Definition: Prot_ref_.hpp:84
TProcessed GetProcessed(void) const
Get the Processed member data.
Definition: Prot_ref_.hpp:538
bool IsSetProcessed(void) const
Check if a value has been assigned to Processed data member.
Definition: Prot_ref_.hpp:513
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
Definition: Prot_ref_.hpp:366
bool CanGetEc(void) const
Check if it is safe to call GetEc method.
Definition: Prot_ref_.hpp:444
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
Definition: Prot_ref_.hpp:125
bool CanGetName(void) const
Check if it is safe to call GetName method.
Definition: Prot_ref_.hpp:372
void SetDefaultProcessed(void)
Assign default value to Processed data member.
Definition: Prot_ref_.hpp:532
const TDesc & GetDesc(void) const
Get the Desc member data.
Definition: Prot_ref_.hpp:403
bool IsSetActivity(void) const
activities Check if a value has been assigned to Activity data member.
Definition: Prot_ref_.hpp:463
Uint4 m_set_State[1]
Definition: Prot_ref_.hpp:347
const TEc & GetEc(void) const
Get the Ec member data.
Definition: Prot_ref_.hpp:450
TDb & SetDb(void)
Assign a value to Db data member.
Definition: Prot_ref_.hpp:506
bool CanGetDesc(void) const
Check if it is safe to call GetDesc method.
Definition: Prot_ref_.hpp:397
TName & SetName(void)
Assign a value to Name data member.
Definition: Prot_ref_.hpp:384
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:26 2024 by modify_doxy.py rev. 669887