NCBI C++ ToolKit
Intron_params_.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 Intron_params_.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/gnomon/gnomon.asn">gnomon.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/algo/gnomon/gnomon.def">gnomon.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_GNOMON_INTRON_PARAMS_BASE_HPP
42 #define ALGO_GNOMON_INTRON_PARAMS_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
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_GNOMON
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CIntron_params_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CIntron_params_Base(void);
82  // destructor
83  virtual ~CIntron_params_Base(void);
84 
85  // type info
87 
88  // types
89  typedef double TInitp;
90  typedef list< double > TPhase_probabilities;
91  typedef double TTo_term;
93 
94  // member index
95  enum class E_memberIndex {
96  e__allMandatory = 0,
97  e_initp,
98  e_phase_probabilities,
99  e_to_term,
100  e_length
101  };
103 
104  // getters
105  // setters
106 
107  /// probability of a genomic point be in an intron
108  /// Check if a value has been assigned to Initp data member.
109  ///
110  /// Data member Initp is mandatory;
111  /// its type is defined as 'typedef double TInitp'
112  /// @return
113  /// - true, if a value has been assigned.
114  /// - false, otherwise.
115  bool IsSetInitp(void) const;
116 
117  /// Check if it is safe to call GetInitp method.
118  ///
119  /// @return
120  /// - true, if the data member is getatable.
121  /// - false, otherwise.
122  bool CanGetInitp(void) const;
123 
124  /// Reset Initp data member.
125  void ResetInitp(void);
126 
127  /// Get the Initp member data.
128  ///
129  /// @return
130  /// Copy of the member data.
131  TInitp GetInitp(void) const;
132 
133  /// Assign a value to Initp data member.
134  ///
135  /// @param value
136  /// Value to assign
137  void SetInitp(TInitp value);
138 
139  /// Assign a value to Initp data member.
140  ///
141  /// @return
142  /// Reference to the data value.
143  TInitp& SetInitp(void);
144 
145  /// 3 elements (per phase)
146  /// Check if a value has been assigned to Phase_probabilities data member.
147  ///
148  /// Data member Phase_probabilities is mandatory;
149  /// its type is defined as 'typedef list< double > TPhase_probabilities'
150  /// @return
151  /// - true, if a value has been assigned.
152  /// - false, otherwise.
153  bool IsSetPhase_probabilities(void) const;
154 
155  /// Check if it is safe to call GetPhase_probabilities method.
156  ///
157  /// @return
158  /// - true, if the data member is getatable.
159  /// - false, otherwise.
160  bool CanGetPhase_probabilities(void) const;
161 
162  /// Reset Phase_probabilities data member.
163  void ResetPhase_probabilities(void);
164 
165  /// Get the Phase_probabilities member data.
166  ///
167  /// @return
168  /// Reference to the member data.
169  const TPhase_probabilities& GetPhase_probabilities(void) const;
170 
171  /// Assign a value to Phase_probabilities data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TPhase_probabilities& SetPhase_probabilities(void);
176 
177  /// probability to be the last
178  /// Check if a value has been assigned to To_term data member.
179  ///
180  /// Data member To_term is mandatory;
181  /// its type is defined as 'typedef double TTo_term'
182  /// @return
183  /// - true, if a value has been assigned.
184  /// - false, otherwise.
185  bool IsSetTo_term(void) const;
186 
187  /// Check if it is safe to call GetTo_term method.
188  ///
189  /// @return
190  /// - true, if the data member is getatable.
191  /// - false, otherwise.
192  bool CanGetTo_term(void) const;
193 
194  /// Reset To_term data member.
195  void ResetTo_term(void);
196 
197  /// Get the To_term member data.
198  ///
199  /// @return
200  /// Copy of the member data.
201  TTo_term GetTo_term(void) const;
202 
203  /// Assign a value to To_term data member.
204  ///
205  /// @param value
206  /// Value to assign
207  void SetTo_term(TTo_term value);
208 
209  /// Assign a value to To_term data member.
210  ///
211  /// @return
212  /// Reference to the data value.
213  TTo_term& SetTo_term(void);
214 
215  /// Check if a value has been assigned to Length data member.
216  ///
217  /// Data member Length is mandatory;
218  /// its type is defined as 'typedef CLength_distribution_params TLength'
219  /// @return
220  /// - true, if a value has been assigned.
221  /// - false, otherwise.
222  bool IsSetLength(void) const;
223 
224  /// Check if it is safe to call GetLength method.
225  ///
226  /// @return
227  /// - true, if the data member is getatable.
228  /// - false, otherwise.
229  bool CanGetLength(void) const;
230 
231  /// Reset Length data member.
232  void ResetLength(void);
233 
234  /// Get the Length member data.
235  ///
236  /// @return
237  /// Reference to the member data.
238  const TLength& GetLength(void) const;
239 
240  /// Assign a value to Length data member.
241  ///
242  /// @param value
243  /// Reference to value.
244  void SetLength(TLength& value);
245 
246  /// Assign a value to Length data member.
247  ///
248  /// @return
249  /// Reference to the data value.
250  TLength& SetLength(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];
263  double m_Initp;
264  list< double > m_Phase_probabilities;
265  double m_To_term;
267 };
268 
269 /* @} */
270 
271 
272 
273 
274 
275 ///////////////////////////////////////////////////////////
276 ///////////////////// inline methods //////////////////////
277 ///////////////////////////////////////////////////////////
278 inline
280 {
281  return ((m_set_State[0] & 0x3) != 0);
282 }
283 
284 inline
286 {
287  return IsSetInitp();
288 }
289 
290 inline
292 {
293  m_Initp = 0;
294  m_set_State[0] &= ~0x3;
295 }
296 
297 inline
299 {
300  if (!CanGetInitp()) {
301  ThrowUnassigned(0);
302  }
303  return m_Initp;
304 }
305 
306 inline
308 {
309  m_Initp = value;
310  m_set_State[0] |= 0x3;
311 }
312 
313 inline
315 {
316 #ifdef _DEBUG
317  if (!IsSetInitp()) {
318  memset(&m_Initp,UnassignedByte(),sizeof(m_Initp));
319  }
320 #endif
321  m_set_State[0] |= 0x1;
322  return m_Initp;
323 }
324 
325 inline
327 {
328  return ((m_set_State[0] & 0xc) != 0);
329 }
330 
331 inline
333 {
334  return true;
335 }
336 
337 inline
339 {
340  return m_Phase_probabilities;
341 }
342 
343 inline
345 {
346  m_set_State[0] |= 0x4;
347  return m_Phase_probabilities;
348 }
349 
350 inline
352 {
353  return ((m_set_State[0] & 0x30) != 0);
354 }
355 
356 inline
358 {
359  return IsSetTo_term();
360 }
361 
362 inline
364 {
365  m_To_term = 0;
366  m_set_State[0] &= ~0x30;
367 }
368 
369 inline
371 {
372  if (!CanGetTo_term()) {
373  ThrowUnassigned(2);
374  }
375  return m_To_term;
376 }
377 
378 inline
380 {
381  m_To_term = value;
382  m_set_State[0] |= 0x30;
383 }
384 
385 inline
387 {
388 #ifdef _DEBUG
389  if (!IsSetTo_term()) {
390  memset(&m_To_term,UnassignedByte(),sizeof(m_To_term));
391  }
392 #endif
393  m_set_State[0] |= 0x10;
394  return m_To_term;
395 }
396 
397 inline
399 {
400  return m_Length.NotEmpty();
401 }
402 
403 inline
405 {
406  return true;
407 }
408 
409 inline
411 {
412  if ( !m_Length ) {
413  const_cast<CIntron_params_Base*>(this)->ResetLength();
414  }
415  return (*m_Length);
416 }
417 
418 inline
420 {
421  if ( !m_Length ) {
422  ResetLength();
423  }
424  return (*m_Length);
425 }
426 
427 ///////////////////////////////////////////////////////////
428 ////////////////// end of inline methods //////////////////
429 ///////////////////////////////////////////////////////////
430 
431 
432 
433 
434 
435 END_objects_SCOPE // namespace ncbi::objects::
436 
438 
439 
440 #endif // ALGO_GNOMON_INTRON_PARAMS_BASE_HPP
CIntron_params_Base –.
CLength_distribution_params –.
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
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
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_XALGOGNOMON_EXPORT
Definition: ncbi_export.h:1001
TInitp & SetInitp(void)
Assign a value to Initp data member.
CLength_distribution_params TLength
bool CanGetLength(void) const
Check if it is safe to call GetLength method.
bool CanGetInitp(void) const
Check if it is safe to call GetInitp method.
void ResetLength(void)
Reset Length data member.
void ResetInitp(void)
Reset Initp data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
void ResetTo_term(void)
Reset To_term data member.
const TLength & GetLength(void) const
Get the Length member data.
TTo_term GetTo_term(void) const
Get the To_term member data.
bool CanGetPhase_probabilities(void) const
Check if it is safe to call GetPhase_probabilities method.
list< double > m_Phase_probabilities
bool IsSetLength(void) const
Check if a value has been assigned to Length data member.
CRef< TLength > m_Length
CIntron_params_Base(const CIntron_params_Base &)
list< double > TPhase_probabilities
CSerialObject Tparent
TInitp GetInitp(void) const
Get the Initp member data.
bool IsSetTo_term(void) const
probability to be the last Check if a value has been assigned to To_term data member.
CIntron_params_Base & operator=(const CIntron_params_Base &)
bool IsSetPhase_probabilities(void) const
3 elements (per phase) Check if a value has been assigned to Phase_probabilities data member.
const TPhase_probabilities & GetPhase_probabilities(void) const
Get the Phase_probabilities member data.
TPhase_probabilities & SetPhase_probabilities(void)
Assign a value to Phase_probabilities data member.
TLength & SetLength(void)
Assign a value to Length data member.
bool CanGetTo_term(void) const
Check if it is safe to call GetTo_term method.
bool IsSetInitp(void) const
probability of a genomic point be in an intron Check if a value has been assigned to Initp data membe...
TTo_term & SetTo_term(void)
Assign a value to To_term data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:01 2024 by modify_doxy.py rev. 669887