NCBI C++ ToolKit
Contributing_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 Contributing_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_CONTRIBUTING_CHANNEL_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_CONTRIBUTING_CHANNEL_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
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 CAffected_channel;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_pepXML
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///channel donor
73 ///
74 /// CContributing_channel_Base --
75 ///
76 
78 {
80 public:
81  // constructor
83  // destructor
84  virtual ~CContributing_channel_Base(void);
85 
86  // type info
88 
89  /////////////////////////////////////////////////////////////////////////////
90  ///
91  /// C_Attlist --
92  ///
93 
95  {
97  public:
98  // constructor
99  C_Attlist(void);
100  // destructor
101  ~C_Attlist(void);
102 
103  // type info
105 
106  // types
107  typedef int TChannel;
108 
109  // member index
110  enum class E_memberIndex {
111  e__allMandatory = 0,
112  e_channel
113  };
115 
116  // getters
117  // setters
118 
119  /// Check if a value has been assigned to Channel data member.
120  ///
121  /// Data member Channel is mandatory;
122  /// its type is defined as 'typedef int TChannel'
123  /// @return
124  /// - true, if a value has been assigned.
125  /// - false, otherwise.
126  bool IsSetChannel(void) const;
127 
128  /// Check if it is safe to call GetChannel method.
129  ///
130  /// @return
131  /// - true, if the data member is getatable.
132  /// - false, otherwise.
133  bool CanGetChannel(void) const;
134 
135  /// Reset Channel data member.
136  void ResetChannel(void);
137 
138  /// Get the Channel member data.
139  ///
140  /// @return
141  /// Copy of the member data.
142  TChannel GetChannel(void) const;
143 
144  /// Assign a value to Channel data member.
145  ///
146  /// @param value
147  /// Value to assign
148  void SetChannel(TChannel value);
149 
150  /// Assign a value to Channel data member.
151  ///
152  /// @return
153  /// Reference to the data value.
154  TChannel& SetChannel(void);
155 
156  /// Reset the whole object
157  void Reset(void);
158 
159 
160  private:
161  // Prohibit copy constructor and assignment operator
164 
165  // data
166  Uint4 m_set_State[1];
168  };
169  // types
171  typedef list< CRef< CAffected_channel > > TAffected_channel;
172 
173  // member index
174  enum class E_memberIndex {
175  e__allMandatory = 0,
176  e_Attlist,
177  e_affected_channel
178  };
180 
181  // getters
182  // setters
183 
184  /// Check if a value has been assigned to Attlist data member.
185  ///
186  /// Data member Attlist is mandatory;
187  /// its type is defined as 'typedef C_Attlist TAttlist'
188  /// @return
189  /// - true, if a value has been assigned.
190  /// - false, otherwise.
191  bool IsSetAttlist(void) const;
192 
193  /// Check if it is safe to call GetAttlist method.
194  ///
195  /// @return
196  /// - true, if the data member is getatable.
197  /// - false, otherwise.
198  bool CanGetAttlist(void) const;
199 
200  /// Reset Attlist data member.
201  void ResetAttlist(void);
202 
203  /// Get the Attlist member data.
204  ///
205  /// @return
206  /// Reference to the member data.
207  const TAttlist& GetAttlist(void) const;
208 
209  /// Assign a value to Attlist data member.
210  ///
211  /// @param value
212  /// Reference to value.
213  void SetAttlist(TAttlist& value);
214 
215  /// Assign a value to Attlist data member.
216  ///
217  /// @return
218  /// Reference to the data value.
219  TAttlist& SetAttlist(void);
220 
221  /// Check if a value has been assigned to Affected_channel data member.
222  ///
223  /// Data member Affected_channel is mandatory;
224  /// its type is defined as 'typedef list< CRef< CAffected_channel > > TAffected_channel'
225  /// @return
226  /// - true, if a value has been assigned.
227  /// - false, otherwise.
228  bool IsSetAffected_channel(void) const;
229 
230  /// Check if it is safe to call GetAffected_channel method.
231  ///
232  /// @return
233  /// - true, if the data member is getatable.
234  /// - false, otherwise.
235  bool CanGetAffected_channel(void) const;
236 
237  /// Reset Affected_channel data member.
238  void ResetAffected_channel(void);
239 
240  /// Get the Affected_channel member data.
241  ///
242  /// @return
243  /// Reference to the member data.
244  const TAffected_channel& GetAffected_channel(void) const;
245 
246  /// Assign a value to Affected_channel data member.
247  ///
248  /// @return
249  /// Reference to the data value.
250  TAffected_channel& SetAffected_channel(void);
251 
252  /// Reset the whole object
253  virtual void Reset(void);
254 
255 
256 private:
257  // Prohibit copy constructor and assignment operator
260 
261  // data
262  Uint4 m_set_State[1];
264  list< CRef< CAffected_channel > > m_Affected_channel;
265 };
266 
267 /* @} */
268 
269 
270 
271 
272 
273 ///////////////////////////////////////////////////////////
274 ///////////////////// inline methods //////////////////////
275 ///////////////////////////////////////////////////////////
276 inline
278 {
279  return ((m_set_State[0] & 0x3) != 0);
280 }
281 
282 inline
284 {
285  return IsSetChannel();
286 }
287 
288 inline
290 {
291  m_Channel = 0;
292  m_set_State[0] &= ~0x3;
293 }
294 
295 inline
297 {
298  if (!CanGetChannel()) {
299  ThrowUnassigned(0);
300  }
301  return m_Channel;
302 }
303 
304 inline
306 {
307  m_Channel = value;
308  m_set_State[0] |= 0x3;
309 }
310 
311 inline
313 {
314 #ifdef _DEBUG
315  if (!IsSetChannel()) {
316  memset(&m_Channel,UnassignedByte(),sizeof(m_Channel));
317  }
318 #endif
319  m_set_State[0] |= 0x1;
320  return m_Channel;
321 }
322 
323 inline
325 {
326  return m_Attlist.NotEmpty();
327 }
328 
329 inline
331 {
332  return true;
333 }
334 
335 inline
337 {
338  if ( !m_Attlist ) {
339  const_cast<CContributing_channel_Base*>(this)->ResetAttlist();
340  }
341  return (*m_Attlist);
342 }
343 
344 inline
346 {
347  if ( !m_Attlist ) {
348  ResetAttlist();
349  }
350  return (*m_Attlist);
351 }
352 
353 inline
355 {
356  return ((m_set_State[0] & 0xc) != 0);
357 }
358 
359 inline
361 {
362  return true;
363 }
364 
365 inline
367 {
368  return m_Affected_channel;
369 }
370 
371 inline
373 {
374  m_set_State[0] |= 0x4;
375  return m_Affected_channel;
376 }
377 
378 ///////////////////////////////////////////////////////////
379 ////////////////// end of inline methods //////////////////
380 ///////////////////////////////////////////////////////////
381 
382 
383 
384 
385 
386 END_objects_SCOPE // namespace ncbi::objects::
387 
389 
390 
391 #endif // ALGO_MS_FORMATS_PEPXML_CONTRIBUTING_CHANNEL_BASE_HPP
CAffected_channel –.
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
CContributing_channel_Base & operator=(const CContributing_channel_Base &)
bool IsSetChannel(void) const
Check if a value has been assigned to Channel data member.
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
C_Attlist & operator=(const C_Attlist &)
void ResetChannel(void)
Reset Channel data member.
Tparent::CMemberIndex< E_memberIndex, 2 > TmemberIndex
list< CRef< CAffected_channel > > m_Affected_channel
TAffected_channel & SetAffected_channel(void)
Assign a value to Affected_channel data member.
bool IsSetAffected_channel(void) const
Check if a value has been assigned to Affected_channel data member.
list< CRef< CAffected_channel > > TAffected_channel
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
bool CanGetChannel(void) const
Check if it is safe to call GetChannel method.
TChannel GetChannel(void) const
Get the Channel member data.
TChannel & SetChannel(void)
Assign a value to Channel data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
const TAffected_channel & GetAffected_channel(void) const
Get the Affected_channel member data.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
void ResetAttlist(void)
Reset Attlist data member.
CContributing_channel_Base(const CContributing_channel_Base &)
bool CanGetAffected_channel(void) const
Check if it is safe to call GetAffected_channel method.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:31 2024 by modify_doxy.py rev. 669887
HHS Vulnerability Disclosure