NCBI C++ ToolKit
Markov_chain_array_.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 Markov_chain_array_.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_MARKOV_CHAIN_ARRAY_BASE_HPP
42 #define ALGO_GNOMON_MARKOV_CHAIN_ARRAY_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 /// CMarkov_chain_array_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CMarkov_chain_array_Base(void);
84 
85  // type info
87 
88  // types
89  typedef int TIn_exon;
90  typedef int TIn_intron;
91  typedef list< CRef< CMarkov_chain_params > > TMatrix;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_in_exon,
97  e_in_intron,
98  e_matrix
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to In_exon data member.
106  ///
107  /// Data member In_exon is mandatory;
108  /// its type is defined as 'typedef int TIn_exon'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetIn_exon(void) const;
113 
114  /// Check if it is safe to call GetIn_exon method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetIn_exon(void) const;
120 
121  /// Reset In_exon data member.
122  void ResetIn_exon(void);
123 
124  /// Get the In_exon member data.
125  ///
126  /// @return
127  /// Copy of the member data.
128  TIn_exon GetIn_exon(void) const;
129 
130  /// Assign a value to In_exon data member.
131  ///
132  /// @param value
133  /// Value to assign
134  void SetIn_exon(TIn_exon value);
135 
136  /// Assign a value to In_exon data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TIn_exon& SetIn_exon(void);
141 
142  /// Check if a value has been assigned to In_intron data member.
143  ///
144  /// Data member In_intron is mandatory;
145  /// its type is defined as 'typedef int TIn_intron'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetIn_intron(void) const;
150 
151  /// Check if it is safe to call GetIn_intron method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetIn_intron(void) const;
157 
158  /// Reset In_intron data member.
159  void ResetIn_intron(void);
160 
161  /// Get the In_intron member data.
162  ///
163  /// @return
164  /// Copy of the member data.
165  TIn_intron GetIn_intron(void) const;
166 
167  /// Assign a value to In_intron data member.
168  ///
169  /// @param value
170  /// Value to assign
171  void SetIn_intron(TIn_intron value);
172 
173  /// Assign a value to In_intron data member.
174  ///
175  /// @return
176  /// Reference to the data value.
177  TIn_intron& SetIn_intron(void);
178 
179  /// in-exon+in-intron elements
180  /// Check if a value has been assigned to Matrix data member.
181  ///
182  /// Data member Matrix is mandatory;
183  /// its type is defined as 'typedef list< CRef< CMarkov_chain_params > > TMatrix'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetMatrix(void) const;
188 
189  /// Check if it is safe to call GetMatrix method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetMatrix(void) const;
195 
196  /// Reset Matrix data member.
197  void ResetMatrix(void);
198 
199  /// Get the Matrix member data.
200  ///
201  /// @return
202  /// Reference to the member data.
203  const TMatrix& GetMatrix(void) const;
204 
205  /// Assign a value to Matrix data member.
206  ///
207  /// @return
208  /// Reference to the data value.
209  TMatrix& SetMatrix(void);
210 
211  /// Reset the whole object
212  virtual void Reset(void);
213 
214 
215 private:
216  // Prohibit copy constructor and assignment operator
219 
220  // data
221  Uint4 m_set_State[1];
224  list< CRef< CMarkov_chain_params > > m_Matrix;
225 };
226 
227 /* @} */
228 
229 
230 
231 
232 
233 ///////////////////////////////////////////////////////////
234 ///////////////////// inline methods //////////////////////
235 ///////////////////////////////////////////////////////////
236 inline
238 {
239  return ((m_set_State[0] & 0x3) != 0);
240 }
241 
242 inline
244 {
245  return IsSetIn_exon();
246 }
247 
248 inline
250 {
251  m_In_exon = 0;
252  m_set_State[0] &= ~0x3;
253 }
254 
255 inline
257 {
258  if (!CanGetIn_exon()) {
259  ThrowUnassigned(0);
260  }
261  return m_In_exon;
262 }
263 
264 inline
266 {
267  m_In_exon = value;
268  m_set_State[0] |= 0x3;
269 }
270 
271 inline
273 {
274 #ifdef _DEBUG
275  if (!IsSetIn_exon()) {
276  memset(&m_In_exon,UnassignedByte(),sizeof(m_In_exon));
277  }
278 #endif
279  m_set_State[0] |= 0x1;
280  return m_In_exon;
281 }
282 
283 inline
285 {
286  return ((m_set_State[0] & 0xc) != 0);
287 }
288 
289 inline
291 {
292  return IsSetIn_intron();
293 }
294 
295 inline
297 {
298  m_In_intron = 0;
299  m_set_State[0] &= ~0xc;
300 }
301 
302 inline
304 {
305  if (!CanGetIn_intron()) {
306  ThrowUnassigned(1);
307  }
308  return m_In_intron;
309 }
310 
311 inline
313 {
314  m_In_intron = value;
315  m_set_State[0] |= 0xc;
316 }
317 
318 inline
320 {
321 #ifdef _DEBUG
322  if (!IsSetIn_intron()) {
323  memset(&m_In_intron,UnassignedByte(),sizeof(m_In_intron));
324  }
325 #endif
326  m_set_State[0] |= 0x4;
327  return m_In_intron;
328 }
329 
330 inline
332 {
333  return ((m_set_State[0] & 0x30) != 0);
334 }
335 
336 inline
338 {
339  return true;
340 }
341 
342 inline
344 {
345  return m_Matrix;
346 }
347 
348 inline
350 {
351  m_set_State[0] |= 0x10;
352  return m_Matrix;
353 }
354 
355 ///////////////////////////////////////////////////////////
356 ////////////////// end of inline methods //////////////////
357 ///////////////////////////////////////////////////////////
358 
359 
360 
361 
362 
363 END_objects_SCOPE // namespace ncbi::objects::
364 
366 
367 
368 #endif // ALGO_GNOMON_MARKOV_CHAIN_ARRAY_BASE_HPP
CMarkov_chain_array_Base –.
CMarkov_chain_params –.
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_XALGOGNOMON_EXPORT
Definition: ncbi_export.h:1001
bool CanGetIn_exon(void) const
Check if it is safe to call GetIn_exon method.
CMarkov_chain_array_Base & operator=(const CMarkov_chain_array_Base &)
TMatrix & SetMatrix(void)
Assign a value to Matrix data member.
void ResetIn_exon(void)
Reset In_exon data member.
bool CanGetIn_intron(void) const
Check if it is safe to call GetIn_intron method.
TIn_intron GetIn_intron(void) const
Get the In_intron member data.
void ResetIn_intron(void)
Reset In_intron data member.
TIn_exon GetIn_exon(void) const
Get the In_exon member data.
TIn_intron & SetIn_intron(void)
Assign a value to In_intron data member.
bool IsSetIn_exon(void) const
Check if a value has been assigned to In_exon data member.
list< CRef< CMarkov_chain_params > > TMatrix
bool IsSetMatrix(void) const
in-exon+in-intron elements Check if a value has been assigned to Matrix data member.
bool CanGetMatrix(void) const
Check if it is safe to call GetMatrix method.
CMarkov_chain_array_Base(const CMarkov_chain_array_Base &)
bool IsSetIn_intron(void) const
Check if a value has been assigned to In_intron data member.
TIn_exon & SetIn_exon(void)
Assign a value to In_exon data member.
const TMatrix & GetMatrix(void) const
Get the Matrix member data.
list< CRef< CMarkov_chain_params > > m_Matrix
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:25 2024 by modify_doxy.py rev. 669887