NCBI C++ ToolKit
PluginValueRangeConstraint_.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 PluginValueRangeConstraint_.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_PLUGINVALUERANGECONSTRAINT_BASE_HPP
42 #define GUI_OBJECTS_PLUGINVALUERANGECONSTRAINT_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_Plugin
66  *
67  * @{
68  */
69 
70 /////////////////////////////////////////////////////////////////////////////
71 ///
72 /// CPluginValueRangeConstraint_Base --
73 ///
74 
76 {
78 public:
79  // constructor
81  // destructor
82  virtual ~CPluginValueRangeConstraint_Base(void);
83 
84  // type info
86 
87  // types
88  typedef string TLower;
89  typedef string TUpper;
90 
91  // member index
92  enum class E_memberIndex {
93  e__allMandatory = 0,
94  e_lower,
95  e_upper
96  };
98 
99  // getters
100  // setters
101 
102  /// Check if a value has been assigned to Lower data member.
103  ///
104  /// Data member Lower is mandatory;
105  /// its type is defined as 'typedef string TLower'
106  /// @return
107  /// - true, if a value has been assigned.
108  /// - false, otherwise.
109  bool IsSetLower(void) const;
110 
111  /// Check if it is safe to call GetLower method.
112  ///
113  /// @return
114  /// - true, if the data member is getatable.
115  /// - false, otherwise.
116  bool CanGetLower(void) const;
117 
118  /// Reset Lower data member.
119  void ResetLower(void);
120 
121  /// Get the Lower member data.
122  ///
123  /// @return
124  /// Reference to the member data.
125  const TLower& GetLower(void) const;
126 
127  /// Assign a value to Lower data member.
128  ///
129  /// @param value
130  /// Value to assign
131  void SetLower(const TLower& value);
132  void SetLower(TLower&& value);
133 
134  /// Assign a value to Lower data member.
135  ///
136  /// @return
137  /// Reference to the data value.
138  TLower& SetLower(void);
139 
140  /// Check if a value has been assigned to Upper data member.
141  ///
142  /// Data member Upper is mandatory;
143  /// its type is defined as 'typedef string TUpper'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetUpper(void) const;
148 
149  /// Check if it is safe to call GetUpper method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetUpper(void) const;
155 
156  /// Reset Upper data member.
157  void ResetUpper(void);
158 
159  /// Get the Upper member data.
160  ///
161  /// @return
162  /// Reference to the member data.
163  const TUpper& GetUpper(void) const;
164 
165  /// Assign a value to Upper data member.
166  ///
167  /// @param value
168  /// Value to assign
169  void SetUpper(const TUpper& value);
170  void SetUpper(TUpper&& value);
171 
172  /// Assign a value to Upper data member.
173  ///
174  /// @return
175  /// Reference to the data value.
176  TUpper& SetUpper(void);
177 
178  /// Reset the whole object
179  virtual void Reset(void);
180 
181 
182 private:
183  // Prohibit copy constructor and assignment operator
186 
187  // data
188  Uint4 m_set_State[1];
189  string m_Lower;
190  string m_Upper;
191 };
192 
193 /* @} */
194 
195 
196 
197 
198 
199 ///////////////////////////////////////////////////////////
200 ///////////////////// inline methods //////////////////////
201 ///////////////////////////////////////////////////////////
202 inline
204 {
205  return ((m_set_State[0] & 0x3) != 0);
206 }
207 
208 inline
210 {
211  return IsSetLower();
212 }
213 
214 inline
216 {
217  if (!CanGetLower()) {
218  ThrowUnassigned(0);
219  }
220  return m_Lower;
221 }
222 
223 inline
225 {
226  m_Lower = value;
227  m_set_State[0] |= 0x3;
228 }
229 
230 inline
232 {
233  m_Lower = std::forward<CPluginValueRangeConstraint_Base::TLower>(value);
234  m_set_State[0] |= 0x3;
235 }
236 
237 inline
239 {
240 #ifdef _DEBUG
241  if (!IsSetLower()) {
243  }
244 #endif
245  m_set_State[0] |= 0x1;
246  return m_Lower;
247 }
248 
249 inline
251 {
252  return ((m_set_State[0] & 0xc) != 0);
253 }
254 
255 inline
257 {
258  return IsSetUpper();
259 }
260 
261 inline
263 {
264  if (!CanGetUpper()) {
265  ThrowUnassigned(1);
266  }
267  return m_Upper;
268 }
269 
270 inline
272 {
273  m_Upper = value;
274  m_set_State[0] |= 0xc;
275 }
276 
277 inline
279 {
280  m_Upper = std::forward<CPluginValueRangeConstraint_Base::TUpper>(value);
281  m_set_State[0] |= 0xc;
282 }
283 
284 inline
286 {
287 #ifdef _DEBUG
288  if (!IsSetUpper()) {
290  }
291 #endif
292  m_set_State[0] |= 0x4;
293  return m_Upper;
294 }
295 
296 ///////////////////////////////////////////////////////////
297 ////////////////// end of inline methods //////////////////
298 ///////////////////////////////////////////////////////////
299 
300 
301 
302 
303 
304 END_objects_SCOPE // namespace ncbi::objects::
305 
307 
308 
309 #endif // GUI_OBJECTS_PLUGINVALUERANGECONSTRAINT_BASE_HPP
CPluginValueRangeConstraint_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
const TUpper & GetUpper(void) const
Get the Upper member data.
bool IsSetLower(void) const
Check if a value has been assigned to Lower data member.
CPluginValueRangeConstraint_Base(const CPluginValueRangeConstraint_Base &)
TUpper & SetUpper(void)
Assign a value to Upper data member.
CPluginValueRangeConstraint_Base & operator=(const CPluginValueRangeConstraint_Base &)
const TLower & GetLower(void) const
Get the Lower member data.
bool IsSetUpper(void) const
Check if a value has been assigned to Upper data member.
bool CanGetLower(void) const
Check if it is safe to call GetLower method.
TLower & SetLower(void)
Assign a value to Lower data member.
bool CanGetUpper(void) const
Check if it is safe to call GetUpper method.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Defines to provide correct exporting from DLLs in Windows.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:11 2024 by modify_doxy.py rev. 669887