NCBI C++ ToolKit
Specificity_.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 Specificity_.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_SPECIFICITY_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_SPECIFICITY_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
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 // generated classes
60 
61 
62 /** @addtogroup dataspec_pepXML
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///Component cleavage specificity. Must be at least one specificity unless enzymeType:fidelity is nonspecific
69 ///
70 /// CSpecificity_Base --
71 ///
72 
74 {
76 public:
77  // constructor
78  CSpecificity_Base(void);
79  // destructor
80  virtual ~CSpecificity_Base(void);
81 
82  // type info
84 
85  /////////////////////////////////////////////////////////////////////////////
86  ///
87  /// C_Attlist --
88  ///
89 
91  {
93  public:
94  // constructor
95  C_Attlist(void);
96  // destructor
97  ~C_Attlist(void);
98 
99  // type info
101 
103  eAttlist_sense_C = 1,
104  eAttlist_sense_N = 2
105  };
106 
107  /// Access to EAttlist_sense's attributes (values, names) as defined in spec
108  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAttlist_sense)(void);
109 
110  // types
112  typedef int TMin_spacing;
113  typedef string TCut;
114  typedef string TNo_cut;
115 
116  // member index
117  enum class E_memberIndex {
118  e__allMandatory = 0,
119  e_sense,
120  e_min_spacing,
121  e_cut,
122  e_no_cut
123  };
125 
126  // getters
127  // setters
128 
129  ///Defines whether cleavage occurs on the C-terminal or N-terminal side of the residue(s) listed in cut
130  /// Check if a value has been assigned to Sense data member.
131  ///
132  /// Data member Sense is mandatory;
133  /// its type is defined as 'typedef EAttlist_sense TSense'
134  /// @return
135  /// - true, if a value has been assigned.
136  /// - false, otherwise.
137  bool IsSetSense(void) const;
138 
139  /// Check if it is safe to call GetSense method.
140  ///
141  /// @return
142  /// - true, if the data member is getatable.
143  /// - false, otherwise.
144  bool CanGetSense(void) const;
145 
146  /// Reset Sense data member.
147  void ResetSense(void);
148 
149  /// Get the Sense member data.
150  ///
151  /// @return
152  /// Copy of the member data.
153  TSense GetSense(void) const;
154 
155  /// Assign a value to Sense data member.
156  ///
157  /// @param value
158  /// Value to assign
159  void SetSense(TSense value);
160 
161  /// Assign a value to Sense data member.
162  ///
163  /// @return
164  /// Reference to the data value.
165  TSense& SetSense(void);
166 
167  /// Check if a value has been assigned to Min_spacing data member.
168  ///
169  /// Data member Min_spacing is optional with default 1;
170  /// its type is defined as 'typedef int TMin_spacing'
171  /// @return
172  /// - true, if a value has been assigned.
173  /// - false, otherwise.
174  bool IsSetMin_spacing(void) const;
175 
176  /// Check if it is safe to call GetMin_spacing method.
177  ///
178  /// @return
179  /// - true, if the data member is getatable.
180  /// - false, otherwise.
181  bool CanGetMin_spacing(void) const;
182 
183  /// Reset Min_spacing data member.
184  void ResetMin_spacing(void);
185 
186  /// Assign default value to Min_spacing data member.
187  void SetDefaultMin_spacing(void);
188 
189  /// Get the Min_spacing member data.
190  ///
191  /// @return
192  /// Copy of the member data.
193  TMin_spacing GetMin_spacing(void) const;
194 
195  /// Assign a value to Min_spacing data member.
196  ///
197  /// @param value
198  /// Value to assign
199  void SetMin_spacing(TMin_spacing value);
200 
201  /// Assign a value to Min_spacing data member.
202  ///
203  /// @return
204  /// Reference to the data value.
205  TMin_spacing& SetMin_spacing(void);
206 
207  /// Check if a value has been assigned to Cut data member.
208  ///
209  /// Data member Cut is mandatory;
210  /// its type is defined as 'typedef string TCut'
211  /// @return
212  /// - true, if a value has been assigned.
213  /// - false, otherwise.
214  bool IsSetCut(void) const;
215 
216  /// Check if it is safe to call GetCut method.
217  ///
218  /// @return
219  /// - true, if the data member is getatable.
220  /// - false, otherwise.
221  bool CanGetCut(void) const;
222 
223  /// Reset Cut data member.
224  void ResetCut(void);
225 
226  /// Get the Cut member data.
227  ///
228  /// @return
229  /// Reference to the member data.
230  const TCut& GetCut(void) const;
231 
232  /// Assign a value to Cut data member.
233  ///
234  /// @param value
235  /// Value to assign
236  void SetCut(const TCut& value);
237  void SetCut(TCut&& value);
238 
239  /// Assign a value to Cut data member.
240  ///
241  /// @return
242  /// Reference to the data value.
243  TCut& SetCut(void);
244 
245  /// Check if a value has been assigned to No_cut data member.
246  ///
247  /// Data member No_cut is optional;
248  /// its type is defined as 'typedef string TNo_cut'
249  /// @return
250  /// - true, if a value has been assigned.
251  /// - false, otherwise.
252  bool IsSetNo_cut(void) const;
253 
254  /// Check if it is safe to call GetNo_cut method.
255  ///
256  /// @return
257  /// - true, if the data member is getatable.
258  /// - false, otherwise.
259  bool CanGetNo_cut(void) const;
260 
261  /// Reset No_cut data member.
262  void ResetNo_cut(void);
263 
264  /// Get the No_cut member data.
265  ///
266  /// @return
267  /// Reference to the member data.
268  const TNo_cut& GetNo_cut(void) const;
269 
270  /// Assign a value to No_cut data member.
271  ///
272  /// @param value
273  /// Value to assign
274  void SetNo_cut(const TNo_cut& value);
275  void SetNo_cut(TNo_cut&& value);
276 
277  /// Assign a value to No_cut data member.
278  ///
279  /// @return
280  /// Reference to the data value.
281  TNo_cut& SetNo_cut(void);
282 
283  /// Reset the whole object
284  void Reset(void);
285 
286 
287  private:
288  // Prohibit copy constructor and assignment operator
291 
292  // data
293  Uint4 m_set_State[1];
296  string m_Cut;
297  string m_No_cut;
298  };
299  // types
301 
302  // member index
303  enum class E_memberIndex {
304  e__allMandatory = 0,
305  e_Attlist,
306  e_specificity
307  };
309 
310  // getters
311  // setters
312 
313  /// Check if a value has been assigned to Attlist data member.
314  ///
315  /// Data member Attlist is mandatory;
316  /// its type is defined as 'typedef C_Attlist TAttlist'
317  /// @return
318  /// - true, if a value has been assigned.
319  /// - false, otherwise.
320  bool IsSetAttlist(void) const;
321 
322  /// Check if it is safe to call GetAttlist method.
323  ///
324  /// @return
325  /// - true, if the data member is getatable.
326  /// - false, otherwise.
327  bool CanGetAttlist(void) const;
328 
329  /// Reset Attlist data member.
330  void ResetAttlist(void);
331 
332  /// Get the Attlist member data.
333  ///
334  /// @return
335  /// Reference to the member data.
336  const TAttlist& GetAttlist(void) const;
337 
338  /// Assign a value to Attlist data member.
339  ///
340  /// @param value
341  /// Reference to value.
342  void SetAttlist(TAttlist& value);
343 
344  /// Assign a value to Attlist data member.
345  ///
346  /// @return
347  /// Reference to the data value.
348  TAttlist& SetAttlist(void);
349 
350  /// Check if a value has been assigned to Specificity data member.
351  ///
352  /// Data member Specificity is mandatory
353  /// @return
354  /// - true, if a value has been assigned.
355  /// - false, otherwise.
356  bool IsSetSpecificity(void) const;
357 
358  /// Check if value of Specificity member is getatable.
359  ///
360  /// @return
361  /// - false; the data member of type 'NULL' has no value.
362  bool CanGetSpecificity(void) const;
363 
364  /// Reset Specificity data member.
365  void ResetSpecificity(void);
366 
367  /// Set NULL data member (assign 'NULL' value to Specificity data member).
368  void SetSpecificity(void);
369 
370  /// Reset the whole object
371  virtual void Reset(void);
372 
373 
374 private:
375  // Prohibit copy constructor and assignment operator
378 
379  // data
380  Uint4 m_set_State[1];
382 };
383 
384 /* @} */
385 
386 
387 
388 
389 
390 ///////////////////////////////////////////////////////////
391 ///////////////////// inline methods //////////////////////
392 ///////////////////////////////////////////////////////////
393 inline
395 {
396  return ((m_set_State[0] & 0x3) != 0);
397 }
398 
399 inline
401 {
402  return IsSetSense();
403 }
404 
405 inline
407 {
408  m_Sense = (EAttlist_sense)(0);
409  m_set_State[0] &= ~0x3;
410 }
411 
412 inline
414 {
415  if (!CanGetSense()) {
416  ThrowUnassigned(0);
417  }
418  return m_Sense;
419 }
420 
421 inline
423 {
424  m_Sense = value;
425  m_set_State[0] |= 0x3;
426 }
427 
428 inline
430 {
431 #ifdef _DEBUG
432  if (!IsSetSense()) {
433  memset(&m_Sense,UnassignedByte(),sizeof(m_Sense));
434  }
435 #endif
436  m_set_State[0] |= 0x1;
437  return m_Sense;
438 }
439 
440 inline
442 {
443  return ((m_set_State[0] & 0xc) != 0);
444 }
445 
446 inline
448 {
449  return true;
450 }
451 
452 inline
454 {
455  m_Min_spacing = 1;
456  m_set_State[0] &= ~0xc;
457 }
458 
459 inline
461 {
462  ResetMin_spacing();
463  m_set_State[0] |= 0x4;
464 }
465 
466 inline
468 {
469  return m_Min_spacing;
470 }
471 
472 inline
474 {
475  m_Min_spacing = value;
476  m_set_State[0] |= 0xc;
477 }
478 
479 inline
481 {
482 #ifdef _DEBUG
483  if (!IsSetMin_spacing()) {
484  memset(&m_Min_spacing,UnassignedByte(),sizeof(m_Min_spacing));
485  }
486 #endif
487  m_set_State[0] |= 0x4;
488  return m_Min_spacing;
489 }
490 
491 inline
493 {
494  return ((m_set_State[0] & 0x30) != 0);
495 }
496 
497 inline
499 {
500  return IsSetCut();
501 }
502 
503 inline
505 {
506  if (!CanGetCut()) {
507  ThrowUnassigned(2);
508  }
509  return m_Cut;
510 }
511 
512 inline
514 {
515  m_Cut = value;
516  m_set_State[0] |= 0x30;
517 }
518 
519 inline
521 {
522  m_Cut = std::forward<CSpecificity_Base::C_Attlist::TCut>(value);
523  m_set_State[0] |= 0x30;
524 }
525 
526 inline
528 {
529 #ifdef _DEBUG
530  if (!IsSetCut()) {
531  m_Cut = UnassignedString();
532  }
533 #endif
534  m_set_State[0] |= 0x10;
535  return m_Cut;
536 }
537 
538 inline
540 {
541  return ((m_set_State[0] & 0xc0) != 0);
542 }
543 
544 inline
546 {
547  return IsSetNo_cut();
548 }
549 
550 inline
552 {
553  if (!CanGetNo_cut()) {
554  ThrowUnassigned(3);
555  }
556  return m_No_cut;
557 }
558 
559 inline
561 {
562  m_No_cut = value;
563  m_set_State[0] |= 0xc0;
564 }
565 
566 inline
568 {
569  m_No_cut = std::forward<CSpecificity_Base::C_Attlist::TNo_cut>(value);
570  m_set_State[0] |= 0xc0;
571 }
572 
573 inline
575 {
576 #ifdef _DEBUG
577  if (!IsSetNo_cut()) {
578  m_No_cut = UnassignedString();
579  }
580 #endif
581  m_set_State[0] |= 0x40;
582  return m_No_cut;
583 }
584 
585 inline
587 {
588  return m_Attlist.NotEmpty();
589 }
590 
591 inline
593 {
594  return true;
595 }
596 
597 inline
599 {
600  if ( !m_Attlist ) {
601  const_cast<CSpecificity_Base*>(this)->ResetAttlist();
602  }
603  return (*m_Attlist);
604 }
605 
606 inline
608 {
609  if ( !m_Attlist ) {
610  ResetAttlist();
611  }
612  SetSpecificity();
613  return (*m_Attlist);
614 }
615 
616 inline
618 {
619  return ((m_set_State[0] & 0xc) != 0);
620 }
621 
622 inline
624 {
625  return false;
626 }
627 
628 inline
630 {
631  m_set_State[0] &= ~0xc;
632 }
633 
634 inline
636 {
637  m_set_State[0] |= 0xc;
638 }
639 
640 ///////////////////////////////////////////////////////////
641 ////////////////// end of inline methods //////////////////
642 ///////////////////////////////////////////////////////////
643 
644 
645 
646 
647 
648 END_objects_SCOPE // namespace ncbi::objects::
649 
651 
652 
653 #endif // ALGO_MS_FORMATS_PEPXML_SPECIFICITY_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
Component cleavage specificity.
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
void ResetAttlist(void)
Reset Attlist data member.
bool CanGetMin_spacing(void) const
Check if it is safe to call GetMin_spacing method.
bool IsSetCut(void) const
Check if a value has been assigned to Cut data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
CSerialObject Tparent
bool IsSetSense(void) const
Defines whether cleavage occurs on the C-terminal or N-terminal side of the residue(s) listed in cut ...
void ResetSense(void)
Reset Sense data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
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.
bool CanGetSense(void) const
Check if it is safe to call GetSense method.
void ResetMin_spacing(void)
Reset Min_spacing data member.
void SetSpecificity(void)
Set NULL data member (assign 'NULL' value to Specificity data member).
void ResetSpecificity(void)
Reset Specificity data member.
TCut & SetCut(void)
Assign a value to Cut data member.
const TCut & GetCut(void) const
Get the Cut member data.
CRef< TAttlist > m_Attlist
bool CanGetNo_cut(void) const
Check if it is safe to call GetNo_cut method.
C_Attlist & operator=(const C_Attlist &)
CSpecificity_Base(const CSpecificity_Base &)
const TNo_cut & GetNo_cut(void) const
Get the No_cut member data.
TSense GetSense(void) const
Get the Sense member data.
TSense & SetSense(void)
Assign a value to Sense data member.
C_Attlist(const C_Attlist &)
TMin_spacing GetMin_spacing(void) const
Get the Min_spacing member data.
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
bool IsSetMin_spacing(void) const
Check if a value has been assigned to Min_spacing data member.
TMin_spacing & SetMin_spacing(void)
Assign a value to Min_spacing data member.
TNo_cut & SetNo_cut(void)
Assign a value to No_cut data member.
CSpecificity_Base & operator=(const CSpecificity_Base &)
bool CanGetSpecificity(void) const
Check if value of Specificity member is getatable.
bool IsSetNo_cut(void) const
Check if a value has been assigned to No_cut data member.
bool CanGetCut(void) const
Check if it is safe to call GetCut method.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
void SetDefaultMin_spacing(void)
Assign default value to Min_spacing data member.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat May 25 14:17:20 2024 by modify_doxy.py rev. 669887