NCBI C++ ToolKit
Cdd_Viewer_Rect_.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 Cdd_Viewer_Rect_.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/cdd/cdd.asn">cdd.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/cdd/cdd.def">cdd.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_CDD_CDD_VIEWER_RECT_BASE_HPP
42 #define OBJECTS_CDD_CDD_VIEWER_RECT_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_Cdd
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 /// Cdd projects store a set of CDs, typically related to each other
65 /// relationships would be specified using the ancestors fields in the
66 /// individual CD objects. For use with CD-Tree, a program to visualize
67 /// curated CD hierarchies and evidence for hierarchical family structures.
68 ///
69 /// CCdd_Viewer_Rect_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CCdd_Viewer_Rect_Base(void);
80 
81  // type info
83 
84  // types
85  typedef int TTop;
86  typedef int TLeft;
87  typedef int TWidth;
88  typedef int THeight;
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_top,
94  e_left,
95  e_width,
96  e_height
97  };
99 
100  // getters
101  // setters
102 
103  /// top coordinate
104  /// Check if a value has been assigned to Top data member.
105  ///
106  /// Data member Top is mandatory;
107  /// its type is defined as 'typedef int TTop'
108  /// @return
109  /// - true, if a value has been assigned.
110  /// - false, otherwise.
111  bool IsSetTop(void) const;
112 
113  /// Check if it is safe to call GetTop method.
114  ///
115  /// @return
116  /// - true, if the data member is getatable.
117  /// - false, otherwise.
118  bool CanGetTop(void) const;
119 
120  /// Reset Top data member.
121  void ResetTop(void);
122 
123  /// Get the Top member data.
124  ///
125  /// @return
126  /// Copy of the member data.
127  TTop GetTop(void) const;
128 
129  /// Assign a value to Top data member.
130  ///
131  /// @param value
132  /// Value to assign
133  void SetTop(TTop value);
134 
135  /// Assign a value to Top data member.
136  ///
137  /// @return
138  /// Reference to the data value.
139  TTop& SetTop(void);
140 
141  /// left coordinate
142  /// Check if a value has been assigned to Left data member.
143  ///
144  /// Data member Left is mandatory;
145  /// its type is defined as 'typedef int TLeft'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetLeft(void) const;
150 
151  /// Check if it is safe to call GetLeft method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetLeft(void) const;
157 
158  /// Reset Left data member.
159  void ResetLeft(void);
160 
161  /// Get the Left member data.
162  ///
163  /// @return
164  /// Copy of the member data.
165  TLeft GetLeft(void) const;
166 
167  /// Assign a value to Left data member.
168  ///
169  /// @param value
170  /// Value to assign
171  void SetLeft(TLeft value);
172 
173  /// Assign a value to Left data member.
174  ///
175  /// @return
176  /// Reference to the data value.
177  TLeft& SetLeft(void);
178 
179  /// width
180  /// Check if a value has been assigned to Width data member.
181  ///
182  /// Data member Width is mandatory;
183  /// its type is defined as 'typedef int TWidth'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetWidth(void) const;
188 
189  /// Check if it is safe to call GetWidth method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetWidth(void) const;
195 
196  /// Reset Width data member.
197  void ResetWidth(void);
198 
199  /// Get the Width member data.
200  ///
201  /// @return
202  /// Copy of the member data.
203  TWidth GetWidth(void) const;
204 
205  /// Assign a value to Width data member.
206  ///
207  /// @param value
208  /// Value to assign
209  void SetWidth(TWidth value);
210 
211  /// Assign a value to Width data member.
212  ///
213  /// @return
214  /// Reference to the data value.
215  TWidth& SetWidth(void);
216 
217  /// height
218  /// Check if a value has been assigned to Height data member.
219  ///
220  /// Data member Height is mandatory;
221  /// its type is defined as 'typedef int THeight'
222  /// @return
223  /// - true, if a value has been assigned.
224  /// - false, otherwise.
225  bool IsSetHeight(void) const;
226 
227  /// Check if it is safe to call GetHeight method.
228  ///
229  /// @return
230  /// - true, if the data member is getatable.
231  /// - false, otherwise.
232  bool CanGetHeight(void) const;
233 
234  /// Reset Height data member.
235  void ResetHeight(void);
236 
237  /// Get the Height member data.
238  ///
239  /// @return
240  /// Copy of the member data.
241  THeight GetHeight(void) const;
242 
243  /// Assign a value to Height data member.
244  ///
245  /// @param value
246  /// Value to assign
247  void SetHeight(THeight value);
248 
249  /// Assign a value to Height data member.
250  ///
251  /// @return
252  /// Reference to the data value.
253  THeight& SetHeight(void);
254 
255  /// Reset the whole object
256  virtual void Reset(void);
257 
258 
259 private:
260  // Prohibit copy constructor and assignment operator
263 
264  // data
265  Uint4 m_set_State[1];
266  int m_Top;
267  int m_Left;
268  int m_Width;
269  int m_Height;
270 };
271 
272 /* @} */
273 
274 
275 
276 
277 
278 ///////////////////////////////////////////////////////////
279 ///////////////////// inline methods //////////////////////
280 ///////////////////////////////////////////////////////////
281 inline
283 {
284  return ((m_set_State[0] & 0x3) != 0);
285 }
286 
287 inline
289 {
290  return IsSetTop();
291 }
292 
293 inline
295 {
296  m_Top = 0;
297  m_set_State[0] &= ~0x3;
298 }
299 
300 inline
302 {
303  if (!CanGetTop()) {
304  ThrowUnassigned(0);
305  }
306  return m_Top;
307 }
308 
309 inline
311 {
312  m_Top = value;
313  m_set_State[0] |= 0x3;
314 }
315 
316 inline
318 {
319 #ifdef _DEBUG
320  if (!IsSetTop()) {
321  memset(&m_Top,UnassignedByte(),sizeof(m_Top));
322  }
323 #endif
324  m_set_State[0] |= 0x1;
325  return m_Top;
326 }
327 
328 inline
330 {
331  return ((m_set_State[0] & 0xc) != 0);
332 }
333 
334 inline
336 {
337  return IsSetLeft();
338 }
339 
340 inline
342 {
343  m_Left = 0;
344  m_set_State[0] &= ~0xc;
345 }
346 
347 inline
349 {
350  if (!CanGetLeft()) {
351  ThrowUnassigned(1);
352  }
353  return m_Left;
354 }
355 
356 inline
358 {
359  m_Left = value;
360  m_set_State[0] |= 0xc;
361 }
362 
363 inline
365 {
366 #ifdef _DEBUG
367  if (!IsSetLeft()) {
368  memset(&m_Left,UnassignedByte(),sizeof(m_Left));
369  }
370 #endif
371  m_set_State[0] |= 0x4;
372  return m_Left;
373 }
374 
375 inline
377 {
378  return ((m_set_State[0] & 0x30) != 0);
379 }
380 
381 inline
383 {
384  return IsSetWidth();
385 }
386 
387 inline
389 {
390  m_Width = 0;
391  m_set_State[0] &= ~0x30;
392 }
393 
394 inline
396 {
397  if (!CanGetWidth()) {
398  ThrowUnassigned(2);
399  }
400  return m_Width;
401 }
402 
403 inline
405 {
406  m_Width = value;
407  m_set_State[0] |= 0x30;
408 }
409 
410 inline
412 {
413 #ifdef _DEBUG
414  if (!IsSetWidth()) {
415  memset(&m_Width,UnassignedByte(),sizeof(m_Width));
416  }
417 #endif
418  m_set_State[0] |= 0x10;
419  return m_Width;
420 }
421 
422 inline
424 {
425  return ((m_set_State[0] & 0xc0) != 0);
426 }
427 
428 inline
430 {
431  return IsSetHeight();
432 }
433 
434 inline
436 {
437  m_Height = 0;
438  m_set_State[0] &= ~0xc0;
439 }
440 
441 inline
443 {
444  if (!CanGetHeight()) {
445  ThrowUnassigned(3);
446  }
447  return m_Height;
448 }
449 
450 inline
452 {
453  m_Height = value;
454  m_set_State[0] |= 0xc0;
455 }
456 
457 inline
459 {
460 #ifdef _DEBUG
461  if (!IsSetHeight()) {
462  memset(&m_Height,UnassignedByte(),sizeof(m_Height));
463  }
464 #endif
465  m_set_State[0] |= 0x40;
466  return m_Height;
467 }
468 
469 ///////////////////////////////////////////////////////////
470 ////////////////// end of inline methods //////////////////
471 ///////////////////////////////////////////////////////////
472 
473 
474 
475 
476 
477 END_objects_SCOPE // namespace ncbi::objects::
478 
480 
481 
482 #endif // OBJECTS_CDD_CDD_VIEWER_RECT_BASE_HPP
Cdd projects store a set of CDs, typically related to each other relationships would be specified usi...
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_CDD_EXPORT
Definition: ncbi_export.h:368
bool CanGetTop(void) const
Check if it is safe to call GetTop method.
bool CanGetWidth(void) const
Check if it is safe to call GetWidth method.
THeight & SetHeight(void)
Assign a value to Height data member.
CCdd_Viewer_Rect_Base(const CCdd_Viewer_Rect_Base &)
TWidth & SetWidth(void)
Assign a value to Width data member.
bool IsSetHeight(void) const
height Check if a value has been assigned to Height data member.
TTop GetTop(void) const
Get the Top member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
CCdd_Viewer_Rect_Base & operator=(const CCdd_Viewer_Rect_Base &)
THeight GetHeight(void) const
Get the Height member data.
bool CanGetLeft(void) const
Check if it is safe to call GetLeft method.
TLeft & SetLeft(void)
Assign a value to Left data member.
void ResetHeight(void)
Reset Height data member.
TLeft GetLeft(void) const
Get the Left member data.
void ResetLeft(void)
Reset Left data member.
bool IsSetLeft(void) const
left coordinate Check if a value has been assigned to Left data member.
bool IsSetTop(void) const
top coordinate Check if a value has been assigned to Top data member.
bool CanGetHeight(void) const
Check if it is safe to call GetHeight method.
TTop & SetTop(void)
Assign a value to Top data member.
void ResetWidth(void)
Reset Width data member.
bool IsSetWidth(void) const
width Check if a value has been assigned to Width data member.
TWidth GetWidth(void) const
Get the Width member data.
void ResetTop(void)
Reset Top data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:43 2024 by modify_doxy.py rev. 669887