NCBI C++ ToolKit
Affected_channel_.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 Affected_channel_.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_AFFECTED_CHANNEL_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_AFFECTED_CHANNEL_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // generated classes
56 
57 
58 /** @addtogroup dataspec_pepXML
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 /// ============================================
65 /// This section is mapped from module "pepXML"
66 ///=================================================
67 ///channel recipient
68 ///
69 /// CAffected_channel_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CAffected_channel_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 TChannel;
103  typedef double TCorrection;
104 
105  // member index
106  enum class E_memberIndex {
107  e__allMandatory = 0,
108  e_channel,
109  e_correction
110  };
112 
113  // getters
114  // setters
115 
116  /// Check if a value has been assigned to Channel data member.
117  ///
118  /// Data member Channel is mandatory;
119  /// its type is defined as 'typedef int TChannel'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetChannel(void) const;
124 
125  /// Check if it is safe to call GetChannel method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetChannel(void) const;
131 
132  /// Reset Channel data member.
133  void ResetChannel(void);
134 
135  /// Get the Channel member data.
136  ///
137  /// @return
138  /// Copy of the member data.
139  TChannel GetChannel(void) const;
140 
141  /// Assign a value to Channel data member.
142  ///
143  /// @param value
144  /// Value to assign
145  void SetChannel(TChannel value);
146 
147  /// Assign a value to Channel data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TChannel& SetChannel(void);
152 
153  /// Check if a value has been assigned to Correction data member.
154  ///
155  /// Data member Correction is mandatory;
156  /// its type is defined as 'typedef double TCorrection'
157  /// @return
158  /// - true, if a value has been assigned.
159  /// - false, otherwise.
160  bool IsSetCorrection(void) const;
161 
162  /// Check if it is safe to call GetCorrection method.
163  ///
164  /// @return
165  /// - true, if the data member is getatable.
166  /// - false, otherwise.
167  bool CanGetCorrection(void) const;
168 
169  /// Reset Correction data member.
170  void ResetCorrection(void);
171 
172  /// Get the Correction member data.
173  ///
174  /// @return
175  /// Copy of the member data.
176  TCorrection GetCorrection(void) const;
177 
178  /// Assign a value to Correction data member.
179  ///
180  /// @param value
181  /// Value to assign
182  void SetCorrection(TCorrection value);
183 
184  /// Assign a value to Correction data member.
185  ///
186  /// @return
187  /// Reference to the data value.
188  TCorrection& SetCorrection(void);
189 
190  /// Reset the whole object
191  void Reset(void);
192 
193 
194  private:
195  // Prohibit copy constructor and assignment operator
198 
199  // data
200  Uint4 m_set_State[1];
202  double m_Correction;
203  };
204  // types
206 
207  // member index
208  enum class E_memberIndex {
209  e__allMandatory = 0,
210  e_Attlist,
211  e_affected_channel
212  };
214 
215  // getters
216  // setters
217 
218  /// Check if a value has been assigned to Attlist data member.
219  ///
220  /// Data member Attlist is mandatory;
221  /// its type is defined as 'typedef C_Attlist TAttlist'
222  /// @return
223  /// - true, if a value has been assigned.
224  /// - false, otherwise.
225  bool IsSetAttlist(void) const;
226 
227  /// Check if it is safe to call GetAttlist method.
228  ///
229  /// @return
230  /// - true, if the data member is getatable.
231  /// - false, otherwise.
232  bool CanGetAttlist(void) const;
233 
234  /// Reset Attlist data member.
235  void ResetAttlist(void);
236 
237  /// Get the Attlist member data.
238  ///
239  /// @return
240  /// Reference to the member data.
241  const TAttlist& GetAttlist(void) const;
242 
243  /// Assign a value to Attlist data member.
244  ///
245  /// @param value
246  /// Reference to value.
247  void SetAttlist(TAttlist& value);
248 
249  /// Assign a value to Attlist data member.
250  ///
251  /// @return
252  /// Reference to the data value.
253  TAttlist& SetAttlist(void);
254 
255  /// Check if a value has been assigned to Affected_channel data member.
256  ///
257  /// Data member Affected_channel is mandatory
258  /// @return
259  /// - true, if a value has been assigned.
260  /// - false, otherwise.
261  bool IsSetAffected_channel(void) const;
262 
263  /// Check if value of Affected_channel member is getatable.
264  ///
265  /// @return
266  /// - false; the data member of type 'NULL' has no value.
267  bool CanGetAffected_channel(void) const;
268 
269  /// Reset Affected_channel data member.
270  void ResetAffected_channel(void);
271 
272  /// Set NULL data member (assign 'NULL' value to Affected_channel data member).
273  void SetAffected_channel(void);
274 
275  /// Reset the whole object
276  virtual void Reset(void);
277 
278 
279 private:
280  // Prohibit copy constructor and assignment operator
283 
284  // data
285  Uint4 m_set_State[1];
287 };
288 
289 /* @} */
290 
291 
292 
293 
294 
295 ///////////////////////////////////////////////////////////
296 ///////////////////// inline methods //////////////////////
297 ///////////////////////////////////////////////////////////
298 inline
300 {
301  return ((m_set_State[0] & 0x3) != 0);
302 }
303 
304 inline
306 {
307  return IsSetChannel();
308 }
309 
310 inline
312 {
313  m_Channel = 0;
314  m_set_State[0] &= ~0x3;
315 }
316 
317 inline
319 {
320  if (!CanGetChannel()) {
321  ThrowUnassigned(0);
322  }
323  return m_Channel;
324 }
325 
326 inline
328 {
329  m_Channel = value;
330  m_set_State[0] |= 0x3;
331 }
332 
333 inline
335 {
336 #ifdef _DEBUG
337  if (!IsSetChannel()) {
338  memset(&m_Channel,UnassignedByte(),sizeof(m_Channel));
339  }
340 #endif
341  m_set_State[0] |= 0x1;
342  return m_Channel;
343 }
344 
345 inline
347 {
348  return ((m_set_State[0] & 0xc) != 0);
349 }
350 
351 inline
353 {
354  return IsSetCorrection();
355 }
356 
357 inline
359 {
360  m_Correction = 0;
361  m_set_State[0] &= ~0xc;
362 }
363 
364 inline
366 {
367  if (!CanGetCorrection()) {
368  ThrowUnassigned(1);
369  }
370  return m_Correction;
371 }
372 
373 inline
375 {
376  m_Correction = value;
377  m_set_State[0] |= 0xc;
378 }
379 
380 inline
382 {
383 #ifdef _DEBUG
384  if (!IsSetCorrection()) {
385  memset(&m_Correction,UnassignedByte(),sizeof(m_Correction));
386  }
387 #endif
388  m_set_State[0] |= 0x4;
389  return m_Correction;
390 }
391 
392 inline
394 {
395  return m_Attlist.NotEmpty();
396 }
397 
398 inline
400 {
401  return true;
402 }
403 
404 inline
406 {
407  if ( !m_Attlist ) {
408  const_cast<CAffected_channel_Base*>(this)->ResetAttlist();
409  }
410  return (*m_Attlist);
411 }
412 
413 inline
415 {
416  if ( !m_Attlist ) {
417  ResetAttlist();
418  }
420  return (*m_Attlist);
421 }
422 
423 inline
425 {
426  return ((m_set_State[0] & 0xc) != 0);
427 }
428 
429 inline
431 {
432  return false;
433 }
434 
435 inline
437 {
438  m_set_State[0] &= ~0xc;
439 }
440 
441 inline
443 {
444  m_set_State[0] |= 0xc;
445 }
446 
447 ///////////////////////////////////////////////////////////
448 ////////////////// end of inline methods //////////////////
449 ///////////////////////////////////////////////////////////
450 
451 
452 
453 
454 
455 END_objects_SCOPE // namespace ncbi::objects::
456 
458 
459 
460 #endif // ALGO_MS_FORMATS_PEPXML_AFFECTED_CHANNEL_BASE_HPP
============================================ This section is mapped from module "pepXML" ============...
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
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
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
bool IsSetCorrection(void) const
Check if a value has been assigned to Correction data member.
void SetAffected_channel(void)
Set NULL data member (assign 'NULL' value to Affected_channel data member).
bool IsSetChannel(void) const
Check if a value has been assigned to Channel data member.
bool CanGetChannel(void) const
Check if it is safe to call GetChannel method.
bool IsSetAffected_channel(void) const
Check if a value has been assigned to Affected_channel 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.
void ResetChannel(void)
Reset Channel data member.
void ResetAffected_channel(void)
Reset Affected_channel data member.
void ResetAttlist(void)
Reset Attlist data member.
C_Attlist & operator=(const C_Attlist &)
TChannel GetChannel(void) const
Get the Channel member data.
bool CanGetCorrection(void) const
Check if it is safe to call GetCorrection method.
CAffected_channel_Base(const CAffected_channel_Base &)
TCorrection & SetCorrection(void)
Assign a value to Correction data member.
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
void ResetCorrection(void)
Reset Correction data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TCorrection GetCorrection(void) const
Get the Correction member data.
bool CanGetAffected_channel(void) const
Check if value of Affected_channel member is getatable.
TChannel & SetChannel(void)
Assign a value to Channel data member.
CAffected_channel_Base & operator=(const CAffected_channel_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 14:59:32 2024 by modify_doxy.py rev. 669887