NCBI C++ ToolKit
Modification_info_.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 Modification_info_.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_MODIFICATION_INFO_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_MODIFICATION_INFO_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
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_pepXML
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///Positions and masses of modifications
74 ///
75 /// CModification_info_Base --
76 ///
77 
79 {
81 public:
82  // constructor
84  // destructor
85  virtual ~CModification_info_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 
107  // types
108  typedef double TMod_nterm_mass;
109  typedef double TMod_cterm_mass;
110  typedef string TModified_peptide;
111 
112  // member index
113  enum class E_memberIndex {
114  e__allMandatory = 0,
115  e_mod_nterm_mass,
116  e_mod_cterm_mass,
117  e_modified_peptide
118  };
120 
121  // getters
122  // setters
123 
124  /// Check if a value has been assigned to Mod_nterm_mass data member.
125  ///
126  /// Data member Mod_nterm_mass is optional;
127  /// its type is defined as 'typedef double TMod_nterm_mass'
128  /// @return
129  /// - true, if a value has been assigned.
130  /// - false, otherwise.
131  bool IsSetMod_nterm_mass(void) const;
132 
133  /// Check if it is safe to call GetMod_nterm_mass method.
134  ///
135  /// @return
136  /// - true, if the data member is getatable.
137  /// - false, otherwise.
138  bool CanGetMod_nterm_mass(void) const;
139 
140  /// Reset Mod_nterm_mass data member.
141  void ResetMod_nterm_mass(void);
142 
143  /// Get the Mod_nterm_mass member data.
144  ///
145  /// @return
146  /// Copy of the member data.
147  TMod_nterm_mass GetMod_nterm_mass(void) const;
148 
149  /// Assign a value to Mod_nterm_mass data member.
150  ///
151  /// @param value
152  /// Value to assign
153  void SetMod_nterm_mass(TMod_nterm_mass value);
154 
155  /// Assign a value to Mod_nterm_mass data member.
156  ///
157  /// @return
158  /// Reference to the data value.
159  TMod_nterm_mass& SetMod_nterm_mass(void);
160 
161  /// Check if a value has been assigned to Mod_cterm_mass data member.
162  ///
163  /// Data member Mod_cterm_mass is optional;
164  /// its type is defined as 'typedef double TMod_cterm_mass'
165  /// @return
166  /// - true, if a value has been assigned.
167  /// - false, otherwise.
168  bool IsSetMod_cterm_mass(void) const;
169 
170  /// Check if it is safe to call GetMod_cterm_mass method.
171  ///
172  /// @return
173  /// - true, if the data member is getatable.
174  /// - false, otherwise.
175  bool CanGetMod_cterm_mass(void) const;
176 
177  /// Reset Mod_cterm_mass data member.
178  void ResetMod_cterm_mass(void);
179 
180  /// Get the Mod_cterm_mass member data.
181  ///
182  /// @return
183  /// Copy of the member data.
184  TMod_cterm_mass GetMod_cterm_mass(void) const;
185 
186  /// Assign a value to Mod_cterm_mass data member.
187  ///
188  /// @param value
189  /// Value to assign
190  void SetMod_cterm_mass(TMod_cterm_mass value);
191 
192  /// Assign a value to Mod_cterm_mass data member.
193  ///
194  /// @return
195  /// Reference to the data value.
196  TMod_cterm_mass& SetMod_cterm_mass(void);
197 
198  /// Check if a value has been assigned to Modified_peptide data member.
199  ///
200  /// Data member Modified_peptide is optional;
201  /// its type is defined as 'typedef string TModified_peptide'
202  /// @return
203  /// - true, if a value has been assigned.
204  /// - false, otherwise.
205  bool IsSetModified_peptide(void) const;
206 
207  /// Check if it is safe to call GetModified_peptide method.
208  ///
209  /// @return
210  /// - true, if the data member is getatable.
211  /// - false, otherwise.
212  bool CanGetModified_peptide(void) const;
213 
214  /// Reset Modified_peptide data member.
215  void ResetModified_peptide(void);
216 
217  /// Get the Modified_peptide member data.
218  ///
219  /// @return
220  /// Reference to the member data.
221  const TModified_peptide& GetModified_peptide(void) const;
222 
223  /// Assign a value to Modified_peptide data member.
224  ///
225  /// @param value
226  /// Value to assign
227  void SetModified_peptide(const TModified_peptide& value);
228  void SetModified_peptide(TModified_peptide&& value);
229 
230  /// Assign a value to Modified_peptide data member.
231  ///
232  /// @return
233  /// Reference to the data value.
234  TModified_peptide& SetModified_peptide(void);
235 
236  /// Reset the whole object
237  void Reset(void);
238 
239 
240  private:
241  // Prohibit copy constructor and assignment operator
244 
245  // data
246  Uint4 m_set_State[1];
250  };
251  // types
253  typedef list< CRef< CMod_aminoacid_mass > > TMod_aminoacid_mass;
254 
255  // member index
256  enum class E_memberIndex {
257  e__allMandatory = 0,
258  e_Attlist,
259  e_mod_aminoacid_mass
260  };
262 
263  // getters
264  // setters
265 
266  /// Check if a value has been assigned to Attlist data member.
267  ///
268  /// Data member Attlist is mandatory;
269  /// its type is defined as 'typedef C_Attlist TAttlist'
270  /// @return
271  /// - true, if a value has been assigned.
272  /// - false, otherwise.
273  bool IsSetAttlist(void) const;
274 
275  /// Check if it is safe to call GetAttlist method.
276  ///
277  /// @return
278  /// - true, if the data member is getatable.
279  /// - false, otherwise.
280  bool CanGetAttlist(void) const;
281 
282  /// Reset Attlist data member.
283  void ResetAttlist(void);
284 
285  /// Get the Attlist member data.
286  ///
287  /// @return
288  /// Reference to the member data.
289  const TAttlist& GetAttlist(void) const;
290 
291  /// Assign a value to Attlist data member.
292  ///
293  /// @param value
294  /// Reference to value.
295  void SetAttlist(TAttlist& value);
296 
297  /// Assign a value to Attlist data member.
298  ///
299  /// @return
300  /// Reference to the data value.
301  TAttlist& SetAttlist(void);
302 
303  /// Check if a value has been assigned to Mod_aminoacid_mass data member.
304  ///
305  /// Data member Mod_aminoacid_mass is optional;
306  /// its type is defined as 'typedef list< CRef< CMod_aminoacid_mass > > TMod_aminoacid_mass'
307  /// @return
308  /// - true, if a value has been assigned.
309  /// - false, otherwise.
310  bool IsSetMod_aminoacid_mass(void) const;
311 
312  /// Check if it is safe to call GetMod_aminoacid_mass method.
313  ///
314  /// @return
315  /// - true, if the data member is getatable.
316  /// - false, otherwise.
317  bool CanGetMod_aminoacid_mass(void) const;
318 
319  /// Reset Mod_aminoacid_mass data member.
320  void ResetMod_aminoacid_mass(void);
321 
322  /// Get the Mod_aminoacid_mass member data.
323  ///
324  /// @return
325  /// Reference to the member data.
326  const TMod_aminoacid_mass& GetMod_aminoacid_mass(void) const;
327 
328  /// Assign a value to Mod_aminoacid_mass data member.
329  ///
330  /// @return
331  /// Reference to the data value.
332  TMod_aminoacid_mass& SetMod_aminoacid_mass(void);
333 
334  /// Reset the whole object
335  virtual void Reset(void);
336 
337 
338 private:
339  // Prohibit copy constructor and assignment operator
342 
343  // data
344  Uint4 m_set_State[1];
346  list< CRef< CMod_aminoacid_mass > > m_Mod_aminoacid_mass;
347 };
348 
349 /* @} */
350 
351 
352 
353 
354 
355 ///////////////////////////////////////////////////////////
356 ///////////////////// inline methods //////////////////////
357 ///////////////////////////////////////////////////////////
358 inline
360 {
361  return ((m_set_State[0] & 0x3) != 0);
362 }
363 
364 inline
366 {
367  return IsSetMod_nterm_mass();
368 }
369 
370 inline
372 {
373  m_Mod_nterm_mass = 0;
374  m_set_State[0] &= ~0x3;
375 }
376 
377 inline
379 {
380  if (!CanGetMod_nterm_mass()) {
381  ThrowUnassigned(0);
382  }
383  return m_Mod_nterm_mass;
384 }
385 
386 inline
388 {
389  m_Mod_nterm_mass = value;
390  m_set_State[0] |= 0x3;
391 }
392 
393 inline
395 {
396 #ifdef _DEBUG
397  if (!IsSetMod_nterm_mass()) {
398  memset(&m_Mod_nterm_mass,UnassignedByte(),sizeof(m_Mod_nterm_mass));
399  }
400 #endif
401  m_set_State[0] |= 0x1;
402  return m_Mod_nterm_mass;
403 }
404 
405 inline
407 {
408  return ((m_set_State[0] & 0xc) != 0);
409 }
410 
411 inline
413 {
414  return IsSetMod_cterm_mass();
415 }
416 
417 inline
419 {
420  m_Mod_cterm_mass = 0;
421  m_set_State[0] &= ~0xc;
422 }
423 
424 inline
426 {
427  if (!CanGetMod_cterm_mass()) {
428  ThrowUnassigned(1);
429  }
430  return m_Mod_cterm_mass;
431 }
432 
433 inline
435 {
436  m_Mod_cterm_mass = value;
437  m_set_State[0] |= 0xc;
438 }
439 
440 inline
442 {
443 #ifdef _DEBUG
444  if (!IsSetMod_cterm_mass()) {
445  memset(&m_Mod_cterm_mass,UnassignedByte(),sizeof(m_Mod_cterm_mass));
446  }
447 #endif
448  m_set_State[0] |= 0x4;
449  return m_Mod_cterm_mass;
450 }
451 
452 inline
454 {
455  return ((m_set_State[0] & 0x30) != 0);
456 }
457 
458 inline
460 {
461  return IsSetModified_peptide();
462 }
463 
464 inline
466 {
467  if (!CanGetModified_peptide()) {
468  ThrowUnassigned(2);
469  }
470  return m_Modified_peptide;
471 }
472 
473 inline
475 {
476  m_Modified_peptide = value;
477  m_set_State[0] |= 0x30;
478 }
479 
480 inline
482 {
483  m_Modified_peptide = std::forward<CModification_info_Base::C_Attlist::TModified_peptide>(value);
484  m_set_State[0] |= 0x30;
485 }
486 
487 inline
489 {
490 #ifdef _DEBUG
491  if (!IsSetModified_peptide()) {
492  m_Modified_peptide = UnassignedString();
493  }
494 #endif
495  m_set_State[0] |= 0x10;
496  return m_Modified_peptide;
497 }
498 
499 inline
501 {
502  return m_Attlist.NotEmpty();
503 }
504 
505 inline
507 {
508  return true;
509 }
510 
511 inline
513 {
514  if ( !m_Attlist ) {
515  const_cast<CModification_info_Base*>(this)->ResetAttlist();
516  }
517  return (*m_Attlist);
518 }
519 
520 inline
522 {
523  if ( !m_Attlist ) {
524  ResetAttlist();
525  }
526  return (*m_Attlist);
527 }
528 
529 inline
531 {
532  return ((m_set_State[0] & 0xc) != 0);
533 }
534 
535 inline
537 {
538  return true;
539 }
540 
541 inline
543 {
544  return m_Mod_aminoacid_mass;
545 }
546 
547 inline
549 {
550  m_set_State[0] |= 0x4;
551  return m_Mod_aminoacid_mass;
552 }
553 
554 ///////////////////////////////////////////////////////////
555 ////////////////// end of inline methods //////////////////
556 ///////////////////////////////////////////////////////////
557 
558 
559 
560 
561 
562 END_objects_SCOPE // namespace ncbi::objects::
563 
565 
566 
567 #endif // ALGO_MS_FORMATS_PEPXML_MODIFICATION_INFO_BASE_HPP
CMod_aminoacid_mass –.
Positions and masses of modifications.
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
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 CanGetMod_cterm_mass(void) const
Check if it is safe to call GetMod_cterm_mass method.
C_Attlist & operator=(const C_Attlist &)
TMod_nterm_mass GetMod_nterm_mass(void) const
Get the Mod_nterm_mass member data.
bool IsSetMod_cterm_mass(void) const
Check if a value has been assigned to Mod_cterm_mass data member.
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
const TModified_peptide & GetModified_peptide(void) const
Get the Modified_peptide member data.
const TMod_aminoacid_mass & GetMod_aminoacid_mass(void) const
Get the Mod_aminoacid_mass member data.
TMod_aminoacid_mass & SetMod_aminoacid_mass(void)
Assign a value to Mod_aminoacid_mass data member.
bool CanGetMod_nterm_mass(void) const
Check if it is safe to call GetMod_nterm_mass method.
bool IsSetMod_aminoacid_mass(void) const
Check if a value has been assigned to Mod_aminoacid_mass data member.
list< CRef< CMod_aminoacid_mass > > m_Mod_aminoacid_mass
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
bool CanGetMod_aminoacid_mass(void) const
Check if it is safe to call GetMod_aminoacid_mass method.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
TMod_cterm_mass & SetMod_cterm_mass(void)
Assign a value to Mod_cterm_mass data member.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
bool CanGetModified_peptide(void) const
Check if it is safe to call GetModified_peptide method.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
TMod_cterm_mass GetMod_cterm_mass(void) const
Get the Mod_cterm_mass member data.
CModification_info_Base(const CModification_info_Base &)
list< CRef< CMod_aminoacid_mass > > TMod_aminoacid_mass
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
CModification_info_Base & operator=(const CModification_info_Base &)
TMod_nterm_mass & SetMod_nterm_mass(void)
Assign a value to Mod_nterm_mass data member.
bool IsSetMod_nterm_mass(void) const
Check if a value has been assigned to Mod_nterm_mass data member.
void ResetAttlist(void)
Reset Attlist data member.
void ResetMod_nterm_mass(void)
Reset Mod_nterm_mass data member.
TModified_peptide & SetModified_peptide(void)
Assign a value to Modified_peptide data member.
bool IsSetModified_peptide(void) const
Check if a value has been assigned to Modified_peptide data member.
void ResetMod_cterm_mass(void)
Reset Mod_cterm_mass data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri May 24 14:57:52 2024 by modify_doxy.py rev. 669887