NCBI C++ ToolKit
Sample_enzyme_.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 Sample_enzyme_.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/algo/ms/formats/pepxml/pepXML.xsd">pepXML.xsd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/algo/ms/formats/pepxml/pepXML.def">pepXML.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 ALGO_MS_FORMATS_PEPXML_SAMPLE_ENZYME_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_SAMPLE_ENZYME_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CSpecificity;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_pepXML
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///Defines the net cleavage specificity of an enzyme, chemical reagent, or a mixture of these, for mass spectrometry purposes
74 ///
75 /// CSample_enzyme_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CSample_enzyme_Base(void);
84  // destructor
85  virtual ~CSample_enzyme_Base(void);
86 
87  // type info
89 
90  /////////////////////////////////////////////////////////////////////////////
91  ///
92  /// C_Attlist --
93  ///
94 
96  {
98  public:
99  // constructor
100  C_Attlist(void);
101  // destructor
102  ~C_Attlist(void);
103 
104  // type info
106 
108  eAttlist_fidelity_specific = 1,
109  eAttlist_fidelity_semispecific = 2,
110  eAttlist_fidelity_nonspecific = 3
111  };
112 
113  /// Access to EAttlist_fidelity's attributes (values, names) as defined in spec
114  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAttlist_fidelity)(void);
115 
116  // types
117  typedef string TName;
118  typedef string TDescription;
120  typedef bool TIndependent;
121 
122  // member index
123  enum class E_memberIndex {
124  e__allMandatory = 0,
125  e_name,
126  e_description,
127  e_fidelity,
128  e_independent
129  };
131 
132  // getters
133  // setters
134 
135  /// Check if a value has been assigned to Name data member.
136  ///
137  /// Data member Name is mandatory;
138  /// its type is defined as 'typedef string TName'
139  /// @return
140  /// - true, if a value has been assigned.
141  /// - false, otherwise.
142  bool IsSetName(void) const;
143 
144  /// Check if it is safe to call GetName method.
145  ///
146  /// @return
147  /// - true, if the data member is getatable.
148  /// - false, otherwise.
149  bool CanGetName(void) const;
150 
151  /// Reset Name data member.
152  void ResetName(void);
153 
154  /// Get the Name member data.
155  ///
156  /// @return
157  /// Reference to the member data.
158  const TName& GetName(void) const;
159 
160  /// Assign a value to Name data member.
161  ///
162  /// @param value
163  /// Value to assign
164  void SetName(const TName& value);
165  void SetName(TName&& value);
166 
167  /// Assign a value to Name data member.
168  ///
169  /// @return
170  /// Reference to the data value.
171  TName& SetName(void);
172 
173  /// Check if a value has been assigned to Description data member.
174  ///
175  /// Data member Description is optional;
176  /// its type is defined as 'typedef string TDescription'
177  /// @return
178  /// - true, if a value has been assigned.
179  /// - false, otherwise.
180  bool IsSetDescription(void) const;
181 
182  /// Check if it is safe to call GetDescription method.
183  ///
184  /// @return
185  /// - true, if the data member is getatable.
186  /// - false, otherwise.
187  bool CanGetDescription(void) const;
188 
189  /// Reset Description data member.
190  void ResetDescription(void);
191 
192  /// Get the Description member data.
193  ///
194  /// @return
195  /// Reference to the member data.
196  const TDescription& GetDescription(void) const;
197 
198  /// Assign a value to Description data member.
199  ///
200  /// @param value
201  /// Value to assign
202  void SetDescription(const TDescription& value);
203  void SetDescription(TDescription&& value);
204 
205  /// Assign a value to Description data member.
206  ///
207  /// @return
208  /// Reference to the data value.
209  TDescription& SetDescription(void);
210 
211  /// Check if a value has been assigned to Fidelity data member.
212  ///
213  /// Data member Fidelity is optional with default eAttlist_fidelity_specific;
214  /// its type is defined as 'typedef EAttlist_fidelity TFidelity'
215  /// @return
216  /// - true, if a value has been assigned.
217  /// - false, otherwise.
218  bool IsSetFidelity(void) const;
219 
220  /// Check if it is safe to call GetFidelity method.
221  ///
222  /// @return
223  /// - true, if the data member is getatable.
224  /// - false, otherwise.
225  bool CanGetFidelity(void) const;
226 
227  /// Reset Fidelity data member.
228  void ResetFidelity(void);
229 
230  /// Assign default value to Fidelity data member.
231  void SetDefaultFidelity(void);
232 
233  /// Get the Fidelity member data.
234  ///
235  /// @return
236  /// Copy of the member data.
237  TFidelity GetFidelity(void) const;
238 
239  /// Assign a value to Fidelity data member.
240  ///
241  /// @param value
242  /// Value to assign
243  void SetFidelity(TFidelity value);
244 
245  /// Assign a value to Fidelity data member.
246  ///
247  /// @return
248  /// Reference to the data value.
249  TFidelity& SetFidelity(void);
250 
251  /// Check if a value has been assigned to Independent data member.
252  ///
253  /// Data member Independent is optional;
254  /// its type is defined as 'typedef bool TIndependent'
255  /// @return
256  /// - true, if a value has been assigned.
257  /// - false, otherwise.
258  bool IsSetIndependent(void) const;
259 
260  /// Check if it is safe to call GetIndependent method.
261  ///
262  /// @return
263  /// - true, if the data member is getatable.
264  /// - false, otherwise.
265  bool CanGetIndependent(void) const;
266 
267  /// Reset Independent data member.
268  void ResetIndependent(void);
269 
270  /// Get the Independent member data.
271  ///
272  /// @return
273  /// Copy of the member data.
274  TIndependent GetIndependent(void) const;
275 
276  /// Assign a value to Independent data member.
277  ///
278  /// @param value
279  /// Value to assign
280  void SetIndependent(TIndependent value);
281 
282  /// Assign a value to Independent data member.
283  ///
284  /// @return
285  /// Reference to the data value.
286  TIndependent& SetIndependent(void);
287 
288  /// Reset the whole object
289  void Reset(void);
290 
291 
292  private:
293  // Prohibit copy constructor and assignment operator
296 
297  // data
298  Uint4 m_set_State[1];
299  string m_Name;
303  };
304  // types
306  typedef list< CRef< CSpecificity > > TSpecificity;
307 
308  // member index
309  enum class E_memberIndex {
310  e__allMandatory = 0,
311  e_Attlist,
312  e_specificity
313  };
315 
316  // getters
317  // setters
318 
319  /// Check if a value has been assigned to Attlist data member.
320  ///
321  /// Data member Attlist is mandatory;
322  /// its type is defined as 'typedef C_Attlist TAttlist'
323  /// @return
324  /// - true, if a value has been assigned.
325  /// - false, otherwise.
326  bool IsSetAttlist(void) const;
327 
328  /// Check if it is safe to call GetAttlist method.
329  ///
330  /// @return
331  /// - true, if the data member is getatable.
332  /// - false, otherwise.
333  bool CanGetAttlist(void) const;
334 
335  /// Reset Attlist data member.
336  void ResetAttlist(void);
337 
338  /// Get the Attlist member data.
339  ///
340  /// @return
341  /// Reference to the member data.
342  const TAttlist& GetAttlist(void) const;
343 
344  /// Assign a value to Attlist data member.
345  ///
346  /// @param value
347  /// Reference to value.
348  void SetAttlist(TAttlist& value);
349 
350  /// Assign a value to Attlist data member.
351  ///
352  /// @return
353  /// Reference to the data value.
354  TAttlist& SetAttlist(void);
355 
356  /// Check if a value has been assigned to Specificity data member.
357  ///
358  /// Data member Specificity is optional;
359  /// its type is defined as 'typedef list< CRef< CSpecificity > > TSpecificity'
360  /// @return
361  /// - true, if a value has been assigned.
362  /// - false, otherwise.
363  bool IsSetSpecificity(void) const;
364 
365  /// Check if it is safe to call GetSpecificity method.
366  ///
367  /// @return
368  /// - true, if the data member is getatable.
369  /// - false, otherwise.
370  bool CanGetSpecificity(void) const;
371 
372  /// Reset Specificity data member.
373  void ResetSpecificity(void);
374 
375  /// Get the Specificity member data.
376  ///
377  /// @return
378  /// Reference to the member data.
379  const TSpecificity& GetSpecificity(void) const;
380 
381  /// Assign a value to Specificity data member.
382  ///
383  /// @return
384  /// Reference to the data value.
385  TSpecificity& SetSpecificity(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];
399  list< CRef< CSpecificity > > m_Specificity;
400 };
401 
402 /* @} */
403 
404 
405 
406 
407 
408 ///////////////////////////////////////////////////////////
409 ///////////////////// inline methods //////////////////////
410 ///////////////////////////////////////////////////////////
411 inline
413 {
414  return ((m_set_State[0] & 0x3) != 0);
415 }
416 
417 inline
419 {
420  return IsSetName();
421 }
422 
423 inline
425 {
426  if (!CanGetName()) {
427  ThrowUnassigned(0);
428  }
429  return m_Name;
430 }
431 
432 inline
434 {
435  m_Name = value;
436  m_set_State[0] |= 0x3;
437 }
438 
439 inline
441 {
442  m_Name = std::forward<CSample_enzyme_Base::C_Attlist::TName>(value);
443  m_set_State[0] |= 0x3;
444 }
445 
446 inline
448 {
449 #ifdef _DEBUG
450  if (!IsSetName()) {
451  m_Name = UnassignedString();
452  }
453 #endif
454  m_set_State[0] |= 0x1;
455  return m_Name;
456 }
457 
458 inline
460 {
461  return ((m_set_State[0] & 0xc) != 0);
462 }
463 
464 inline
466 {
467  return IsSetDescription();
468 }
469 
470 inline
472 {
473  if (!CanGetDescription()) {
474  ThrowUnassigned(1);
475  }
476  return m_Description;
477 }
478 
479 inline
481 {
482  m_Description = value;
483  m_set_State[0] |= 0xc;
484 }
485 
486 inline
488 {
489  m_Description = std::forward<CSample_enzyme_Base::C_Attlist::TDescription>(value);
490  m_set_State[0] |= 0xc;
491 }
492 
493 inline
495 {
496 #ifdef _DEBUG
497  if (!IsSetDescription()) {
498  m_Description = UnassignedString();
499  }
500 #endif
501  m_set_State[0] |= 0x4;
502  return m_Description;
503 }
504 
505 inline
507 {
508  return ((m_set_State[0] & 0x30) != 0);
509 }
510 
511 inline
513 {
514  return true;
515 }
516 
517 inline
519 {
520  m_Fidelity = eAttlist_fidelity_specific;
521  m_set_State[0] &= ~0x30;
522 }
523 
524 inline
526 {
527  ResetFidelity();
528  m_set_State[0] |= 0x10;
529 }
530 
531 inline
533 {
534  return m_Fidelity;
535 }
536 
537 inline
539 {
540  m_Fidelity = value;
541  m_set_State[0] |= 0x30;
542 }
543 
544 inline
546 {
547 #ifdef _DEBUG
548  if (!IsSetFidelity()) {
549  memset(&m_Fidelity,UnassignedByte(),sizeof(m_Fidelity));
550  }
551 #endif
552  m_set_State[0] |= 0x10;
553  return m_Fidelity;
554 }
555 
556 inline
558 {
559  return ((m_set_State[0] & 0xc0) != 0);
560 }
561 
562 inline
564 {
565  return IsSetIndependent();
566 }
567 
568 inline
570 {
571  m_Independent = 0;
572  m_set_State[0] &= ~0xc0;
573 }
574 
575 inline
577 {
578  if (!CanGetIndependent()) {
579  ThrowUnassigned(3);
580  }
581  return m_Independent;
582 }
583 
584 inline
586 {
587  m_Independent = value;
588  m_set_State[0] |= 0xc0;
589 }
590 
591 inline
593 {
594 #ifdef _DEBUG
595  if (!IsSetIndependent()) {
596  memset(&m_Independent,UnassignedByte(),sizeof(m_Independent));
597  }
598 #endif
599  m_set_State[0] |= 0x40;
600  return m_Independent;
601 }
602 
603 inline
605 {
606  return m_Attlist.NotEmpty();
607 }
608 
609 inline
611 {
612  return true;
613 }
614 
615 inline
617 {
618  if ( !m_Attlist ) {
619  const_cast<CSample_enzyme_Base*>(this)->ResetAttlist();
620  }
621  return (*m_Attlist);
622 }
623 
624 inline
626 {
627  if ( !m_Attlist ) {
628  ResetAttlist();
629  }
630  return (*m_Attlist);
631 }
632 
633 inline
635 {
636  return ((m_set_State[0] & 0xc) != 0);
637 }
638 
639 inline
641 {
642  return true;
643 }
644 
645 inline
647 {
648  return m_Specificity;
649 }
650 
651 inline
653 {
654  m_set_State[0] |= 0x4;
655  return m_Specificity;
656 }
657 
658 ///////////////////////////////////////////////////////////
659 ////////////////// end of inline methods //////////////////
660 ///////////////////////////////////////////////////////////
661 
662 
663 
664 
665 
666 END_objects_SCOPE // namespace ncbi::objects::
667 
669 
670 
671 #endif // ALGO_MS_FORMATS_PEPXML_SAMPLE_ENZYME_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
Defines the net cleavage specificity of an enzyme, chemical reagent, or a mixture of these,...
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSpecificity –.
Definition: Specificity.hpp:66
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_PEPXML_EXPORT
Definition: ncbi_export.h:696
bool CanGetSpecificity(void) const
Check if it is safe to call GetSpecificity method.
void SetDefaultFidelity(void)
Assign default value to Fidelity data member.
void ResetIndependent(void)
Reset Independent data member.
TDescription & SetDescription(void)
Assign a value to Description data member.
C_Attlist & operator=(const C_Attlist &)
CRef< TAttlist > m_Attlist
const TName & GetName(void) const
Get the Name member data.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
TFidelity & SetFidelity(void)
Assign a value to Fidelity data member.
list< CRef< CSpecificity > > TSpecificity
bool CanGetDescription(void) const
Check if it is safe to call GetDescription method.
list< CRef< CSpecificity > > m_Specificity
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
bool IsSetFidelity(void) const
Check if a value has been assigned to Fidelity data member.
TIndependent & SetIndependent(void)
Assign a value to Independent data member.
CSample_enzyme_Base & operator=(const CSample_enzyme_Base &)
void ResetAttlist(void)
Reset Attlist data member.
TName & SetName(void)
Assign a value to Name data member.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
TFidelity GetFidelity(void) const
Get the Fidelity member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
bool CanGetIndependent(void) const
Check if it is safe to call GetIndependent method.
bool IsSetIndependent(void) const
Check if a value has been assigned to Independent data member.
TIndependent GetIndependent(void) const
Get the Independent member data.
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
C_Attlist(const C_Attlist &)
const TSpecificity & GetSpecificity(void) const
Get the Specificity member data.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
const TDescription & GetDescription(void) const
Get the Description member data.
bool CanGetName(void) const
Check if it is safe to call GetName method.
CSerialObject Tparent
void ResetFidelity(void)
Reset Fidelity data member.
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
bool IsSetSpecificity(void) const
Check if a value has been assigned to Specificity data member.
TSpecificity & SetSpecificity(void)
Assign a value to Specificity data member.
bool CanGetFidelity(void) const
Check if it is safe to call GetFidelity method.
bool IsSetDescription(void) const
Check if a value has been assigned to Description data member.
CSample_enzyme_Base(const CSample_enzyme_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:02:58 2024 by modify_doxy.py rev. 669887