NCBI C++ ToolKit
Category_.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 Category_.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_CATEGORY_BASE_HPP
42 #define GUI_OBJECTS_CATEGORY_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 /// CCategory_Base --
73 ///
74 
76 {
78 public:
79  // constructor
80  CCategory_Base(void);
81  // destructor
82  virtual ~CCategory_Base(void);
83 
84  // type info
86 
87  // types
88  typedef string TName;
89  typedef int TOrder;
90  typedef string TDisplay_name;
91  typedef string THelp;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_name,
97  e_order,
98  e_display_name,
99  e_help
100  };
102 
103  // getters
104  // setters
105 
106  /// Check if a value has been assigned to Name data member.
107  ///
108  /// Data member Name is mandatory;
109  /// its type is defined as 'typedef string TName'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetName(void) const;
114 
115  /// Check if it is safe to call GetName method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetName(void) const;
121 
122  /// Reset Name data member.
123  void ResetName(void);
124 
125  /// Get the Name member data.
126  ///
127  /// @return
128  /// Reference to the member data.
129  const TName& GetName(void) const;
130 
131  /// Assign a value to Name data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetName(const TName& value);
136  void SetName(TName&& value);
137 
138  /// Assign a value to Name data member.
139  ///
140  /// @return
141  /// Reference to the data value.
142  TName& SetName(void);
143 
144  /// Check if a value has been assigned to Order data member.
145  ///
146  /// Data member Order is mandatory;
147  /// its type is defined as 'typedef int TOrder'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetOrder(void) const;
152 
153  /// Check if it is safe to call GetOrder method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetOrder(void) const;
159 
160  /// Reset Order data member.
161  void ResetOrder(void);
162 
163  /// Get the Order member data.
164  ///
165  /// @return
166  /// Copy of the member data.
167  TOrder GetOrder(void) const;
168 
169  /// Assign a value to Order data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetOrder(TOrder value);
174 
175  /// Assign a value to Order data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TOrder& SetOrder(void);
180 
181  /// Check if a value has been assigned to Display_name data member.
182  ///
183  /// Data member Display_name is optional;
184  /// its type is defined as 'typedef string TDisplay_name'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetDisplay_name(void) const;
189 
190  /// Check if it is safe to call GetDisplay_name method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetDisplay_name(void) const;
196 
197  /// Reset Display_name data member.
198  void ResetDisplay_name(void);
199 
200  /// Get the Display_name member data.
201  ///
202  /// @return
203  /// Reference to the member data.
204  const TDisplay_name& GetDisplay_name(void) const;
205 
206  /// Assign a value to Display_name data member.
207  ///
208  /// @param value
209  /// Value to assign
210  void SetDisplay_name(const TDisplay_name& value);
211  void SetDisplay_name(TDisplay_name&& value);
212 
213  /// Assign a value to Display_name data member.
214  ///
215  /// @return
216  /// Reference to the data value.
217  TDisplay_name& SetDisplay_name(void);
218 
219  /// Check if a value has been assigned to Help data member.
220  ///
221  /// Data member Help is optional;
222  /// its type is defined as 'typedef string THelp'
223  /// @return
224  /// - true, if a value has been assigned.
225  /// - false, otherwise.
226  bool IsSetHelp(void) const;
227 
228  /// Check if it is safe to call GetHelp method.
229  ///
230  /// @return
231  /// - true, if the data member is getatable.
232  /// - false, otherwise.
233  bool CanGetHelp(void) const;
234 
235  /// Reset Help data member.
236  void ResetHelp(void);
237 
238  /// Get the Help member data.
239  ///
240  /// @return
241  /// Reference to the member data.
242  const THelp& GetHelp(void) const;
243 
244  /// Assign a value to Help data member.
245  ///
246  /// @param value
247  /// Value to assign
248  void SetHelp(const THelp& value);
249  void SetHelp(THelp&& value);
250 
251  /// Assign a value to Help data member.
252  ///
253  /// @return
254  /// Reference to the data value.
255  THelp& SetHelp(void);
256 
257  /// Reset the whole object
258  virtual void Reset(void);
259 
260 
261 private:
262  // Prohibit copy constructor and assignment operator
265 
266  // data
267  Uint4 m_set_State[1];
268  string m_Name;
269  int m_Order;
271  string m_Help;
272 };
273 
274 /* @} */
275 
276 
277 
278 
279 
280 ///////////////////////////////////////////////////////////
281 ///////////////////// inline methods //////////////////////
282 ///////////////////////////////////////////////////////////
283 inline
285 {
286  return ((m_set_State[0] & 0x3) != 0);
287 }
288 
289 inline
291 {
292  return IsSetName();
293 }
294 
295 inline
297 {
298  if (!CanGetName()) {
299  ThrowUnassigned(0);
300  }
301  return m_Name;
302 }
303 
304 inline
306 {
307  m_Name = value;
308  m_set_State[0] |= 0x3;
309 }
310 
311 inline
313 {
314  m_Name = std::forward<CCategory_Base::TName>(value);
315  m_set_State[0] |= 0x3;
316 }
317 
318 inline
320 {
321 #ifdef _DEBUG
322  if (!IsSetName()) {
324  }
325 #endif
326  m_set_State[0] |= 0x1;
327  return m_Name;
328 }
329 
330 inline
332 {
333  return ((m_set_State[0] & 0xc) != 0);
334 }
335 
336 inline
338 {
339  return IsSetOrder();
340 }
341 
342 inline
344 {
345  m_Order = 0;
346  m_set_State[0] &= ~0xc;
347 }
348 
349 inline
351 {
352  if (!CanGetOrder()) {
353  ThrowUnassigned(1);
354  }
355  return m_Order;
356 }
357 
358 inline
360 {
361  m_Order = value;
362  m_set_State[0] |= 0xc;
363 }
364 
365 inline
367 {
368 #ifdef _DEBUG
369  if (!IsSetOrder()) {
370  memset(&m_Order,UnassignedByte(),sizeof(m_Order));
371  }
372 #endif
373  m_set_State[0] |= 0x4;
374  return m_Order;
375 }
376 
377 inline
379 {
380  return ((m_set_State[0] & 0x30) != 0);
381 }
382 
383 inline
385 {
386  return IsSetDisplay_name();
387 }
388 
389 inline
391 {
392  if (!CanGetDisplay_name()) {
393  ThrowUnassigned(2);
394  }
395  return m_Display_name;
396 }
397 
398 inline
400 {
402  m_set_State[0] |= 0x30;
403 }
404 
405 inline
407 {
408  m_Display_name = std::forward<CCategory_Base::TDisplay_name>(value);
409  m_set_State[0] |= 0x30;
410 }
411 
412 inline
414 {
415 #ifdef _DEBUG
416  if (!IsSetDisplay_name()) {
418  }
419 #endif
420  m_set_State[0] |= 0x10;
421  return m_Display_name;
422 }
423 
424 inline
426 {
427  return ((m_set_State[0] & 0xc0) != 0);
428 }
429 
430 inline
432 {
433  return IsSetHelp();
434 }
435 
436 inline
438 {
439  if (!CanGetHelp()) {
440  ThrowUnassigned(3);
441  }
442  return m_Help;
443 }
444 
445 inline
447 {
448  m_Help = value;
449  m_set_State[0] |= 0xc0;
450 }
451 
452 inline
454 {
455  m_Help = std::forward<CCategory_Base::THelp>(value);
456  m_set_State[0] |= 0xc0;
457 }
458 
459 inline
461 {
462 #ifdef _DEBUG
463  if (!IsSetHelp()) {
465  }
466 #endif
467  m_set_State[0] |= 0x40;
468  return m_Help;
469 }
470 
471 ///////////////////////////////////////////////////////////
472 ////////////////// end of inline methods //////////////////
473 ///////////////////////////////////////////////////////////
474 
475 
476 
477 
478 
479 END_objects_SCOPE // namespace ncbi::objects::
480 
482 
483 
484 #endif // GUI_OBJECTS_CATEGORY_BASE_HPP
CCategory_Base –.
Definition: Category_.hpp:76
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
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
bool IsSetOrder(void) const
Check if a value has been assigned to Order data member.
Definition: Category_.hpp:331
DECLARE_INTERNAL_TYPE_INFO()
void ResetOrder(void)
Reset Order data member.
Definition: Category_.hpp:343
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
Definition: Category_.hpp:284
TOrder GetOrder(void) const
Get the Order member data.
Definition: Category_.hpp:350
const TDisplay_name & GetDisplay_name(void) const
Get the Display_name member data.
Definition: Category_.hpp:390
TName & SetName(void)
Assign a value to Name data member.
Definition: Category_.hpp:319
bool CanGetHelp(void) const
Check if it is safe to call GetHelp method.
Definition: Category_.hpp:431
string TDisplay_name
Definition: Category_.hpp:90
bool IsSetHelp(void) const
Check if a value has been assigned to Help data member.
Definition: Category_.hpp:425
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Category_.hpp:101
CSerialObject Tparent
Definition: Category_.hpp:77
bool CanGetDisplay_name(void) const
Check if it is safe to call GetDisplay_name method.
Definition: Category_.hpp:384
const TName & GetName(void) const
Get the Name member data.
Definition: Category_.hpp:296
CCategory_Base & operator=(const CCategory_Base &)
bool CanGetName(void) const
Check if it is safe to call GetName method.
Definition: Category_.hpp:290
CCategory_Base(const CCategory_Base &)
TDisplay_name & SetDisplay_name(void)
Assign a value to Display_name data member.
Definition: Category_.hpp:413
bool IsSetDisplay_name(void) const
Check if a value has been assigned to Display_name data member.
Definition: Category_.hpp:378
TOrder & SetOrder(void)
Assign a value to Order data member.
Definition: Category_.hpp:366
bool CanGetOrder(void) const
Check if it is safe to call GetOrder method.
Definition: Category_.hpp:337
string m_Display_name
Definition: Category_.hpp:270
const THelp & GetHelp(void) const
Get the Help member data.
Definition: Category_.hpp:437
Uint4 m_set_State[1]
Definition: Category_.hpp:267
THelp & SetHelp(void)
Assign a value to Help data member.
Definition: Category_.hpp:460
Defines to provide correct exporting from DLLs in Windows.
Modified on Sun Feb 25 03:03:23 2024 by modify_doxy.py rev. 669887