NCBI C++ ToolKit
Data_filter_.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 Data_filter_.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_DATA_FILTER_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_DATA_FILTER_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 /// CData_filter_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CData_filter_Base(void);
78  // destructor
79  virtual ~CData_filter_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 int TNumber;
103  typedef string TParent_file;
104  typedef string TWindows_parent;
105  typedef string TDescription;
106 
107  // member index
108  enum class E_memberIndex {
109  e__allMandatory = 0,
110  e_number,
111  e_parent_file,
112  e_windows_parent,
113  e_description
114  };
116 
117  // getters
118  // setters
119 
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  /// Check if a value has been assigned to Parent_file data member.
158  ///
159  /// Data member Parent_file is mandatory;
160  /// its type is defined as 'typedef string TParent_file'
161  /// @return
162  /// - true, if a value has been assigned.
163  /// - false, otherwise.
164  bool IsSetParent_file(void) const;
165 
166  /// Check if it is safe to call GetParent_file method.
167  ///
168  /// @return
169  /// - true, if the data member is getatable.
170  /// - false, otherwise.
171  bool CanGetParent_file(void) const;
172 
173  /// Reset Parent_file data member.
174  void ResetParent_file(void);
175 
176  /// Get the Parent_file member data.
177  ///
178  /// @return
179  /// Reference to the member data.
180  const TParent_file& GetParent_file(void) const;
181 
182  /// Assign a value to Parent_file data member.
183  ///
184  /// @param value
185  /// Value to assign
186  void SetParent_file(const TParent_file& value);
187  void SetParent_file(TParent_file&& value);
188 
189  /// Assign a value to Parent_file data member.
190  ///
191  /// @return
192  /// Reference to the data value.
193  TParent_file& SetParent_file(void);
194 
195  /// Check if a value has been assigned to Windows_parent data member.
196  ///
197  /// Data member Windows_parent is optional;
198  /// its type is defined as 'typedef string TWindows_parent'
199  /// @return
200  /// - true, if a value has been assigned.
201  /// - false, otherwise.
202  bool IsSetWindows_parent(void) const;
203 
204  /// Check if it is safe to call GetWindows_parent method.
205  ///
206  /// @return
207  /// - true, if the data member is getatable.
208  /// - false, otherwise.
209  bool CanGetWindows_parent(void) const;
210 
211  /// Reset Windows_parent data member.
212  void ResetWindows_parent(void);
213 
214  /// Get the Windows_parent member data.
215  ///
216  /// @return
217  /// Reference to the member data.
218  const TWindows_parent& GetWindows_parent(void) const;
219 
220  /// Assign a value to Windows_parent data member.
221  ///
222  /// @param value
223  /// Value to assign
224  void SetWindows_parent(const TWindows_parent& value);
225  void SetWindows_parent(TWindows_parent&& value);
226 
227  /// Assign a value to Windows_parent data member.
228  ///
229  /// @return
230  /// Reference to the data value.
231  TWindows_parent& SetWindows_parent(void);
232 
233  /// Check if a value has been assigned to Description data member.
234  ///
235  /// Data member Description is mandatory;
236  /// its type is defined as 'typedef string TDescription'
237  /// @return
238  /// - true, if a value has been assigned.
239  /// - false, otherwise.
240  bool IsSetDescription(void) const;
241 
242  /// Check if it is safe to call GetDescription method.
243  ///
244  /// @return
245  /// - true, if the data member is getatable.
246  /// - false, otherwise.
247  bool CanGetDescription(void) const;
248 
249  /// Reset Description data member.
250  void ResetDescription(void);
251 
252  /// Get the Description member data.
253  ///
254  /// @return
255  /// Reference to the member data.
256  const TDescription& GetDescription(void) const;
257 
258  /// Assign a value to Description data member.
259  ///
260  /// @param value
261  /// Value to assign
262  void SetDescription(const TDescription& value);
263  void SetDescription(TDescription&& value);
264 
265  /// Assign a value to Description data member.
266  ///
267  /// @return
268  /// Reference to the data value.
269  TDescription& SetDescription(void);
270 
271  /// Reset the whole object
272  void Reset(void);
273 
274 
275  private:
276  // Prohibit copy constructor and assignment operator
279 
280  // data
281  Uint4 m_set_State[1];
282  int m_Number;
286  };
287  // types
289 
290  // member index
291  enum class E_memberIndex {
292  e__allMandatory = 0,
293  e_Attlist,
294  e_data_filter
295  };
297 
298  // getters
299  // setters
300 
301  /// Check if a value has been assigned to Attlist data member.
302  ///
303  /// Data member Attlist is mandatory;
304  /// its type is defined as 'typedef C_Attlist TAttlist'
305  /// @return
306  /// - true, if a value has been assigned.
307  /// - false, otherwise.
308  bool IsSetAttlist(void) const;
309 
310  /// Check if it is safe to call GetAttlist method.
311  ///
312  /// @return
313  /// - true, if the data member is getatable.
314  /// - false, otherwise.
315  bool CanGetAttlist(void) const;
316 
317  /// Reset Attlist data member.
318  void ResetAttlist(void);
319 
320  /// Get the Attlist member data.
321  ///
322  /// @return
323  /// Reference to the member data.
324  const TAttlist& GetAttlist(void) const;
325 
326  /// Assign a value to Attlist data member.
327  ///
328  /// @param value
329  /// Reference to value.
330  void SetAttlist(TAttlist& value);
331 
332  /// Assign a value to Attlist data member.
333  ///
334  /// @return
335  /// Reference to the data value.
336  TAttlist& SetAttlist(void);
337 
338  /// Check if a value has been assigned to Data_filter data member.
339  ///
340  /// Data member Data_filter is mandatory
341  /// @return
342  /// - true, if a value has been assigned.
343  /// - false, otherwise.
344  bool IsSetData_filter(void) const;
345 
346  /// Check if value of Data_filter member is getatable.
347  ///
348  /// @return
349  /// - false; the data member of type 'NULL' has no value.
350  bool CanGetData_filter(void) const;
351 
352  /// Reset Data_filter data member.
353  void ResetData_filter(void);
354 
355  /// Set NULL data member (assign 'NULL' value to Data_filter data member).
356  void SetData_filter(void);
357 
358  /// Reset the whole object
359  virtual void Reset(void);
360 
361 
362 private:
363  // Prohibit copy constructor and assignment operator
366 
367  // data
368  Uint4 m_set_State[1];
370 };
371 
372 /* @} */
373 
374 
375 
376 
377 
378 ///////////////////////////////////////////////////////////
379 ///////////////////// inline methods //////////////////////
380 ///////////////////////////////////////////////////////////
381 inline
383 {
384  return ((m_set_State[0] & 0x3) != 0);
385 }
386 
387 inline
389 {
390  return IsSetNumber();
391 }
392 
393 inline
395 {
396  m_Number = 0;
397  m_set_State[0] &= ~0x3;
398 }
399 
400 inline
402 {
403  if (!CanGetNumber()) {
404  ThrowUnassigned(0);
405  }
406  return m_Number;
407 }
408 
409 inline
411 {
412  m_Number = value;
413  m_set_State[0] |= 0x3;
414 }
415 
416 inline
418 {
419 #ifdef _DEBUG
420  if (!IsSetNumber()) {
421  memset(&m_Number,UnassignedByte(),sizeof(m_Number));
422  }
423 #endif
424  m_set_State[0] |= 0x1;
425  return m_Number;
426 }
427 
428 inline
430 {
431  return ((m_set_State[0] & 0xc) != 0);
432 }
433 
434 inline
436 {
437  return IsSetParent_file();
438 }
439 
440 inline
442 {
443  if (!CanGetParent_file()) {
444  ThrowUnassigned(1);
445  }
446  return m_Parent_file;
447 }
448 
449 inline
451 {
452  m_Parent_file = value;
453  m_set_State[0] |= 0xc;
454 }
455 
456 inline
458 {
459  m_Parent_file = std::forward<CData_filter_Base::C_Attlist::TParent_file>(value);
460  m_set_State[0] |= 0xc;
461 }
462 
463 inline
465 {
466 #ifdef _DEBUG
467  if (!IsSetParent_file()) {
468  m_Parent_file = UnassignedString();
469  }
470 #endif
471  m_set_State[0] |= 0x4;
472  return m_Parent_file;
473 }
474 
475 inline
477 {
478  return ((m_set_State[0] & 0x30) != 0);
479 }
480 
481 inline
483 {
484  return IsSetWindows_parent();
485 }
486 
487 inline
489 {
490  if (!CanGetWindows_parent()) {
491  ThrowUnassigned(2);
492  }
493  return m_Windows_parent;
494 }
495 
496 inline
498 {
499  m_Windows_parent = value;
500  m_set_State[0] |= 0x30;
501 }
502 
503 inline
505 {
506  m_Windows_parent = std::forward<CData_filter_Base::C_Attlist::TWindows_parent>(value);
507  m_set_State[0] |= 0x30;
508 }
509 
510 inline
512 {
513 #ifdef _DEBUG
514  if (!IsSetWindows_parent()) {
515  m_Windows_parent = UnassignedString();
516  }
517 #endif
518  m_set_State[0] |= 0x10;
519  return m_Windows_parent;
520 }
521 
522 inline
524 {
525  return ((m_set_State[0] & 0xc0) != 0);
526 }
527 
528 inline
530 {
531  return IsSetDescription();
532 }
533 
534 inline
536 {
537  if (!CanGetDescription()) {
538  ThrowUnassigned(3);
539  }
540  return m_Description;
541 }
542 
543 inline
545 {
546  m_Description = value;
547  m_set_State[0] |= 0xc0;
548 }
549 
550 inline
552 {
553  m_Description = std::forward<CData_filter_Base::C_Attlist::TDescription>(value);
554  m_set_State[0] |= 0xc0;
555 }
556 
557 inline
559 {
560 #ifdef _DEBUG
561  if (!IsSetDescription()) {
562  m_Description = UnassignedString();
563  }
564 #endif
565  m_set_State[0] |= 0x40;
566  return m_Description;
567 }
568 
569 inline
571 {
572  return m_Attlist.NotEmpty();
573 }
574 
575 inline
577 {
578  return true;
579 }
580 
581 inline
583 {
584  if ( !m_Attlist ) {
585  const_cast<CData_filter_Base*>(this)->ResetAttlist();
586  }
587  return (*m_Attlist);
588 }
589 
590 inline
592 {
593  if ( !m_Attlist ) {
594  ResetAttlist();
595  }
596  SetData_filter();
597  return (*m_Attlist);
598 }
599 
600 inline
602 {
603  return ((m_set_State[0] & 0xc) != 0);
604 }
605 
606 inline
608 {
609  return false;
610 }
611 
612 inline
614 {
615  m_set_State[0] &= ~0xc;
616 }
617 
618 inline
620 {
621  m_set_State[0] |= 0xc;
622 }
623 
624 ///////////////////////////////////////////////////////////
625 ////////////////// end of inline methods //////////////////
626 ///////////////////////////////////////////////////////////
627 
628 
629 
630 
631 
632 END_objects_SCOPE // namespace ncbi::objects::
633 
635 
636 
637 #endif // ALGO_MS_FORMATS_PEPXML_DATA_FILTER_BASE_HPP
CData_filter_Base –.
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_PEPXML_EXPORT
Definition: ncbi_export.h:696
C_Attlist & operator=(const C_Attlist &)
bool CanGetParent_file(void) const
Check if it is safe to call GetParent_file method.
bool IsSetData_filter(void) const
Check if a value has been assigned to Data_filter data member.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
bool IsSetDescription(void) const
Check if a value has been assigned to Description data member.
void ResetNumber(void)
Reset Number data member.
CData_filter_Base(const CData_filter_Base &)
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
bool CanGetData_filter(void) const
Check if value of Data_filter member is getatable.
void ResetData_filter(void)
Reset Data_filter data member.
const TWindows_parent & GetWindows_parent(void) const
Get the Windows_parent member data.
const TDescription & GetDescription(void) const
Get the Description member data.
TParent_file & SetParent_file(void)
Assign a value to Parent_file data member.
bool IsSetWindows_parent(void) const
Check if a value has been assigned to Windows_parent data member.
void SetData_filter(void)
Set NULL data member (assign 'NULL' value to Data_filter data member).
CRef< TAttlist > m_Attlist
bool CanGetNumber(void) const
Check if it is safe to call GetNumber method.
CData_filter_Base & operator=(const CData_filter_Base &)
bool CanGetDescription(void) const
Check if it is safe to call GetDescription method.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
TNumber & SetNumber(void)
Assign a value to Number data member.
bool IsSetParent_file(void) const
Check if a value has been assigned to Parent_file data member.
C_Attlist(const C_Attlist &)
TNumber GetNumber(void) const
Get the Number member data.
const TParent_file & GetParent_file(void) const
Get the Parent_file member data.
CSerialObject Tparent
TWindows_parent & SetWindows_parent(void)
Assign a value to Windows_parent data member.
void ResetAttlist(void)
Reset Attlist data member.
bool IsSetNumber(void) const
Check if a value has been assigned to Number data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool CanGetWindows_parent(void) const
Check if it is safe to call GetWindows_parent method.
TDescription & SetDescription(void)
Assign a value to Description data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:55 2024 by modify_doxy.py rev. 669887