NCBI C++ ToolKit
MSHitSet_.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 MSHitSet_.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_MSHITSET_BASE_HPP
42 #define OBJECTS_OMSSA_MSHITSET_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 #include <vector>
53 
55 
56 #ifndef BEGIN_objects_SCOPE
57 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
58 # define END_objects_SCOPE END_SCOPE(objects)
59 #endif
60 BEGIN_objects_SCOPE // namespace ncbi::objects::
61 
62 
63 // forward declarations
64 class CMSHits;
65 class CNameValue;
66 
67 
68 // generated classes
69 
70 
71 /** @addtogroup dataspec_OMSSA
72  *
73  * @{
74  */
75 
76 /////////////////////////////////////////////////////////////////////////////
77 /// contains a set of hits to a single spectrum
78 ///
79 /// CMSHitSet_Base --
80 ///
81 
83 {
85 public:
86  // constructor
87  CMSHitSet_Base(void);
88  // destructor
89  virtual ~CMSHitSet_Base(void);
90 
91  // type info
93 
94  // types
95  typedef int TNumber;
96  typedef int TError;
97  typedef vector< CRef< CMSHits > > THits;
98  typedef list< string > TIds;
99  typedef list< CRef< CNameValue > > TNamevalue;
100  typedef int TSettingid;
101  typedef int TUserannotation;
102 
103  // member index
104  enum class E_memberIndex {
105  e__allMandatory = 0,
106  e_number,
107  e_error,
108  e_hits,
109  e_ids,
110  e_namevalue,
111  e_settingid,
112  e_userannotation
113  };
115 
116  // getters
117  // setters
118 
119  /// unique number of spectrum
120  /// Check if a value has been assigned to Number data member.
121  ///
122  /// Data member Number is mandatory;
123  /// its type is defined as 'typedef int TNumber'
124  /// @return
125  /// - true, if a value has been assigned.
126  /// - false, otherwise.
127  bool IsSetNumber(void) const;
128 
129  /// Check if it is safe to call GetNumber method.
130  ///
131  /// @return
132  /// - true, if the data member is getatable.
133  /// - false, otherwise.
134  bool CanGetNumber(void) const;
135 
136  /// Reset Number data member.
137  void ResetNumber(void);
138 
139  /// Get the Number member data.
140  ///
141  /// @return
142  /// Copy of the member data.
143  TNumber GetNumber(void) const;
144 
145  /// Assign a value to Number data member.
146  ///
147  /// @param value
148  /// Value to assign
149  void SetNumber(TNumber value);
150 
151  /// Assign a value to Number data member.
152  ///
153  /// @return
154  /// Reference to the data value.
155  TNumber& SetNumber(void);
156 
157  /// error, if any
158  /// Check if a value has been assigned to Error data member.
159  ///
160  /// Data member Error is optional;
161  /// its type is defined as 'typedef int TError'
162  /// @return
163  /// - true, if a value has been assigned.
164  /// - false, otherwise.
165  bool IsSetError(void) const;
166 
167  /// Check if it is safe to call GetError method.
168  ///
169  /// @return
170  /// - true, if the data member is getatable.
171  /// - false, otherwise.
172  bool CanGetError(void) const;
173 
174  /// Reset Error data member.
175  void ResetError(void);
176 
177  /// Get the Error member data.
178  ///
179  /// @return
180  /// Copy of the member data.
181  TError GetError(void) const;
182 
183  /// Assign a value to Error data member.
184  ///
185  /// @param value
186  /// Value to assign
187  void SetError(TError value);
188 
189  /// Assign a value to Error data member.
190  ///
191  /// @return
192  /// Reference to the data value.
193  TError& SetError(void);
194 
195  /// set of hit to spectrum
196  /// Check if a value has been assigned to Hits data member.
197  ///
198  /// Data member Hits is optional;
199  /// its type is defined as 'typedef vector< CRef< CMSHits > > THits'
200  /// @return
201  /// - true, if a value has been assigned.
202  /// - false, otherwise.
203  bool IsSetHits(void) const;
204 
205  /// Check if it is safe to call GetHits method.
206  ///
207  /// @return
208  /// - true, if the data member is getatable.
209  /// - false, otherwise.
210  bool CanGetHits(void) const;
211 
212  /// Reset Hits data member.
213  void ResetHits(void);
214 
215  /// Get the Hits member data.
216  ///
217  /// @return
218  /// Reference to the member data.
219  const THits& GetHits(void) const;
220 
221  /// Assign a value to Hits data member.
222  ///
223  /// @return
224  /// Reference to the data value.
225  THits& SetHits(void);
226 
227  /// filenames or other ids of spectra searched
228  /// Check if a value has been assigned to Ids data member.
229  ///
230  /// Data member Ids is optional;
231  /// its type is defined as 'typedef list< string > TIds'
232  /// @return
233  /// - true, if a value has been assigned.
234  /// - false, otherwise.
235  bool IsSetIds(void) const;
236 
237  /// Check if it is safe to call GetIds method.
238  ///
239  /// @return
240  /// - true, if the data member is getatable.
241  /// - false, otherwise.
242  bool CanGetIds(void) const;
243 
244  /// Reset Ids data member.
245  void ResetIds(void);
246 
247  /// Get the Ids member data.
248  ///
249  /// @return
250  /// Reference to the member data.
251  const TIds& GetIds(void) const;
252 
253  /// Assign a value to Ids data member.
254  ///
255  /// @return
256  /// Reference to the data value.
257  TIds& SetIds(void);
258 
259  /// extra info: retention times, etc.
260  /// Check if a value has been assigned to Namevalue data member.
261  ///
262  /// Data member Namevalue is optional;
263  /// its type is defined as 'typedef list< CRef< CNameValue > > TNamevalue'
264  /// @return
265  /// - true, if a value has been assigned.
266  /// - false, otherwise.
267  bool IsSetNamevalue(void) const;
268 
269  /// Check if it is safe to call GetNamevalue method.
270  ///
271  /// @return
272  /// - true, if the data member is getatable.
273  /// - false, otherwise.
274  bool CanGetNamevalue(void) const;
275 
276  /// Reset Namevalue data member.
277  void ResetNamevalue(void);
278 
279  /// Get the Namevalue member data.
280  ///
281  /// @return
282  /// Reference to the member data.
283  const TNamevalue& GetNamevalue(void) const;
284 
285  /// Assign a value to Namevalue data member.
286  ///
287  /// @return
288  /// Reference to the data value.
289  TNamevalue& SetNamevalue(void);
290 
291  /// id of the search setting used
292  /// Check if a value has been assigned to Settingid data member.
293  ///
294  /// Data member Settingid is optional;
295  /// its type is defined as 'typedef int TSettingid'
296  /// @return
297  /// - true, if a value has been assigned.
298  /// - false, otherwise.
299  bool IsSetSettingid(void) const;
300 
301  /// Check if it is safe to call GetSettingid method.
302  ///
303  /// @return
304  /// - true, if the data member is getatable.
305  /// - false, otherwise.
306  bool CanGetSettingid(void) const;
307 
308  /// Reset Settingid data member.
309  void ResetSettingid(void);
310 
311  /// Get the Settingid member data.
312  ///
313  /// @return
314  /// Copy of the member data.
315  TSettingid GetSettingid(void) const;
316 
317  /// Assign a value to Settingid data member.
318  ///
319  /// @param value
320  /// Value to assign
321  void SetSettingid(TSettingid value);
322 
323  /// Assign a value to Settingid data member.
324  ///
325  /// @return
326  /// Reference to the data value.
327  TSettingid& SetSettingid(void);
328 
329  /// allows users to flag certain
330  /// Check if a value has been assigned to Userannotation data member.
331  ///
332  /// Data member Userannotation is optional;
333  /// its type is defined as 'typedef int TUserannotation'
334  /// @return
335  /// - true, if a value has been assigned.
336  /// - false, otherwise.
337  bool IsSetUserannotation(void) const;
338 
339  /// Check if it is safe to call GetUserannotation method.
340  ///
341  /// @return
342  /// - true, if the data member is getatable.
343  /// - false, otherwise.
344  bool CanGetUserannotation(void) const;
345 
346  /// Reset Userannotation data member.
347  void ResetUserannotation(void);
348 
349  /// Get the Userannotation member data.
350  ///
351  /// @return
352  /// Copy of the member data.
353  TUserannotation GetUserannotation(void) const;
354 
355  /// Assign a value to Userannotation data member.
356  ///
357  /// @param value
358  /// Value to assign
359  void SetUserannotation(TUserannotation value);
360 
361  /// Assign a value to Userannotation data member.
362  ///
363  /// @return
364  /// Reference to the data value.
365  TUserannotation& SetUserannotation(void);
366 
367  /// Reset the whole object
368  virtual void Reset(void);
369 
370 
371 private:
372  // Prohibit copy constructor and assignment operator
375 
376  // data
377  Uint4 m_set_State[1];
378  int m_Number;
379  int m_Error;
380  vector< CRef< CMSHits > > m_Hits;
381  list< string > m_Ids;
382  list< CRef< CNameValue > > m_Namevalue;
385 };
386 
387 /* @} */
388 
389 
390 
391 
392 
393 ///////////////////////////////////////////////////////////
394 ///////////////////// inline methods //////////////////////
395 ///////////////////////////////////////////////////////////
396 inline
398 {
399  return ((m_set_State[0] & 0x3) != 0);
400 }
401 
402 inline
404 {
405  return IsSetNumber();
406 }
407 
408 inline
410 {
411  m_Number = 0;
412  m_set_State[0] &= ~0x3;
413 }
414 
415 inline
417 {
418  if (!CanGetNumber()) {
419  ThrowUnassigned(0);
420  }
421  return m_Number;
422 }
423 
424 inline
426 {
427  m_Number = value;
428  m_set_State[0] |= 0x3;
429 }
430 
431 inline
433 {
434 #ifdef _DEBUG
435  if (!IsSetNumber()) {
436  memset(&m_Number,UnassignedByte(),sizeof(m_Number));
437  }
438 #endif
439  m_set_State[0] |= 0x1;
440  return m_Number;
441 }
442 
443 inline
445 {
446  return ((m_set_State[0] & 0xc) != 0);
447 }
448 
449 inline
451 {
452  return IsSetError();
453 }
454 
455 inline
457 {
458  m_Error = (int)(0);
459  m_set_State[0] &= ~0xc;
460 }
461 
462 inline
464 {
465  if (!CanGetError()) {
466  ThrowUnassigned(1);
467  }
468  return m_Error;
469 }
470 
471 inline
473 {
474  m_Error = value;
475  m_set_State[0] |= 0xc;
476 }
477 
478 inline
480 {
481 #ifdef _DEBUG
482  if (!IsSetError()) {
483  memset(&m_Error,UnassignedByte(),sizeof(m_Error));
484  }
485 #endif
486  m_set_State[0] |= 0x4;
487  return m_Error;
488 }
489 
490 inline
492 {
493  return ((m_set_State[0] & 0x30) != 0);
494 }
495 
496 inline
498 {
499  return true;
500 }
501 
502 inline
504 {
505  return m_Hits;
506 }
507 
508 inline
510 {
511  m_set_State[0] |= 0x10;
512  return m_Hits;
513 }
514 
515 inline
516 bool CMSHitSet_Base::IsSetIds(void) const
517 {
518  return ((m_set_State[0] & 0xc0) != 0);
519 }
520 
521 inline
523 {
524  return true;
525 }
526 
527 inline
529 {
530  return m_Ids;
531 }
532 
533 inline
535 {
536  m_set_State[0] |= 0x40;
537  return m_Ids;
538 }
539 
540 inline
542 {
543  return ((m_set_State[0] & 0x300) != 0);
544 }
545 
546 inline
548 {
549  return true;
550 }
551 
552 inline
554 {
555  return m_Namevalue;
556 }
557 
558 inline
560 {
561  m_set_State[0] |= 0x100;
562  return m_Namevalue;
563 }
564 
565 inline
567 {
568  return ((m_set_State[0] & 0xc00) != 0);
569 }
570 
571 inline
573 {
574  return IsSetSettingid();
575 }
576 
577 inline
579 {
580  m_Settingid = 0;
581  m_set_State[0] &= ~0xc00;
582 }
583 
584 inline
586 {
587  if (!CanGetSettingid()) {
588  ThrowUnassigned(5);
589  }
590  return m_Settingid;
591 }
592 
593 inline
595 {
596  m_Settingid = value;
597  m_set_State[0] |= 0xc00;
598 }
599 
600 inline
602 {
603 #ifdef _DEBUG
604  if (!IsSetSettingid()) {
605  memset(&m_Settingid,UnassignedByte(),sizeof(m_Settingid));
606  }
607 #endif
608  m_set_State[0] |= 0x400;
609  return m_Settingid;
610 }
611 
612 inline
614 {
615  return ((m_set_State[0] & 0x3000) != 0);
616 }
617 
618 inline
620 {
621  return IsSetUserannotation();
622 }
623 
624 inline
626 {
627  m_Userannotation = (int)(0);
628  m_set_State[0] &= ~0x3000;
629 }
630 
631 inline
633 {
634  if (!CanGetUserannotation()) {
635  ThrowUnassigned(6);
636  }
637  return m_Userannotation;
638 }
639 
640 inline
642 {
644  m_set_State[0] |= 0x3000;
645 }
646 
647 inline
649 {
650 #ifdef _DEBUG
651  if (!IsSetUserannotation()) {
653  }
654 #endif
655  m_set_State[0] |= 0x1000;
656  return m_Userannotation;
657 }
658 
659 ///////////////////////////////////////////////////////////
660 ////////////////// end of inline methods //////////////////
661 ///////////////////////////////////////////////////////////
662 
663 
664 
665 
666 
667 END_objects_SCOPE // namespace ncbi::objects::
668 
670 
671 
672 #endif // OBJECTS_OMSSA_MSHITSET_BASE_HPP
User-defined methods of the data storage class.
User-defined methods of the data storage class.
contains a set of hits to a single spectrum
Definition: MSHitSet_.hpp:83
@MSHits.hpp User-defined methods of the data storage class.
Definition: MSHits.hpp:56
CNameValue –.
Definition: NameValue.hpp:66
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
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
TError & SetError(void)
Assign a value to Error data member.
Definition: MSHitSet_.hpp:479
CSerialObject Tparent
Definition: MSHitSet_.hpp:84
list< string > TIds
Definition: MSHitSet_.hpp:98
bool IsSetNumber(void) const
unique number of spectrum Check if a value has been assigned to Number data member.
Definition: MSHitSet_.hpp:397
CMSHitSet_Base & operator=(const CMSHitSet_Base &)
void ResetNumber(void)
Reset Number data member.
Definition: MSHitSet_.hpp:409
void ResetError(void)
Reset Error data member.
Definition: MSHitSet_.hpp:456
vector< CRef< CMSHits > > THits
Definition: MSHitSet_.hpp:97
const TNamevalue & GetNamevalue(void) const
Get the Namevalue member data.
Definition: MSHitSet_.hpp:553
list< CRef< CNameValue > > TNamevalue
Definition: MSHitSet_.hpp:99
bool CanGetIds(void) const
Check if it is safe to call GetIds method.
Definition: MSHitSet_.hpp:522
bool IsSetUserannotation(void) const
allows users to flag certain Check if a value has been assigned to Userannotation data member.
Definition: MSHitSet_.hpp:613
TNumber GetNumber(void) const
Get the Number member data.
Definition: MSHitSet_.hpp:416
bool IsSetSettingid(void) const
id of the search setting used Check if a value has been assigned to Settingid data member.
Definition: MSHitSet_.hpp:566
list< string > m_Ids
Definition: MSHitSet_.hpp:381
TSettingid GetSettingid(void) const
Get the Settingid member data.
Definition: MSHitSet_.hpp:585
Uint4 m_set_State[1]
Definition: MSHitSet_.hpp:377
TSettingid & SetSettingid(void)
Assign a value to Settingid data member.
Definition: MSHitSet_.hpp:601
TNamevalue & SetNamevalue(void)
Assign a value to Namevalue data member.
Definition: MSHitSet_.hpp:559
bool CanGetUserannotation(void) const
Check if it is safe to call GetUserannotation method.
Definition: MSHitSet_.hpp:619
bool CanGetError(void) const
Check if it is safe to call GetError method.
Definition: MSHitSet_.hpp:450
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
Definition: MSHitSet_.hpp:114
void ResetUserannotation(void)
Reset Userannotation data member.
Definition: MSHitSet_.hpp:625
TUserannotation GetUserannotation(void) const
Get the Userannotation member data.
Definition: MSHitSet_.hpp:632
vector< CRef< CMSHits > > m_Hits
Definition: MSHitSet_.hpp:380
DECLARE_INTERNAL_TYPE_INFO()
TIds & SetIds(void)
Assign a value to Ids data member.
Definition: MSHitSet_.hpp:534
bool CanGetNamevalue(void) const
Check if it is safe to call GetNamevalue method.
Definition: MSHitSet_.hpp:547
bool IsSetNamevalue(void) const
extra info: retention times, etc.
Definition: MSHitSet_.hpp:541
void ResetSettingid(void)
Reset Settingid data member.
Definition: MSHitSet_.hpp:578
bool CanGetNumber(void) const
Check if it is safe to call GetNumber method.
Definition: MSHitSet_.hpp:403
THits & SetHits(void)
Assign a value to Hits data member.
Definition: MSHitSet_.hpp:509
bool IsSetError(void) const
error, if any Check if a value has been assigned to Error data member.
Definition: MSHitSet_.hpp:444
bool IsSetHits(void) const
set of hit to spectrum Check if a value has been assigned to Hits data member.
Definition: MSHitSet_.hpp:491
bool IsSetIds(void) const
filenames or other ids of spectra searched Check if a value has been assigned to Ids data member.
Definition: MSHitSet_.hpp:516
bool CanGetHits(void) const
Check if it is safe to call GetHits method.
Definition: MSHitSet_.hpp:497
bool CanGetSettingid(void) const
Check if it is safe to call GetSettingid method.
Definition: MSHitSet_.hpp:572
TNumber & SetNumber(void)
Assign a value to Number data member.
Definition: MSHitSet_.hpp:432
TUserannotation & SetUserannotation(void)
Assign a value to Userannotation data member.
Definition: MSHitSet_.hpp:648
CMSHitSet_Base(const CMSHitSet_Base &)
const TIds & GetIds(void) const
Get the Ids member data.
Definition: MSHitSet_.hpp:528
TError GetError(void) const
Get the Error member data.
Definition: MSHitSet_.hpp:463
const THits & GetHits(void) const
Get the Hits member data.
Definition: MSHitSet_.hpp:503
list< CRef< CNameValue > > m_Namevalue
Definition: MSHitSet_.hpp:382
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
static bool GetIds(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
Modified on Sun Jul 21 04:17:29 2024 by modify_doxy.py rev. 669887