NCBI C++ ToolKit
MSResponse_.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 MSResponse_.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/omssa/omssa.asn">omssa.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/omssa/omssa.def">omssa.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_OMSSA_MSRESPONSE_BASE_HPP
42 #define OBJECTS_OMSSA_MSRESPONSE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 #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 CMSBioseqSet;
63 class CMSHitSet;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_OMSSA
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 /// search results
76 ///
77 /// CMSResponse_Base --
78 ///
79 
81 {
83 public:
84  // constructor
85  CMSResponse_Base(void);
86  // destructor
87  virtual ~CMSResponse_Base(void);
88 
89  // type info
91 
92  // types
93  typedef vector< CRef< CMSHitSet > > THitsets;
94  typedef int TScale;
95  typedef string TRid;
96  typedef int TError;
97  typedef string TVersion;
98  typedef string TEmail;
99  typedef int TDbversion;
101 
102  // member index
103  enum class E_memberIndex {
104  e__allMandatory = 0,
105  e_hitsets,
106  e_scale,
107  e_rid,
108  e_error,
109  e_version,
110  e_email,
111  e_dbversion,
112  e_bioseqs
113  };
115 
116  // getters
117  // setters
118 
119  /// hits grouped by spectrum
120  /// Check if a value has been assigned to Hitsets data member.
121  ///
122  /// Data member Hitsets is mandatory;
123  /// its type is defined as 'typedef vector< CRef< CMSHitSet > > THitsets'
124  /// @return
125  /// - true, if a value has been assigned.
126  /// - false, otherwise.
127  bool IsSetHitsets(void) const;
128 
129  /// Check if it is safe to call GetHitsets method.
130  ///
131  /// @return
132  /// - true, if the data member is getatable.
133  /// - false, otherwise.
134  bool CanGetHitsets(void) const;
135 
136  /// Reset Hitsets data member.
137  void ResetHitsets(void);
138 
139  /// Get the Hitsets member data.
140  ///
141  /// @return
142  /// Reference to the member data.
143  const THitsets& GetHitsets(void) const;
144 
145  /// Assign a value to Hitsets data member.
146  ///
147  /// @return
148  /// Reference to the data value.
149  THitsets& SetHitsets(void);
150 
151  /// scale to change m/z float to integer
152  /// Check if a value has been assigned to Scale data member.
153  ///
154  /// Data member Scale is optional with default 100;
155  /// its type is defined as 'typedef int TScale'
156  /// @return
157  /// - true, if a value has been assigned.
158  /// - false, otherwise.
159  bool IsSetScale(void) const;
160 
161  /// Check if it is safe to call GetScale method.
162  ///
163  /// @return
164  /// - true, if the data member is getatable.
165  /// - false, otherwise.
166  bool CanGetScale(void) const;
167 
168  /// Reset Scale data member.
169  void ResetScale(void);
170 
171  /// Assign default value to Scale data member.
172  void SetDefaultScale(void);
173 
174  /// Get the Scale member data.
175  ///
176  /// @return
177  /// Copy of the member data.
178  TScale GetScale(void) const;
179 
180  /// Assign a value to Scale data member.
181  ///
182  /// @param value
183  /// Value to assign
184  void SetScale(TScale value);
185 
186  /// Assign a value to Scale data member.
187  ///
188  /// @return
189  /// Reference to the data value.
190  TScale& SetScale(void);
191 
192  /// request id
193  /// Check if a value has been assigned to Rid data member.
194  ///
195  /// Data member Rid is optional;
196  /// its type is defined as 'typedef string TRid'
197  /// @return
198  /// - true, if a value has been assigned.
199  /// - false, otherwise.
200  bool IsSetRid(void) const;
201 
202  /// Check if it is safe to call GetRid method.
203  ///
204  /// @return
205  /// - true, if the data member is getatable.
206  /// - false, otherwise.
207  bool CanGetRid(void) const;
208 
209  /// Reset Rid data member.
210  void ResetRid(void);
211 
212  /// Get the Rid member data.
213  ///
214  /// @return
215  /// Reference to the member data.
216  const TRid& GetRid(void) const;
217 
218  /// Assign a value to Rid data member.
219  ///
220  /// @param value
221  /// Value to assign
222  void SetRid(const TRid& value);
223  void SetRid(TRid&& value);
224 
225  /// Assign a value to Rid data member.
226  ///
227  /// @return
228  /// Reference to the data value.
229  TRid& SetRid(void);
230 
231  /// error response
232  /// Check if a value has been assigned to Error data member.
233  ///
234  /// Data member Error is optional;
235  /// its type is defined as 'typedef int TError'
236  /// @return
237  /// - true, if a value has been assigned.
238  /// - false, otherwise.
239  bool IsSetError(void) const;
240 
241  /// Check if it is safe to call GetError method.
242  ///
243  /// @return
244  /// - true, if the data member is getatable.
245  /// - false, otherwise.
246  bool CanGetError(void) const;
247 
248  /// Reset Error data member.
249  void ResetError(void);
250 
251  /// Get the Error member data.
252  ///
253  /// @return
254  /// Copy of the member data.
255  TError GetError(void) const;
256 
257  /// Assign a value to Error data member.
258  ///
259  /// @param value
260  /// Value to assign
261  void SetError(TError value);
262 
263  /// Assign a value to Error data member.
264  ///
265  /// @return
266  /// Reference to the data value.
267  TError& SetError(void);
268 
269  /// version of OMSSA
270  /// Check if a value has been assigned to Version data member.
271  ///
272  /// Data member Version is optional;
273  /// its type is defined as 'typedef string TVersion'
274  /// @return
275  /// - true, if a value has been assigned.
276  /// - false, otherwise.
277  bool IsSetVersion(void) const;
278 
279  /// Check if it is safe to call GetVersion method.
280  ///
281  /// @return
282  /// - true, if the data member is getatable.
283  /// - false, otherwise.
284  bool CanGetVersion(void) const;
285 
286  /// Reset Version data member.
287  void ResetVersion(void);
288 
289  /// Get the Version member data.
290  ///
291  /// @return
292  /// Reference to the member data.
293  const TVersion& GetVersion(void) const;
294 
295  /// Assign a value to Version data member.
296  ///
297  /// @param value
298  /// Value to assign
299  void SetVersion(const TVersion& value);
300  void SetVersion(TVersion&& value);
301 
302  /// Assign a value to Version data member.
303  ///
304  /// @return
305  /// Reference to the data value.
306  TVersion& SetVersion(void);
307 
308  /// email address for notification
309  /// Check if a value has been assigned to Email data member.
310  ///
311  /// Data member Email is optional;
312  /// its type is defined as 'typedef string TEmail'
313  /// @return
314  /// - true, if a value has been assigned.
315  /// - false, otherwise.
316  bool IsSetEmail(void) const;
317 
318  /// Check if it is safe to call GetEmail method.
319  ///
320  /// @return
321  /// - true, if the data member is getatable.
322  /// - false, otherwise.
323  bool CanGetEmail(void) const;
324 
325  /// Reset Email data member.
326  void ResetEmail(void);
327 
328  /// Get the Email member data.
329  ///
330  /// @return
331  /// Reference to the member data.
332  const TEmail& GetEmail(void) const;
333 
334  /// Assign a value to Email data member.
335  ///
336  /// @param value
337  /// Value to assign
338  void SetEmail(const TEmail& value);
339  void SetEmail(TEmail&& value);
340 
341  /// Assign a value to Email data member.
342  ///
343  /// @return
344  /// Reference to the data value.
345  TEmail& SetEmail(void);
346 
347  /// version of db searched (usually size)
348  /// Check if a value has been assigned to Dbversion data member.
349  ///
350  /// Data member Dbversion is optional;
351  /// its type is defined as 'typedef int TDbversion'
352  /// @return
353  /// - true, if a value has been assigned.
354  /// - false, otherwise.
355  bool IsSetDbversion(void) const;
356 
357  /// Check if it is safe to call GetDbversion method.
358  ///
359  /// @return
360  /// - true, if the data member is getatable.
361  /// - false, otherwise.
362  bool CanGetDbversion(void) const;
363 
364  /// Reset Dbversion data member.
365  void ResetDbversion(void);
366 
367  /// Get the Dbversion member data.
368  ///
369  /// @return
370  /// Copy of the member data.
371  TDbversion GetDbversion(void) const;
372 
373  /// Assign a value to Dbversion data member.
374  ///
375  /// @param value
376  /// Value to assign
377  void SetDbversion(TDbversion value);
378 
379  /// Assign a value to Dbversion data member.
380  ///
381  /// @return
382  /// Reference to the data value.
383  TDbversion& SetDbversion(void);
384 
385  /// sequences found in search
386  /// Check if a value has been assigned to Bioseqs data member.
387  ///
388  /// Data member Bioseqs is optional;
389  /// its type is defined as 'typedef CMSBioseqSet TBioseqs'
390  /// @return
391  /// - true, if a value has been assigned.
392  /// - false, otherwise.
393  bool IsSetBioseqs(void) const;
394 
395  /// Check if it is safe to call GetBioseqs method.
396  ///
397  /// @return
398  /// - true, if the data member is getatable.
399  /// - false, otherwise.
400  bool CanGetBioseqs(void) const;
401 
402  /// Reset Bioseqs data member.
403  void ResetBioseqs(void);
404 
405  /// Get the Bioseqs member data.
406  ///
407  /// @return
408  /// Reference to the member data.
409  const TBioseqs& GetBioseqs(void) const;
410 
411  /// Assign a value to Bioseqs data member.
412  ///
413  /// @param value
414  /// Reference to value.
415  void SetBioseqs(TBioseqs& value);
416 
417  /// Assign a value to Bioseqs data member.
418  ///
419  /// @return
420  /// Reference to the data value.
421  TBioseqs& SetBioseqs(void);
422 
423  /// Reset the whole object
424  virtual void Reset(void);
425 
426 
427 private:
428  // Prohibit copy constructor and assignment operator
431 
432  // data
433  Uint4 m_set_State[1];
434  vector< CRef< CMSHitSet > > m_Hitsets;
435  int m_Scale;
436  string m_Rid;
437  int m_Error;
438  string m_Version;
439  string m_Email;
442 };
443 
444 /* @} */
445 
446 
447 
448 
449 
450 ///////////////////////////////////////////////////////////
451 ///////////////////// inline methods //////////////////////
452 ///////////////////////////////////////////////////////////
453 inline
455 {
456  return ((m_set_State[0] & 0x3) != 0);
457 }
458 
459 inline
461 {
462  return true;
463 }
464 
465 inline
467 {
468  return m_Hitsets;
469 }
470 
471 inline
473 {
474  m_set_State[0] |= 0x1;
475  return m_Hitsets;
476 }
477 
478 inline
480 {
481  return ((m_set_State[0] & 0xc) != 0);
482 }
483 
484 inline
486 {
487  return true;
488 }
489 
490 inline
492 {
493  m_Scale = 100;
494  m_set_State[0] &= ~0xc;
495 }
496 
497 inline
499 {
500  ResetScale();
501 }
502 
503 inline
505 {
506  return m_Scale;
507 }
508 
509 inline
511 {
512  m_Scale = value;
513  m_set_State[0] |= 0xc;
514 }
515 
516 inline
518 {
519 #ifdef _DEBUG
520  if (!IsSetScale()) {
521  memset(&m_Scale,UnassignedByte(),sizeof(m_Scale));
522  }
523 #endif
524  m_set_State[0] |= 0x4;
525  return m_Scale;
526 }
527 
528 inline
530 {
531  return ((m_set_State[0] & 0x30) != 0);
532 }
533 
534 inline
536 {
537  return IsSetRid();
538 }
539 
540 inline
542 {
543  if (!CanGetRid()) {
544  ThrowUnassigned(2);
545  }
546  return m_Rid;
547 }
548 
549 inline
551 {
552  m_Rid = value;
553  m_set_State[0] |= 0x30;
554 }
555 
556 inline
558 {
559  m_Rid = std::forward<CMSResponse_Base::TRid>(value);
560  m_set_State[0] |= 0x30;
561 }
562 
563 inline
565 {
566 #ifdef _DEBUG
567  if (!IsSetRid()) {
569  }
570 #endif
571  m_set_State[0] |= 0x10;
572  return m_Rid;
573 }
574 
575 inline
577 {
578  return ((m_set_State[0] & 0xc0) != 0);
579 }
580 
581 inline
583 {
584  return IsSetError();
585 }
586 
587 inline
589 {
590  m_Error = (int)(0);
591  m_set_State[0] &= ~0xc0;
592 }
593 
594 inline
596 {
597  if (!CanGetError()) {
598  ThrowUnassigned(3);
599  }
600  return m_Error;
601 }
602 
603 inline
605 {
606  m_Error = value;
607  m_set_State[0] |= 0xc0;
608 }
609 
610 inline
612 {
613 #ifdef _DEBUG
614  if (!IsSetError()) {
615  memset(&m_Error,UnassignedByte(),sizeof(m_Error));
616  }
617 #endif
618  m_set_State[0] |= 0x40;
619  return m_Error;
620 }
621 
622 inline
624 {
625  return ((m_set_State[0] & 0x300) != 0);
626 }
627 
628 inline
630 {
631  return IsSetVersion();
632 }
633 
634 inline
636 {
637  if (!CanGetVersion()) {
638  ThrowUnassigned(4);
639  }
640  return m_Version;
641 }
642 
643 inline
645 {
646  m_Version = value;
647  m_set_State[0] |= 0x300;
648 }
649 
650 inline
652 {
653  m_Version = std::forward<CMSResponse_Base::TVersion>(value);
654  m_set_State[0] |= 0x300;
655 }
656 
657 inline
659 {
660 #ifdef _DEBUG
661  if (!IsSetVersion()) {
663  }
664 #endif
665  m_set_State[0] |= 0x100;
666  return m_Version;
667 }
668 
669 inline
671 {
672  return ((m_set_State[0] & 0xc00) != 0);
673 }
674 
675 inline
677 {
678  return IsSetEmail();
679 }
680 
681 inline
683 {
684  if (!CanGetEmail()) {
685  ThrowUnassigned(5);
686  }
687  return m_Email;
688 }
689 
690 inline
692 {
693  m_Email = value;
694  m_set_State[0] |= 0xc00;
695 }
696 
697 inline
699 {
700  m_Email = std::forward<CMSResponse_Base::TEmail>(value);
701  m_set_State[0] |= 0xc00;
702 }
703 
704 inline
706 {
707 #ifdef _DEBUG
708  if (!IsSetEmail()) {
710  }
711 #endif
712  m_set_State[0] |= 0x400;
713  return m_Email;
714 }
715 
716 inline
718 {
719  return ((m_set_State[0] & 0x3000) != 0);
720 }
721 
722 inline
724 {
725  return IsSetDbversion();
726 }
727 
728 inline
730 {
731  m_Dbversion = 0;
732  m_set_State[0] &= ~0x3000;
733 }
734 
735 inline
737 {
738  if (!CanGetDbversion()) {
739  ThrowUnassigned(6);
740  }
741  return m_Dbversion;
742 }
743 
744 inline
746 {
747  m_Dbversion = value;
748  m_set_State[0] |= 0x3000;
749 }
750 
751 inline
753 {
754 #ifdef _DEBUG
755  if (!IsSetDbversion()) {
756  memset(&m_Dbversion,UnassignedByte(),sizeof(m_Dbversion));
757  }
758 #endif
759  m_set_State[0] |= 0x1000;
760  return m_Dbversion;
761 }
762 
763 inline
765 {
766  return m_Bioseqs.NotEmpty();
767 }
768 
769 inline
771 {
772  return IsSetBioseqs();
773 }
774 
775 inline
777 {
778  if (!CanGetBioseqs()) {
779  ThrowUnassigned(7);
780  }
781  return (*m_Bioseqs);
782 }
783 
784 ///////////////////////////////////////////////////////////
785 ////////////////// end of inline methods //////////////////
786 ///////////////////////////////////////////////////////////
787 
788 
789 
790 
791 
792 END_objects_SCOPE // namespace ncbi::objects::
793 
795 
796 
797 #endif // OBJECTS_OMSSA_MSRESPONSE_BASE_HPP
User-defined methods of the data storage class.
CMSHitSet –.
Definition: MSHitSet.hpp:66
search results
Definition: MSResponse_.hpp:81
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_OMSSA_EXPORT
Definition: ncbi_export.h:672
Uint4 m_set_State[1]
const TRid & GetRid(void) const
Get the Rid member data.
bool CanGetBioseqs(void) const
Check if it is safe to call GetBioseqs method.
CMSResponse_Base(const CMSResponse_Base &)
bool IsSetVersion(void) const
version of OMSSA Check if a value has been assigned to Version data member.
bool IsSetRid(void) const
request id Check if a value has been assigned to Rid data member.
const TEmail & GetEmail(void) const
Get the Email member data.
bool IsSetScale(void) const
scale to change m/z float to integer Check if a value has been assigned to Scale data member.
TScale GetScale(void) const
Get the Scale member data.
const THitsets & GetHitsets(void) const
Get the Hitsets member data.
bool IsSetHitsets(void) const
hits grouped by spectrum Check if a value has been assigned to Hitsets data member.
TVersion & SetVersion(void)
Assign a value to Version data member.
const TVersion & GetVersion(void) const
Get the Version member data.
bool CanGetDbversion(void) const
Check if it is safe to call GetDbversion method.
Tparent::CMemberIndex< E_memberIndex, 9 > TmemberIndex
TDbversion & SetDbversion(void)
Assign a value to Dbversion data member.
TRid & SetRid(void)
Assign a value to Rid data member.
void ResetError(void)
Reset Error data member.
vector< CRef< CMSHitSet > > m_Hitsets
bool CanGetScale(void) const
Check if it is safe to call GetScale method.
bool IsSetBioseqs(void) const
sequences found in search Check if a value has been assigned to Bioseqs data member.
TError GetError(void) const
Get the Error member data.
void SetDefaultScale(void)
Assign default value to Scale data member.
TDbversion GetDbversion(void) const
Get the Dbversion member data.
CSerialObject Tparent
Definition: MSResponse_.hpp:82
bool CanGetEmail(void) const
Check if it is safe to call GetEmail method.
vector< CRef< CMSHitSet > > THitsets
Definition: MSResponse_.hpp:93
const TBioseqs & GetBioseqs(void) const
Get the Bioseqs member data.
bool CanGetError(void) const
Check if it is safe to call GetError method.
bool IsSetEmail(void) const
email address for notification Check if a value has been assigned to Email data member.
bool CanGetRid(void) const
Check if it is safe to call GetRid method.
TError & SetError(void)
Assign a value to Error data member.
void ResetScale(void)
Reset Scale data member.
TScale & SetScale(void)
Assign a value to Scale data member.
bool CanGetVersion(void) const
Check if it is safe to call GetVersion method.
TEmail & SetEmail(void)
Assign a value to Email data member.
bool CanGetHitsets(void) const
Check if it is safe to call GetHitsets method.
CMSResponse_Base & operator=(const CMSResponse_Base &)
void ResetDbversion(void)
Reset Dbversion data member.
bool IsSetDbversion(void) const
version of db searched (usually size) Check if a value has been assigned to Dbversion data member.
THitsets & SetHitsets(void)
Assign a value to Hitsets data member.
CMSBioseqSet TBioseqs
CRef< TBioseqs > m_Bioseqs
bool IsSetError(void) const
error response Check if a value has been assigned to Error data member.
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon Jun 17 05:06:11 2024 by modify_doxy.py rev. 669887