NCBI C++ ToolKit
Negmodel_distribution_.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 Negmodel_distribution_.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_NEGMODEL_DISTRIBUTION_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_NEGMODEL_DISTRIBUTION_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 CParameter;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_pepXML
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CNegmodel_distribution_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CNegmodel_distribution_Base(void);
84 
85  // type info
87 
88  /////////////////////////////////////////////////////////////////////////////
89  ///
90  /// C_Attlist --
91  ///
92 
94  {
96  public:
97  // constructor
98  C_Attlist(void);
99  // destructor
100  ~C_Attlist(void);
101 
102  // type info
104 
106  eAttlist_type_discrete = 1,
107  eAttlist_type_gaussian = 2,
108  eAttlist_type_extremevalue = 3,
109  eAttlist_type_gamma = 4,
110  eAttlist_type_evd = 5
111  };
112 
113  /// Access to EAttlist_type's attributes (values, names) as defined in spec
114  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAttlist_type)(void);
115 
116  // types
118 
119  // member index
120  enum class E_memberIndex {
121  e__allMandatory = 0,
122  e_type
123  };
125 
126  // getters
127  // setters
128 
129  /// Check if a value has been assigned to Type data member.
130  ///
131  /// Data member Type is optional;
132  /// its type is defined as 'typedef EAttlist_type TType'
133  /// @return
134  /// - true, if a value has been assigned.
135  /// - false, otherwise.
136  bool IsSetType(void) const;
137 
138  /// Check if it is safe to call GetType method.
139  ///
140  /// @return
141  /// - true, if the data member is getatable.
142  /// - false, otherwise.
143  bool CanGetType(void) const;
144 
145  /// Reset Type data member.
146  void ResetType(void);
147 
148  /// Get the Type member data.
149  ///
150  /// @return
151  /// Copy of the member data.
152  TType GetType(void) const;
153 
154  /// Assign a value to Type data member.
155  ///
156  /// @param value
157  /// Value to assign
158  void SetType(TType value);
159 
160  /// Assign a value to Type data member.
161  ///
162  /// @return
163  /// Reference to the data value.
164  TType& SetType(void);
165 
166  /// Reset the whole object
167  void Reset(void);
168 
169 
170  private:
171  // Prohibit copy constructor and assignment operator
174 
175  // data
176  Uint4 m_set_State[1];
178  };
179  // types
181  typedef list< CRef< CParameter > > TParameter;
182 
183  // member index
184  enum class E_memberIndex {
185  e__allMandatory = 0,
186  e_Attlist,
187  e_parameter
188  };
190 
191  // getters
192  // setters
193 
194  /// Check if a value has been assigned to Attlist data member.
195  ///
196  /// Data member Attlist is mandatory;
197  /// its type is defined as 'typedef C_Attlist TAttlist'
198  /// @return
199  /// - true, if a value has been assigned.
200  /// - false, otherwise.
201  bool IsSetAttlist(void) const;
202 
203  /// Check if it is safe to call GetAttlist method.
204  ///
205  /// @return
206  /// - true, if the data member is getatable.
207  /// - false, otherwise.
208  bool CanGetAttlist(void) const;
209 
210  /// Reset Attlist data member.
211  void ResetAttlist(void);
212 
213  /// Get the Attlist member data.
214  ///
215  /// @return
216  /// Reference to the member data.
217  const TAttlist& GetAttlist(void) const;
218 
219  /// Assign a value to Attlist data member.
220  ///
221  /// @param value
222  /// Reference to value.
223  void SetAttlist(TAttlist& value);
224 
225  /// Assign a value to Attlist data member.
226  ///
227  /// @return
228  /// Reference to the data value.
229  TAttlist& SetAttlist(void);
230 
231  /// Check if a value has been assigned to Parameter data member.
232  ///
233  /// Data member Parameter is mandatory;
234  /// its type is defined as 'typedef list< CRef< CParameter > > TParameter'
235  /// @return
236  /// - true, if a value has been assigned.
237  /// - false, otherwise.
238  bool IsSetParameter(void) const;
239 
240  /// Check if it is safe to call GetParameter method.
241  ///
242  /// @return
243  /// - true, if the data member is getatable.
244  /// - false, otherwise.
245  bool CanGetParameter(void) const;
246 
247  /// Reset Parameter data member.
248  void ResetParameter(void);
249 
250  /// Get the Parameter member data.
251  ///
252  /// @return
253  /// Reference to the member data.
254  const TParameter& GetParameter(void) const;
255 
256  /// Assign a value to Parameter data member.
257  ///
258  /// @return
259  /// Reference to the data value.
260  TParameter& SetParameter(void);
261 
262  /// Reset the whole object
263  virtual void Reset(void);
264 
265 
266 private:
267  // Prohibit copy constructor and assignment operator
270 
271  // data
272  Uint4 m_set_State[1];
274  list< CRef< CParameter > > m_Parameter;
275 };
276 
277 /* @} */
278 
279 
280 
281 
282 
283 ///////////////////////////////////////////////////////////
284 ///////////////////// inline methods //////////////////////
285 ///////////////////////////////////////////////////////////
286 inline
288 {
289  return ((m_set_State[0] & 0x3) != 0);
290 }
291 
292 inline
294 {
295  return IsSetType();
296 }
297 
298 inline
300 {
301  m_Type = (EAttlist_type)(0);
302  m_set_State[0] &= ~0x3;
303 }
304 
305 inline
307 {
308  if (!CanGetType()) {
309  ThrowUnassigned(0);
310  }
311  return m_Type;
312 }
313 
314 inline
316 {
317  m_Type = value;
318  m_set_State[0] |= 0x3;
319 }
320 
321 inline
323 {
324 #ifdef _DEBUG
325  if (!IsSetType()) {
326  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
327  }
328 #endif
329  m_set_State[0] |= 0x1;
330  return m_Type;
331 }
332 
333 inline
335 {
336  return m_Attlist.NotEmpty();
337 }
338 
339 inline
341 {
342  return true;
343 }
344 
345 inline
347 {
348  if ( !m_Attlist ) {
349  const_cast<CNegmodel_distribution_Base*>(this)->ResetAttlist();
350  }
351  return (*m_Attlist);
352 }
353 
354 inline
356 {
357  if ( !m_Attlist ) {
358  ResetAttlist();
359  }
360  return (*m_Attlist);
361 }
362 
363 inline
365 {
366  return ((m_set_State[0] & 0xc) != 0);
367 }
368 
369 inline
371 {
372  return true;
373 }
374 
375 inline
377 {
378  return m_Parameter;
379 }
380 
381 inline
383 {
384  m_set_State[0] |= 0x4;
385  return m_Parameter;
386 }
387 
388 ///////////////////////////////////////////////////////////
389 ////////////////// end of inline methods //////////////////
390 ///////////////////////////////////////////////////////////
391 
392 
393 
394 
395 
396 END_objects_SCOPE // namespace ncbi::objects::
397 
399 
400 
401 #endif // ALGO_MS_FORMATS_PEPXML_NEGMODEL_DISTRIBUTION_BASE_HPP
CNegmodel_distribution_Base –.
CParameter –.
Definition: Parameter.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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 &)
TParameter & SetParameter(void)
Assign a value to Parameter data member.
bool CanGetParameter(void) const
Check if it is safe to call GetParameter method.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
list< CRef< CParameter > > TParameter
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
void ResetAttlist(void)
Reset Attlist data member.
TType GetType(void) const
Get the Type member data.
list< CRef< CParameter > > m_Parameter
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
bool CanGetType(void) const
Check if it is safe to call GetType method.
TType & SetType(void)
Assign a value to Type data member.
void ResetType(void)
Reset Type data member.
CNegmodel_distribution_Base(const CNegmodel_distribution_Base &)
const TParameter & GetParameter(void) const
Get the Parameter member data.
Tparent::CMemberIndex< E_memberIndex, 2 > TmemberIndex
bool IsSetParameter(void) const
Check if a value has been assigned to Parameter data member.
CNegmodel_distribution_Base & operator=(const CNegmodel_distribution_Base &)
Modified on Mon Feb 26 04:03:55 2024 by modify_doxy.py rev. 669887