NCBI C++ ToolKit
Intergenic_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 Intergenic_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_INTERGENIC_PARAMS_BASE_HPP
42 #define ALGO_GNOMON_INTERGENIC_PARAMS_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 // forward declarations
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_GNOMON
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CIntergenic_params_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CIntergenic_params_Base(void);
80 
81  // type info
83 
84  // types
85  typedef double TInitp;
86  typedef double TTo_single;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_initp,
93  e_to_single,
94  e_length
95  };
97 
98  // getters
99  // setters
100 
101  /// probability of a genomic point be intergenic
102  /// Check if a value has been assigned to Initp data member.
103  ///
104  /// Data member Initp is mandatory;
105  /// its type is defined as 'typedef double TInitp'
106  /// @return
107  /// - true, if a value has been assigned.
108  /// - false, otherwise.
109  bool IsSetInitp(void) const;
110 
111  /// Check if it is safe to call GetInitp method.
112  ///
113  /// @return
114  /// - true, if the data member is getatable.
115  /// - false, otherwise.
116  bool CanGetInitp(void) const;
117 
118  /// Reset Initp data member.
119  void ResetInitp(void);
120 
121  /// Get the Initp member data.
122  ///
123  /// @return
124  /// Copy of the member data.
125  TInitp GetInitp(void) const;
126 
127  /// Assign a value to Initp data member.
128  ///
129  /// @param value
130  /// Value to assign
131  void SetInitp(TInitp value);
132 
133  /// Assign a value to Initp data member.
134  ///
135  /// @return
136  /// Reference to the data value.
137  TInitp& SetInitp(void);
138 
139  /// probability of next gene to be single-exon
140  /// Check if a value has been assigned to To_single data member.
141  ///
142  /// Data member To_single is mandatory;
143  /// its type is defined as 'typedef double TTo_single'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetTo_single(void) const;
148 
149  /// Check if it is safe to call GetTo_single method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetTo_single(void) const;
155 
156  /// Reset To_single data member.
157  void ResetTo_single(void);
158 
159  /// Get the To_single member data.
160  ///
161  /// @return
162  /// Copy of the member data.
163  TTo_single GetTo_single(void) const;
164 
165  /// Assign a value to To_single data member.
166  ///
167  /// @param value
168  /// Value to assign
169  void SetTo_single(TTo_single value);
170 
171  /// Assign a value to To_single data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TTo_single& SetTo_single(void);
176 
177  /// Check if a value has been assigned to Length data member.
178  ///
179  /// Data member Length is mandatory;
180  /// its type is defined as 'typedef CLength_distribution_params TLength'
181  /// @return
182  /// - true, if a value has been assigned.
183  /// - false, otherwise.
184  bool IsSetLength(void) const;
185 
186  /// Check if it is safe to call GetLength method.
187  ///
188  /// @return
189  /// - true, if the data member is getatable.
190  /// - false, otherwise.
191  bool CanGetLength(void) const;
192 
193  /// Reset Length data member.
194  void ResetLength(void);
195 
196  /// Get the Length member data.
197  ///
198  /// @return
199  /// Reference to the member data.
200  const TLength& GetLength(void) const;
201 
202  /// Assign a value to Length data member.
203  ///
204  /// @param value
205  /// Reference to value.
206  void SetLength(TLength& value);
207 
208  /// Assign a value to Length data member.
209  ///
210  /// @return
211  /// Reference to the data value.
212  TLength& SetLength(void);
213 
214  /// Reset the whole object
215  virtual void Reset(void);
216 
217 
218 private:
219  // Prohibit copy constructor and assignment operator
222 
223  // data
224  Uint4 m_set_State[1];
225  double m_Initp;
226  double m_To_single;
228 };
229 
230 /* @} */
231 
232 
233 
234 
235 
236 ///////////////////////////////////////////////////////////
237 ///////////////////// inline methods //////////////////////
238 ///////////////////////////////////////////////////////////
239 inline
241 {
242  return ((m_set_State[0] & 0x3) != 0);
243 }
244 
245 inline
247 {
248  return IsSetInitp();
249 }
250 
251 inline
253 {
254  m_Initp = 0;
255  m_set_State[0] &= ~0x3;
256 }
257 
258 inline
260 {
261  if (!CanGetInitp()) {
262  ThrowUnassigned(0);
263  }
264  return m_Initp;
265 }
266 
267 inline
269 {
270  m_Initp = value;
271  m_set_State[0] |= 0x3;
272 }
273 
274 inline
276 {
277 #ifdef _DEBUG
278  if (!IsSetInitp()) {
279  memset(&m_Initp,UnassignedByte(),sizeof(m_Initp));
280  }
281 #endif
282  m_set_State[0] |= 0x1;
283  return m_Initp;
284 }
285 
286 inline
288 {
289  return ((m_set_State[0] & 0xc) != 0);
290 }
291 
292 inline
294 {
295  return IsSetTo_single();
296 }
297 
298 inline
300 {
301  m_To_single = 0;
302  m_set_State[0] &= ~0xc;
303 }
304 
305 inline
307 {
308  if (!CanGetTo_single()) {
309  ThrowUnassigned(1);
310  }
311  return m_To_single;
312 }
313 
314 inline
316 {
317  m_To_single = value;
318  m_set_State[0] |= 0xc;
319 }
320 
321 inline
323 {
324 #ifdef _DEBUG
325  if (!IsSetTo_single()) {
326  memset(&m_To_single,UnassignedByte(),sizeof(m_To_single));
327  }
328 #endif
329  m_set_State[0] |= 0x4;
330  return m_To_single;
331 }
332 
333 inline
335 {
336  return m_Length.NotEmpty();
337 }
338 
339 inline
341 {
342  return true;
343 }
344 
345 inline
347 {
348  if ( !m_Length ) {
349  const_cast<CIntergenic_params_Base*>(this)->ResetLength();
350  }
351  return (*m_Length);
352 }
353 
354 inline
356 {
357  if ( !m_Length ) {
358  ResetLength();
359  }
360  return (*m_Length);
361 }
362 
363 ///////////////////////////////////////////////////////////
364 ////////////////// end of inline methods //////////////////
365 ///////////////////////////////////////////////////////////
366 
367 
368 
369 
370 
371 END_objects_SCOPE // namespace ncbi::objects::
372 
374 
375 
376 #endif // ALGO_GNOMON_INTERGENIC_PARAMS_BASE_HPP
CIntergenic_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
CLength_distribution_params TLength
CIntergenic_params_Base(const CIntergenic_params_Base &)
bool CanGetInitp(void) const
Check if it is safe to call GetInitp method.
bool IsSetTo_single(void) const
probability of next gene to be single-exon Check if a value has been assigned to To_single data membe...
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
TTo_single & SetTo_single(void)
Assign a value to To_single data member.
bool IsSetInitp(void) const
probability of a genomic point be intergenic Check if a value has been assigned to Initp data member.
void ResetTo_single(void)
Reset To_single data member.
TTo_single GetTo_single(void) const
Get the To_single member data.
bool CanGetTo_single(void) const
Check if it is safe to call GetTo_single method.
bool CanGetLength(void) const
Check if it is safe to call GetLength method.
TInitp GetInitp(void) const
Get the Initp member data.
const TLength & GetLength(void) const
Get the Length member data.
void ResetInitp(void)
Reset Initp data member.
TInitp & SetInitp(void)
Assign a value to Initp data member.
TLength & SetLength(void)
Assign a value to Length data member.
void ResetLength(void)
Reset Length data member.
CIntergenic_params_Base & operator=(const CIntergenic_params_Base &)
bool IsSetLength(void) const
Check if a value has been assigned to Length data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:02 2024 by modify_doxy.py rev. 669887