NCBI C++ ToolKit
LoopConstraint_.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 LoopConstraint_.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/objects/scoremat/scoremat.asn">scoremat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/scoremat/scoremat.def">scoremat.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 OBJECTS_SCOREMAT_LOOPCONSTRAINT_BASE_HPP
42 #define OBJECTS_SCOREMAT_LOOPCONSTRAINT_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 // generated classes
56 
57 
58 /** @addtogroup dataspec_NCBI_ScoreMat
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 ///
65 /// CLoopConstraint_Base --
66 ///
67 
69 {
71 public:
72  // constructor
74  // destructor
75  virtual ~CLoopConstraint_Base(void);
76 
77  // type info
79 
80  // types
81  typedef int TMinlength;
82  typedef int TMaxlength;
83 
84  // member index
85  enum class E_memberIndex {
86  e__allMandatory = 0,
87  e_minlength,
88  e_maxlength
89  };
91 
92  // getters
93  // setters
94 
95  /// minimum length of unaligned region
96  /// Check if a value has been assigned to Minlength data member.
97  ///
98  /// Data member Minlength is optional with default 0;
99  /// its type is defined as 'typedef int TMinlength'
100  /// @return
101  /// - true, if a value has been assigned.
102  /// - false, otherwise.
103  bool IsSetMinlength(void) const;
104 
105  /// Check if it is safe to call GetMinlength method.
106  ///
107  /// @return
108  /// - true, if the data member is getatable.
109  /// - false, otherwise.
110  bool CanGetMinlength(void) const;
111 
112  /// Reset Minlength data member.
113  void ResetMinlength(void);
114 
115  /// Assign default value to Minlength data member.
116  void SetDefaultMinlength(void);
117 
118  /// Get the Minlength member data.
119  ///
120  /// @return
121  /// Copy of the member data.
122  TMinlength GetMinlength(void) const;
123 
124  /// Assign a value to Minlength data member.
125  ///
126  /// @param value
127  /// Value to assign
128  void SetMinlength(TMinlength value);
129 
130  /// Assign a value to Minlength data member.
131  ///
132  /// @return
133  /// Reference to the data value.
134  TMinlength& SetMinlength(void);
135 
136  /// maximum length of unaligned region
137  /// Check if a value has been assigned to Maxlength data member.
138  ///
139  /// Data member Maxlength is optional with default 100000;
140  /// its type is defined as 'typedef int TMaxlength'
141  /// @return
142  /// - true, if a value has been assigned.
143  /// - false, otherwise.
144  bool IsSetMaxlength(void) const;
145 
146  /// Check if it is safe to call GetMaxlength method.
147  ///
148  /// @return
149  /// - true, if the data member is getatable.
150  /// - false, otherwise.
151  bool CanGetMaxlength(void) const;
152 
153  /// Reset Maxlength data member.
154  void ResetMaxlength(void);
155 
156  /// Assign default value to Maxlength data member.
157  void SetDefaultMaxlength(void);
158 
159  /// Get the Maxlength member data.
160  ///
161  /// @return
162  /// Copy of the member data.
163  TMaxlength GetMaxlength(void) const;
164 
165  /// Assign a value to Maxlength data member.
166  ///
167  /// @param value
168  /// Value to assign
169  void SetMaxlength(TMaxlength value);
170 
171  /// Assign a value to Maxlength data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TMaxlength& SetMaxlength(void);
176 
177  /// Reset the whole object
178  virtual void Reset(void);
179 
180 
181 private:
182  // Prohibit copy constructor and assignment operator
185 
186  // data
187  Uint4 m_set_State[1];
190 };
191 
192 /* @} */
193 
194 
195 
196 
197 
198 ///////////////////////////////////////////////////////////
199 ///////////////////// inline methods //////////////////////
200 ///////////////////////////////////////////////////////////
201 inline
203 {
204  return ((m_set_State[0] & 0x3) != 0);
205 }
206 
207 inline
209 {
210  return true;
211 }
212 
213 inline
215 {
216  m_Minlength = 0;
217  m_set_State[0] &= ~0x3;
218 }
219 
220 inline
222 {
223  ResetMinlength();
224 }
225 
226 inline
228 {
229  return m_Minlength;
230 }
231 
232 inline
234 {
235  m_Minlength = value;
236  m_set_State[0] |= 0x3;
237 }
238 
239 inline
241 {
242 #ifdef _DEBUG
243  if (!IsSetMinlength()) {
244  memset(&m_Minlength,UnassignedByte(),sizeof(m_Minlength));
245  }
246 #endif
247  m_set_State[0] |= 0x1;
248  return m_Minlength;
249 }
250 
251 inline
253 {
254  return ((m_set_State[0] & 0xc) != 0);
255 }
256 
257 inline
259 {
260  return true;
261 }
262 
263 inline
265 {
266  m_Maxlength = 100000;
267  m_set_State[0] &= ~0xc;
268 }
269 
270 inline
272 {
273  ResetMaxlength();
274 }
275 
276 inline
278 {
279  return m_Maxlength;
280 }
281 
282 inline
284 {
285  m_Maxlength = value;
286  m_set_State[0] |= 0xc;
287 }
288 
289 inline
291 {
292 #ifdef _DEBUG
293  if (!IsSetMaxlength()) {
294  memset(&m_Maxlength,UnassignedByte(),sizeof(m_Maxlength));
295  }
296 #endif
297  m_set_State[0] |= 0x4;
298  return m_Maxlength;
299 }
300 
301 ///////////////////////////////////////////////////////////
302 ////////////////// end of inline methods //////////////////
303 ///////////////////////////////////////////////////////////
304 
305 
306 
307 
308 
309 END_objects_SCOPE // namespace ncbi::objects::
310 
312 
313 
314 #endif // OBJECTS_SCOREMAT_LOOPCONSTRAINT_BASE_HPP
CLoopConstraint_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
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_SCOREMAT_EXPORT
Definition: ncbi_export.h:736
CLoopConstraint_Base(const CLoopConstraint_Base &)
bool CanGetMaxlength(void) const
Check if it is safe to call GetMaxlength method.
CLoopConstraint_Base & operator=(const CLoopConstraint_Base &)
void ResetMinlength(void)
Reset Minlength data member.
bool IsSetMinlength(void) const
minimum length of unaligned region Check if a value has been assigned to Minlength data member.
bool CanGetMinlength(void) const
Check if it is safe to call GetMinlength method.
bool IsSetMaxlength(void) const
maximum length of unaligned region Check if a value has been assigned to Maxlength data member.
void ResetMaxlength(void)
Reset Maxlength data member.
void SetDefaultMinlength(void)
Assign default value to Minlength data member.
void SetDefaultMaxlength(void)
Assign default value to Maxlength data member.
TMinlength & SetMinlength(void)
Assign a value to Minlength data member.
TMaxlength & SetMaxlength(void)
Assign a value to Maxlength data member.
TMinlength GetMinlength(void) const
Get the Minlength member data.
TMaxlength GetMaxlength(void) const
Get the Maxlength member data.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Jul 10 14:36:19 2024 by modify_doxy.py rev. 669887