NCBI C++ ToolKit
Search_score_.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 Search_score_.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_SEARCH_SCORE_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_SEARCH_SCORE_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 ///
69 /// CSearch_score_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CSearch_score_Base(void);
78  // destructor
79  virtual ~CSearch_score_Base(void);
80 
81  // type info
83 
84  /////////////////////////////////////////////////////////////////////////////
85  ///
86  /// C_Attlist --
87  ///
88 
90  {
92  public:
93  // constructor
94  C_Attlist(void);
95  // destructor
96  ~C_Attlist(void);
97 
98  // type info
100 
101  // types
102  typedef string TName;
103  typedef string TValue;
104  typedef string TType;
105 
106  // member index
107  enum class E_memberIndex {
108  e__allMandatory = 0,
109  e_name,
110  e_value,
111  e_type
112  };
114 
115  // getters
116  // setters
117 
118  /// Check if a value has been assigned to Name data member.
119  ///
120  /// Data member Name is mandatory;
121  /// its type is defined as 'typedef string TName'
122  /// @return
123  /// - true, if a value has been assigned.
124  /// - false, otherwise.
125  bool IsSetName(void) const;
126 
127  /// Check if it is safe to call GetName method.
128  ///
129  /// @return
130  /// - true, if the data member is getatable.
131  /// - false, otherwise.
132  bool CanGetName(void) const;
133 
134  /// Reset Name data member.
135  void ResetName(void);
136 
137  /// Get the Name member data.
138  ///
139  /// @return
140  /// Reference to the member data.
141  const TName& GetName(void) const;
142 
143  /// Assign a value to Name data member.
144  ///
145  /// @param value
146  /// Value to assign
147  void SetName(const TName& value);
148  void SetName(TName&& value);
149 
150  /// Assign a value to Name data member.
151  ///
152  /// @return
153  /// Reference to the data value.
154  TName& SetName(void);
155 
156  /// Check if a value has been assigned to Value data member.
157  ///
158  /// Data member Value is mandatory;
159  /// its type is defined as 'typedef string TValue'
160  /// @return
161  /// - true, if a value has been assigned.
162  /// - false, otherwise.
163  bool IsSetValue(void) const;
164 
165  /// Check if it is safe to call GetValue method.
166  ///
167  /// @return
168  /// - true, if the data member is getatable.
169  /// - false, otherwise.
170  bool CanGetValue(void) const;
171 
172  /// Reset Value data member.
173  void ResetValue(void);
174 
175  /// Get the Value member data.
176  ///
177  /// @return
178  /// Reference to the member data.
179  const TValue& GetValue(void) const;
180 
181  /// Assign a value to Value data member.
182  ///
183  /// @param value
184  /// Value to assign
185  void SetValue(const TValue& value);
186  void SetValue(TValue&& value);
187 
188  /// Assign a value to Value data member.
189  ///
190  /// @return
191  /// Reference to the data value.
192  TValue& SetValue(void);
193 
194  /// Check if a value has been assigned to Type data member.
195  ///
196  /// Data member Type is optional;
197  /// its type is defined as 'typedef string TType'
198  /// @return
199  /// - true, if a value has been assigned.
200  /// - false, otherwise.
201  bool IsSetType(void) const;
202 
203  /// Check if it is safe to call GetType method.
204  ///
205  /// @return
206  /// - true, if the data member is getatable.
207  /// - false, otherwise.
208  bool CanGetType(void) const;
209 
210  /// Reset Type data member.
211  void ResetType(void);
212 
213  /// Get the Type member data.
214  ///
215  /// @return
216  /// Reference to the member data.
217  const TType& GetType(void) const;
218 
219  /// Assign a value to Type data member.
220  ///
221  /// @param value
222  /// Value to assign
223  void SetType(const TType& value);
224  void SetType(TType&& value);
225 
226  /// Assign a value to Type data member.
227  ///
228  /// @return
229  /// Reference to the data value.
230  TType& SetType(void);
231 
232  /// Reset the whole object
233  void Reset(void);
234 
235 
236  private:
237  // Prohibit copy constructor and assignment operator
240 
241  // data
242  Uint4 m_set_State[1];
243  string m_Name;
244  string m_Value;
245  string m_Type;
246  };
247  // types
249 
250  // member index
251  enum class E_memberIndex {
252  e__allMandatory = 0,
253  e_Attlist,
254  e_search_score
255  };
257 
258  // getters
259  // setters
260 
261  /// Check if a value has been assigned to Attlist data member.
262  ///
263  /// Data member Attlist is mandatory;
264  /// its type is defined as 'typedef C_Attlist TAttlist'
265  /// @return
266  /// - true, if a value has been assigned.
267  /// - false, otherwise.
268  bool IsSetAttlist(void) const;
269 
270  /// Check if it is safe to call GetAttlist method.
271  ///
272  /// @return
273  /// - true, if the data member is getatable.
274  /// - false, otherwise.
275  bool CanGetAttlist(void) const;
276 
277  /// Reset Attlist data member.
278  void ResetAttlist(void);
279 
280  /// Get the Attlist member data.
281  ///
282  /// @return
283  /// Reference to the member data.
284  const TAttlist& GetAttlist(void) const;
285 
286  /// Assign a value to Attlist data member.
287  ///
288  /// @param value
289  /// Reference to value.
290  void SetAttlist(TAttlist& value);
291 
292  /// Assign a value to Attlist data member.
293  ///
294  /// @return
295  /// Reference to the data value.
296  TAttlist& SetAttlist(void);
297 
298  /// Check if a value has been assigned to Search_score data member.
299  ///
300  /// Data member Search_score is mandatory
301  /// @return
302  /// - true, if a value has been assigned.
303  /// - false, otherwise.
304  bool IsSetSearch_score(void) const;
305 
306  /// Check if value of Search_score member is getatable.
307  ///
308  /// @return
309  /// - false; the data member of type 'NULL' has no value.
310  bool CanGetSearch_score(void) const;
311 
312  /// Reset Search_score data member.
313  void ResetSearch_score(void);
314 
315  /// Set NULL data member (assign 'NULL' value to Search_score data member).
316  void SetSearch_score(void);
317 
318  /// Reset the whole object
319  virtual void Reset(void);
320 
321 
322 private:
323  // Prohibit copy constructor and assignment operator
326 
327  // data
328  Uint4 m_set_State[1];
330 };
331 
332 /* @} */
333 
334 
335 
336 
337 
338 ///////////////////////////////////////////////////////////
339 ///////////////////// inline methods //////////////////////
340 ///////////////////////////////////////////////////////////
341 inline
343 {
344  return ((m_set_State[0] & 0x3) != 0);
345 }
346 
347 inline
349 {
350  return IsSetName();
351 }
352 
353 inline
355 {
356  if (!CanGetName()) {
357  ThrowUnassigned(0);
358  }
359  return m_Name;
360 }
361 
362 inline
364 {
365  m_Name = value;
366  m_set_State[0] |= 0x3;
367 }
368 
369 inline
371 {
372  m_Name = std::forward<CSearch_score_Base::C_Attlist::TName>(value);
373  m_set_State[0] |= 0x3;
374 }
375 
376 inline
378 {
379 #ifdef _DEBUG
380  if (!IsSetName()) {
381  m_Name = UnassignedString();
382  }
383 #endif
384  m_set_State[0] |= 0x1;
385  return m_Name;
386 }
387 
388 inline
390 {
391  return ((m_set_State[0] & 0xc) != 0);
392 }
393 
394 inline
396 {
397  return IsSetValue();
398 }
399 
400 inline
402 {
403  if (!CanGetValue()) {
404  ThrowUnassigned(1);
405  }
406  return m_Value;
407 }
408 
409 inline
411 {
412  m_Value = value;
413  m_set_State[0] |= 0xc;
414 }
415 
416 inline
418 {
419  m_Value = std::forward<CSearch_score_Base::C_Attlist::TValue>(value);
420  m_set_State[0] |= 0xc;
421 }
422 
423 inline
425 {
426 #ifdef _DEBUG
427  if (!IsSetValue()) {
428  m_Value = UnassignedString();
429  }
430 #endif
431  m_set_State[0] |= 0x4;
432  return m_Value;
433 }
434 
435 inline
437 {
438  return ((m_set_State[0] & 0x30) != 0);
439 }
440 
441 inline
443 {
444  return IsSetType();
445 }
446 
447 inline
449 {
450  if (!CanGetType()) {
451  ThrowUnassigned(2);
452  }
453  return m_Type;
454 }
455 
456 inline
458 {
459  m_Type = value;
460  m_set_State[0] |= 0x30;
461 }
462 
463 inline
465 {
466  m_Type = std::forward<CSearch_score_Base::C_Attlist::TType>(value);
467  m_set_State[0] |= 0x30;
468 }
469 
470 inline
472 {
473 #ifdef _DEBUG
474  if (!IsSetType()) {
475  m_Type = UnassignedString();
476  }
477 #endif
478  m_set_State[0] |= 0x10;
479  return m_Type;
480 }
481 
482 inline
484 {
485  return m_Attlist.NotEmpty();
486 }
487 
488 inline
490 {
491  return true;
492 }
493 
494 inline
496 {
497  if ( !m_Attlist ) {
498  const_cast<CSearch_score_Base*>(this)->ResetAttlist();
499  }
500  return (*m_Attlist);
501 }
502 
503 inline
505 {
506  if ( !m_Attlist ) {
507  ResetAttlist();
508  }
509  SetSearch_score();
510  return (*m_Attlist);
511 }
512 
513 inline
515 {
516  return ((m_set_State[0] & 0xc) != 0);
517 }
518 
519 inline
521 {
522  return false;
523 }
524 
525 inline
527 {
528  m_set_State[0] &= ~0xc;
529 }
530 
531 inline
533 {
534  m_set_State[0] |= 0xc;
535 }
536 
537 ///////////////////////////////////////////////////////////
538 ////////////////// end of inline methods //////////////////
539 ///////////////////////////////////////////////////////////
540 
541 
542 
543 
544 
545 END_objects_SCOPE // namespace ncbi::objects::
546 
548 
549 
550 #endif // ALGO_MS_FORMATS_PEPXML_SEARCH_SCORE_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
CSearch_score_Base –.
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_PEPXML_EXPORT
Definition: ncbi_export.h:696
bool CanGetSearch_score(void) const
Check if value of Search_score member is getatable.
const TType & GetType(void) const
Get the Type member data.
void SetSearch_score(void)
Set NULL data member (assign 'NULL' value to Search_score data member).
TType & SetType(void)
Assign a value to Type data member.
C_Attlist(const C_Attlist &)
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
TName & SetName(void)
Assign a value to Name data member.
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
CSearch_score_Base(const CSearch_score_Base &)
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
CSearch_score_Base & operator=(const CSearch_score_Base &)
TValue & SetValue(void)
Assign a value to Value data member.
void ResetSearch_score(void)
Reset Search_score data member.
bool CanGetName(void) const
Check if it is safe to call GetName method.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
C_Attlist & operator=(const C_Attlist &)
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
CSerialObject Tparent
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
const TName & GetName(void) const
Get the Name member data.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
const TValue & GetValue(void) const
Get the Value member data.
bool IsSetSearch_score(void) const
Check if a value has been assigned to Search_score data member.
void ResetAttlist(void)
Reset Attlist data member.
bool CanGetValue(void) const
Check if it is safe to call GetValue method.
bool IsSetValue(void) const
Check if a value has been assigned to Value data member.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
bool CanGetType(void) const
Check if it is safe to call GetType method.
CRef< TAttlist > m_Attlist
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:05:57 2024 by modify_doxy.py rev. 669887