NCBI C++ ToolKit
RangeValue_.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 RangeValue_.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/gui/objects/gui_objects.asn">gui_objects.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/gui/objects/gui_objects.def">gui_objects.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 GUI_OBJECTS_RANGEVALUE_BASE_HPP
42 #define GUI_OBJECTS_RANGEVALUE_BASE_HPP
43 
44 // extra headers
45 #include <gui/gui_export.h>
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
51 #include <string>
52 
54 
55 #ifndef BEGIN_objects_SCOPE
56 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
57 # define END_objects_SCOPE END_SCOPE(objects)
58 #endif
59 BEGIN_objects_SCOPE // namespace ncbi::objects::
60 
61 
62 // generated classes
63 
64 
65 /** @addtogroup dataspec_NCBI_SeqGraphical
66  *
67  * @{
68  */
69 
70 /////////////////////////////////////////////////////////////////////////////
71 ///
72 /// CRangeValue_Base --
73 ///
74 
76 {
78 public:
79  // constructor
80  CRangeValue_Base(void);
81  // destructor
82  virtual ~CRangeValue_Base(void);
83 
84  // type info
86 
87  // types
88  typedef string TMin;
89  typedef string TMax;
90  typedef bool TAutoscale;
91  typedef bool TInverse;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_min,
97  e_max,
98  e_autoscale,
99  e_inverse
100  };
102 
103  // getters
104  // setters
105 
106  /// Check if a value has been assigned to Min data member.
107  ///
108  /// Data member Min is mandatory;
109  /// its type is defined as 'typedef string TMin'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetMin(void) const;
114 
115  /// Check if it is safe to call GetMin method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetMin(void) const;
121 
122  /// Reset Min data member.
123  void ResetMin(void);
124 
125  /// Get the Min member data.
126  ///
127  /// @return
128  /// Reference to the member data.
129  const TMin& GetMin(void) const;
130 
131  /// Assign a value to Min data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetMin(const TMin& value);
136  void SetMin(TMin&& value);
137 
138  /// Assign a value to Min data member.
139  ///
140  /// @return
141  /// Reference to the data value.
142  TMin& SetMin(void);
143 
144  /// Check if a value has been assigned to Max data member.
145  ///
146  /// Data member Max is mandatory;
147  /// its type is defined as 'typedef string TMax'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetMax(void) const;
152 
153  /// Check if it is safe to call GetMax method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetMax(void) const;
159 
160  /// Reset Max data member.
161  void ResetMax(void);
162 
163  /// Get the Max member data.
164  ///
165  /// @return
166  /// Reference to the member data.
167  const TMax& GetMax(void) const;
168 
169  /// Assign a value to Max data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetMax(const TMax& value);
174  void SetMax(TMax&& value);
175 
176  /// Assign a value to Max data member.
177  ///
178  /// @return
179  /// Reference to the data value.
180  TMax& SetMax(void);
181 
182  /// if TRUE range min/max are ignored
183  /// Check if a value has been assigned to Autoscale data member.
184  ///
185  /// Data member Autoscale is optional with default true;
186  /// its type is defined as 'typedef bool TAutoscale'
187  /// @return
188  /// - true, if a value has been assigned.
189  /// - false, otherwise.
190  bool IsSetAutoscale(void) const;
191 
192  /// Check if it is safe to call GetAutoscale method.
193  ///
194  /// @return
195  /// - true, if the data member is getatable.
196  /// - false, otherwise.
197  bool CanGetAutoscale(void) const;
198 
199  /// Reset Autoscale data member.
200  void ResetAutoscale(void);
201 
202  /// Assign default value to Autoscale data member.
203  void SetDefaultAutoscale(void);
204 
205  /// Get the Autoscale member data.
206  ///
207  /// @return
208  /// Copy of the member data.
209  TAutoscale GetAutoscale(void) const;
210 
211  /// Assign a value to Autoscale data member.
212  ///
213  /// @param value
214  /// Value to assign
215  void SetAutoscale(TAutoscale value);
216 
217  /// Assign a value to Autoscale data member.
218  ///
219  /// @return
220  /// Reference to the data value.
221  TAutoscale& SetAutoscale(void);
222 
223  /// TRUE if max value should go first in UI
224  /// Check if a value has been assigned to Inverse data member.
225  ///
226  /// Data member Inverse is optional with default false;
227  /// its type is defined as 'typedef bool TInverse'
228  /// @return
229  /// - true, if a value has been assigned.
230  /// - false, otherwise.
231  bool IsSetInverse(void) const;
232 
233  /// Check if it is safe to call GetInverse method.
234  ///
235  /// @return
236  /// - true, if the data member is getatable.
237  /// - false, otherwise.
238  bool CanGetInverse(void) const;
239 
240  /// Reset Inverse data member.
241  void ResetInverse(void);
242 
243  /// Assign default value to Inverse data member.
244  void SetDefaultInverse(void);
245 
246  /// Get the Inverse member data.
247  ///
248  /// @return
249  /// Copy of the member data.
250  TInverse GetInverse(void) const;
251 
252  /// Assign a value to Inverse data member.
253  ///
254  /// @param value
255  /// Value to assign
256  void SetInverse(TInverse value);
257 
258  /// Assign a value to Inverse data member.
259  ///
260  /// @return
261  /// Reference to the data value.
262  TInverse& SetInverse(void);
263 
264  /// Reset the whole object
265  virtual void Reset(void);
266 
267 
268 private:
269  // Prohibit copy constructor and assignment operator
272 
273  // data
274  Uint4 m_set_State[1];
275  string m_Min;
276  string m_Max;
278  bool m_Inverse;
279 };
280 
281 /* @} */
282 
283 
284 
285 
286 
287 ///////////////////////////////////////////////////////////
288 ///////////////////// inline methods //////////////////////
289 ///////////////////////////////////////////////////////////
290 inline
292 {
293  return ((m_set_State[0] & 0x3) != 0);
294 }
295 
296 inline
298 {
299  return IsSetMin();
300 }
301 
302 inline
304 {
305  if (!CanGetMin()) {
306  ThrowUnassigned(0);
307  }
308  return m_Min;
309 }
310 
311 inline
313 {
314  m_Min = value;
315  m_set_State[0] |= 0x3;
316 }
317 
318 inline
320 {
321  m_Min = std::forward<CRangeValue_Base::TMin>(value);
322  m_set_State[0] |= 0x3;
323 }
324 
325 inline
327 {
328 #ifdef _DEBUG
329  if (!IsSetMin()) {
331  }
332 #endif
333  m_set_State[0] |= 0x1;
334  return m_Min;
335 }
336 
337 inline
339 {
340  return ((m_set_State[0] & 0xc) != 0);
341 }
342 
343 inline
345 {
346  return IsSetMax();
347 }
348 
349 inline
351 {
352  if (!CanGetMax()) {
353  ThrowUnassigned(1);
354  }
355  return m_Max;
356 }
357 
358 inline
360 {
361  m_Max = value;
362  m_set_State[0] |= 0xc;
363 }
364 
365 inline
367 {
368  m_Max = std::forward<CRangeValue_Base::TMax>(value);
369  m_set_State[0] |= 0xc;
370 }
371 
372 inline
374 {
375 #ifdef _DEBUG
376  if (!IsSetMax()) {
378  }
379 #endif
380  m_set_State[0] |= 0x4;
381  return m_Max;
382 }
383 
384 inline
386 {
387  return ((m_set_State[0] & 0x30) != 0);
388 }
389 
390 inline
392 {
393  return true;
394 }
395 
396 inline
398 {
399  m_Autoscale = true;
400  m_set_State[0] &= ~0x30;
401 }
402 
403 inline
405 {
406  ResetAutoscale();
407 }
408 
409 inline
411 {
412  return m_Autoscale;
413 }
414 
415 inline
417 {
418  m_Autoscale = value;
419  m_set_State[0] |= 0x30;
420 }
421 
422 inline
424 {
425 #ifdef _DEBUG
426  if (!IsSetAutoscale()) {
427  memset(&m_Autoscale,UnassignedByte(),sizeof(m_Autoscale));
428  }
429 #endif
430  m_set_State[0] |= 0x10;
431  return m_Autoscale;
432 }
433 
434 inline
436 {
437  return ((m_set_State[0] & 0xc0) != 0);
438 }
439 
440 inline
442 {
443  return true;
444 }
445 
446 inline
448 {
449  m_Inverse = false;
450  m_set_State[0] &= ~0xc0;
451 }
452 
453 inline
455 {
456  ResetInverse();
457 }
458 
459 inline
461 {
462  return m_Inverse;
463 }
464 
465 inline
467 {
468  m_Inverse = value;
469  m_set_State[0] |= 0xc0;
470 }
471 
472 inline
474 {
475 #ifdef _DEBUG
476  if (!IsSetInverse()) {
477  memset(&m_Inverse,UnassignedByte(),sizeof(m_Inverse));
478  }
479 #endif
480  m_set_State[0] |= 0x40;
481  return m_Inverse;
482 }
483 
484 ///////////////////////////////////////////////////////////
485 ////////////////// end of inline methods //////////////////
486 ///////////////////////////////////////////////////////////
487 
488 
489 
490 
491 
492 END_objects_SCOPE // namespace ncbi::objects::
493 
495 
496 
497 #endif // GUI_OBJECTS_RANGEVALUE_BASE_HPP
CRangeValue_Base –.
Definition: RangeValue_.hpp:76
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
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_GUIOBJECTS_EXPORT
Definition: gui_export.h:511
void ResetInverse(void)
Reset Inverse data member.
void SetDefaultAutoscale(void)
Assign default value to Autoscale data member.
bool CanGetAutoscale(void) const
Check if it is safe to call GetAutoscale method.
TInverse & SetInverse(void)
Assign a value to Inverse data member.
bool IsSetMax(void) const
Check if a value has been assigned to Max data member.
TAutoscale GetAutoscale(void) const
Get the Autoscale member data.
TAutoscale & SetAutoscale(void)
Assign a value to Autoscale data member.
CRangeValue_Base(const CRangeValue_Base &)
bool CanGetMin(void) const
Check if it is safe to call GetMin method.
TInverse GetInverse(void) const
Get the Inverse member data.
CSerialObject Tparent
Definition: RangeValue_.hpp:77
bool CanGetMax(void) const
Check if it is safe to call GetMax method.
bool IsSetMin(void) const
Check if a value has been assigned to Min data member.
CRangeValue_Base & operator=(const CRangeValue_Base &)
TMin & SetMin(void)
Assign a value to Min data member.
TMax & SetMax(void)
Assign a value to Max data member.
void ResetAutoscale(void)
Reset Autoscale data member.
const TMax & GetMax(void) const
Get the Max member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
const TMin & GetMin(void) const
Get the Min member data.
Uint4 m_set_State[1]
void SetDefaultInverse(void)
Assign default value to Inverse data member.
bool CanGetInverse(void) const
Check if it is safe to call GetInverse method.
bool IsSetInverse(void) const
TRUE if max value should go first in UI Check if a value has been assigned to Inverse data member.
bool IsSetAutoscale(void) const
if TRUE range min/max are ignored Check if a value has been assigned to Autoscale data member.
Defines to provide correct exporting from DLLs in Windows.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat Jun 29 13:52:11 2024 by modify_doxy.py rev. 669887