NCBI C++ ToolKit
MSRequest_.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 MSRequest_.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_MSREQUEST_BASE_HPP
42 #define OBJECTS_OMSSA_MSREQUEST_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 // forward declarations
60 class CMSModSpecSet;
61 class CMSSearchSettings;
63 class CMSSpectrumset;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_OMSSA
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 /// The search request that is given to the OMSSA algorithm
76 ///
77 /// CMSRequest_Base --
78 ///
79 
81 {
83 public:
84  // constructor
85  CMSRequest_Base(void);
86  // destructor
87  virtual ~CMSRequest_Base(void);
88 
89  // type info
91 
92  // types
95  typedef string TRid;
98 
99  // member index
100  enum class E_memberIndex {
101  e__allMandatory = 0,
102  e_spectra,
103  e_settings,
104  e_rid,
105  e_moresettings,
106  e_modset
107  };
109 
110  // getters
111  // setters
112 
113  /// the set of spectra
114  /// Check if a value has been assigned to Spectra data member.
115  ///
116  /// Data member Spectra is mandatory;
117  /// its type is defined as 'typedef CMSSpectrumset TSpectra'
118  /// @return
119  /// - true, if a value has been assigned.
120  /// - false, otherwise.
121  bool IsSetSpectra(void) const;
122 
123  /// Check if it is safe to call GetSpectra method.
124  ///
125  /// @return
126  /// - true, if the data member is getatable.
127  /// - false, otherwise.
128  bool CanGetSpectra(void) const;
129 
130  /// Reset Spectra data member.
131  void ResetSpectra(void);
132 
133  /// Get the Spectra member data.
134  ///
135  /// @return
136  /// Reference to the member data.
137  const TSpectra& GetSpectra(void) const;
138 
139  /// Assign a value to Spectra data member.
140  ///
141  /// @param value
142  /// Reference to value.
143  void SetSpectra(TSpectra& value);
144 
145  /// Assign a value to Spectra data member.
146  ///
147  /// @return
148  /// Reference to the data value.
149  TSpectra& SetSpectra(void);
150 
151  /// the search settings
152  /// Check if a value has been assigned to Settings data member.
153  ///
154  /// Data member Settings is mandatory;
155  /// its type is defined as 'typedef CMSSearchSettings TSettings'
156  /// @return
157  /// - true, if a value has been assigned.
158  /// - false, otherwise.
159  bool IsSetSettings(void) const;
160 
161  /// Check if it is safe to call GetSettings method.
162  ///
163  /// @return
164  /// - true, if the data member is getatable.
165  /// - false, otherwise.
166  bool CanGetSettings(void) const;
167 
168  /// Reset Settings data member.
169  void ResetSettings(void);
170 
171  /// Get the Settings member data.
172  ///
173  /// @return
174  /// Reference to the member data.
175  const TSettings& GetSettings(void) const;
176 
177  /// Assign a value to Settings data member.
178  ///
179  /// @param value
180  /// Reference to value.
181  void SetSettings(TSettings& value);
182 
183  /// Assign a value to Settings data member.
184  ///
185  /// @return
186  /// Reference to the data value.
187  TSettings& SetSettings(void);
188 
189  /// request id
190  /// Check if a value has been assigned to Rid data member.
191  ///
192  /// Data member Rid is optional;
193  /// its type is defined as 'typedef string TRid'
194  /// @return
195  /// - true, if a value has been assigned.
196  /// - false, otherwise.
197  bool IsSetRid(void) const;
198 
199  /// Check if it is safe to call GetRid method.
200  ///
201  /// @return
202  /// - true, if the data member is getatable.
203  /// - false, otherwise.
204  bool CanGetRid(void) const;
205 
206  /// Reset Rid data member.
207  void ResetRid(void);
208 
209  /// Get the Rid member data.
210  ///
211  /// @return
212  /// Reference to the member data.
213  const TRid& GetRid(void) const;
214 
215  /// Assign a value to Rid data member.
216  ///
217  /// @param value
218  /// Value to assign
219  void SetRid(const TRid& value);
220  void SetRid(TRid&& value);
221 
222  /// Assign a value to Rid data member.
223  ///
224  /// @return
225  /// Reference to the data value.
226  TRid& SetRid(void);
227 
228  /// additional search runs
229  /// Check if a value has been assigned to Moresettings data member.
230  ///
231  /// Data member Moresettings is optional;
232  /// its type is defined as 'typedef CMSSearchSettingsSet TMoresettings'
233  /// @return
234  /// - true, if a value has been assigned.
235  /// - false, otherwise.
236  bool IsSetMoresettings(void) const;
237 
238  /// Check if it is safe to call GetMoresettings method.
239  ///
240  /// @return
241  /// - true, if the data member is getatable.
242  /// - false, otherwise.
243  bool CanGetMoresettings(void) const;
244 
245  /// Reset Moresettings data member.
246  void ResetMoresettings(void);
247 
248  /// Get the Moresettings member data.
249  ///
250  /// @return
251  /// Reference to the member data.
252  const TMoresettings& GetMoresettings(void) const;
253 
254  /// Assign a value to Moresettings data member.
255  ///
256  /// @param value
257  /// Reference to value.
258  void SetMoresettings(TMoresettings& value);
259 
260  /// Assign a value to Moresettings data member.
261  ///
262  /// @return
263  /// Reference to the data value.
264  TMoresettings& SetMoresettings(void);
265 
266  /// list of mods that can be used in search
267  /// Check if a value has been assigned to Modset data member.
268  ///
269  /// Data member Modset is optional;
270  /// its type is defined as 'typedef CMSModSpecSet TModset'
271  /// @return
272  /// - true, if a value has been assigned.
273  /// - false, otherwise.
274  bool IsSetModset(void) const;
275 
276  /// Check if it is safe to call GetModset method.
277  ///
278  /// @return
279  /// - true, if the data member is getatable.
280  /// - false, otherwise.
281  bool CanGetModset(void) const;
282 
283  /// Reset Modset data member.
284  void ResetModset(void);
285 
286  /// Get the Modset member data.
287  ///
288  /// @return
289  /// Reference to the member data.
290  const TModset& GetModset(void) const;
291 
292  /// Assign a value to Modset data member.
293  ///
294  /// @param value
295  /// Reference to value.
296  void SetModset(TModset& value);
297 
298  /// Assign a value to Modset data member.
299  ///
300  /// @return
301  /// Reference to the data value.
302  TModset& SetModset(void);
303 
304  /// Reset the whole object
305  virtual void Reset(void);
306 
307 
308 private:
309  // Prohibit copy constructor and assignment operator
312 
313  // data
314  Uint4 m_set_State[1];
317  string m_Rid;
320 };
321 
322 /* @} */
323 
324 
325 
326 
327 
328 ///////////////////////////////////////////////////////////
329 ///////////////////// inline methods //////////////////////
330 ///////////////////////////////////////////////////////////
331 inline
333 {
334  return m_Spectra.NotEmpty();
335 }
336 
337 inline
339 {
340  return true;
341 }
342 
343 inline
345 {
346  if ( !m_Spectra ) {
347  const_cast<CMSRequest_Base*>(this)->ResetSpectra();
348  }
349  return (*m_Spectra);
350 }
351 
352 inline
354 {
355  if ( !m_Spectra ) {
356  ResetSpectra();
357  }
358  return (*m_Spectra);
359 }
360 
361 inline
363 {
364  return m_Settings.NotEmpty();
365 }
366 
367 inline
369 {
370  return true;
371 }
372 
373 inline
375 {
376  if ( !m_Settings ) {
377  const_cast<CMSRequest_Base*>(this)->ResetSettings();
378  }
379  return (*m_Settings);
380 }
381 
382 inline
384 {
385  if ( !m_Settings ) {
386  ResetSettings();
387  }
388  return (*m_Settings);
389 }
390 
391 inline
393 {
394  return ((m_set_State[0] & 0x30) != 0);
395 }
396 
397 inline
399 {
400  return IsSetRid();
401 }
402 
403 inline
405 {
406  if (!CanGetRid()) {
407  ThrowUnassigned(2);
408  }
409  return m_Rid;
410 }
411 
412 inline
414 {
415  m_Rid = value;
416  m_set_State[0] |= 0x30;
417 }
418 
419 inline
421 {
422  m_Rid = std::forward<CMSRequest_Base::TRid>(value);
423  m_set_State[0] |= 0x30;
424 }
425 
426 inline
428 {
429 #ifdef _DEBUG
430  if (!IsSetRid()) {
432  }
433 #endif
434  m_set_State[0] |= 0x10;
435  return m_Rid;
436 }
437 
438 inline
440 {
441  return m_Moresettings.NotEmpty();
442 }
443 
444 inline
446 {
447  return IsSetMoresettings();
448 }
449 
450 inline
452 {
453  if (!CanGetMoresettings()) {
454  ThrowUnassigned(3);
455  }
456  return (*m_Moresettings);
457 }
458 
459 inline
461 {
462  return m_Modset.NotEmpty();
463 }
464 
465 inline
467 {
468  return IsSetModset();
469 }
470 
471 inline
473 {
474  if (!CanGetModset()) {
475  ThrowUnassigned(4);
476  }
477  return (*m_Modset);
478 }
479 
480 ///////////////////////////////////////////////////////////
481 ////////////////// end of inline methods //////////////////
482 ///////////////////////////////////////////////////////////
483 
484 
485 
486 
487 
488 END_objects_SCOPE // namespace ncbi::objects::
489 
491 
492 
493 #endif // OBJECTS_OMSSA_MSREQUEST_BASE_HPP
@MSModSpecSet.hpp User-defined methods of the data storage class.
The search request that is given to the OMSSA algorithm.
Definition: MSRequest_.hpp:81
CMSSearchSettingsSet –.
@MSSearchSettings.hpp User-defined methods of the data storage class.
CMSSpectrumset –.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
bool CanGetSpectra(void) const
Check if it is safe to call GetSpectra method.
Definition: MSRequest_.hpp:338
bool CanGetModset(void) const
Check if it is safe to call GetModset method.
Definition: MSRequest_.hpp:466
TRid & SetRid(void)
Assign a value to Rid data member.
Definition: MSRequest_.hpp:427
TSettings & SetSettings(void)
Assign a value to Settings data member.
Definition: MSRequest_.hpp:383
CMSRequest_Base(const CMSRequest_Base &)
CMSSearchSettingsSet TMoresettings
Definition: MSRequest_.hpp:96
CSerialObject Tparent
Definition: MSRequest_.hpp:82
CRef< TSpectra > m_Spectra
Definition: MSRequest_.hpp:315
bool CanGetMoresettings(void) const
Check if it is safe to call GetMoresettings method.
Definition: MSRequest_.hpp:445
bool IsSetMoresettings(void) const
additional search runs Check if a value has been assigned to Moresettings data member.
Definition: MSRequest_.hpp:439
const TSettings & GetSettings(void) const
Get the Settings member data.
Definition: MSRequest_.hpp:374
CRef< TSettings > m_Settings
Definition: MSRequest_.hpp:316
CRef< TMoresettings > m_Moresettings
Definition: MSRequest_.hpp:318
bool IsSetSpectra(void) const
the set of spectra Check if a value has been assigned to Spectra data member.
Definition: MSRequest_.hpp:332
bool IsSetRid(void) const
request id Check if a value has been assigned to Rid data member.
Definition: MSRequest_.hpp:392
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
Definition: MSRequest_.hpp:108
CMSRequest_Base & operator=(const CMSRequest_Base &)
bool CanGetRid(void) const
Check if it is safe to call GetRid method.
Definition: MSRequest_.hpp:398
const TModset & GetModset(void) const
Get the Modset member data.
Definition: MSRequest_.hpp:472
bool IsSetSettings(void) const
the search settings Check if a value has been assigned to Settings data member.
Definition: MSRequest_.hpp:362
CMSModSpecSet TModset
Definition: MSRequest_.hpp:97
bool CanGetSettings(void) const
Check if it is safe to call GetSettings method.
Definition: MSRequest_.hpp:368
const TRid & GetRid(void) const
Get the Rid member data.
Definition: MSRequest_.hpp:404
const TSpectra & GetSpectra(void) const
Get the Spectra member data.
Definition: MSRequest_.hpp:344
void ResetSpectra(void)
Reset Spectra data member.
Definition: MSRequest_.cpp:54
void ResetSettings(void)
Reset Settings data member.
Definition: MSRequest_.cpp:68
const TMoresettings & GetMoresettings(void) const
Get the Moresettings member data.
Definition: MSRequest_.hpp:451
TSpectra & SetSpectra(void)
Assign a value to Spectra data member.
Definition: MSRequest_.hpp:353
bool IsSetModset(void) const
list of mods that can be used in search Check if a value has been assigned to Modset data member.
Definition: MSRequest_.hpp:460
CMSSearchSettings TSettings
Definition: MSRequest_.hpp:94
CRef< TModset > m_Modset
Definition: MSRequest_.hpp:319
CMSSpectrumset TSpectra
Definition: MSRequest_.hpp:93
Uint4 m_set_State[1]
Definition: MSRequest_.hpp:314
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:15 2024 by modify_doxy.py rev. 669887