NCBI C++ ToolKit
PC_Bracket_.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 PC_Bracket_.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/pcsubstance/pcsubstance.asn">pcsubstance.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/pcsubstance/pcsubstance.def">pcsubstance.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_PCSUBSTANCE_PC_BRACKET_BASE_HPP
42 #define OBJECTS_PCSUBSTANCE_PC_BRACKET_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_PCSubstance
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 /// Display coordinates for a bracket (e.g. from MOL field SDI)
65 ///
66 /// CPC_Bracket_Base --
67 ///
68 
70 {
72 public:
73  // constructor
74  CPC_Bracket_Base(void);
75  // destructor
76  virtual ~CPC_Bracket_Base(void);
77 
78  // type info
80 
81  // types
82  typedef double TX1;
83  typedef double TY1;
84  typedef double TX2;
85  typedef double TY2;
86 
87  // member index
88  enum class E_memberIndex {
89  e__allMandatory = 0,
90  e_x1,
91  e_y1,
92  e_x2,
93  e_y2
94  };
96 
97  // getters
98  // setters
99 
100  /// Check if a value has been assigned to X1 data member.
101  ///
102  /// Data member X1 is mandatory;
103  /// its type is defined as 'typedef double TX1'
104  /// @return
105  /// - true, if a value has been assigned.
106  /// - false, otherwise.
107  bool IsSetX1(void) const;
108 
109  /// Check if it is safe to call GetX1 method.
110  ///
111  /// @return
112  /// - true, if the data member is getatable.
113  /// - false, otherwise.
114  bool CanGetX1(void) const;
115 
116  /// Reset X1 data member.
117  void ResetX1(void);
118 
119  /// Get the X1 member data.
120  ///
121  /// @return
122  /// Copy of the member data.
123  TX1 GetX1(void) const;
124 
125  /// Assign a value to X1 data member.
126  ///
127  /// @param value
128  /// Value to assign
129  void SetX1(TX1 value);
130 
131  /// Assign a value to X1 data member.
132  ///
133  /// @return
134  /// Reference to the data value.
135  TX1& SetX1(void);
136 
137  /// Check if a value has been assigned to Y1 data member.
138  ///
139  /// Data member Y1 is mandatory;
140  /// its type is defined as 'typedef double TY1'
141  /// @return
142  /// - true, if a value has been assigned.
143  /// - false, otherwise.
144  bool IsSetY1(void) const;
145 
146  /// Check if it is safe to call GetY1 method.
147  ///
148  /// @return
149  /// - true, if the data member is getatable.
150  /// - false, otherwise.
151  bool CanGetY1(void) const;
152 
153  /// Reset Y1 data member.
154  void ResetY1(void);
155 
156  /// Get the Y1 member data.
157  ///
158  /// @return
159  /// Copy of the member data.
160  TY1 GetY1(void) const;
161 
162  /// Assign a value to Y1 data member.
163  ///
164  /// @param value
165  /// Value to assign
166  void SetY1(TY1 value);
167 
168  /// Assign a value to Y1 data member.
169  ///
170  /// @return
171  /// Reference to the data value.
172  TY1& SetY1(void);
173 
174  /// Check if a value has been assigned to X2 data member.
175  ///
176  /// Data member X2 is mandatory;
177  /// its type is defined as 'typedef double TX2'
178  /// @return
179  /// - true, if a value has been assigned.
180  /// - false, otherwise.
181  bool IsSetX2(void) const;
182 
183  /// Check if it is safe to call GetX2 method.
184  ///
185  /// @return
186  /// - true, if the data member is getatable.
187  /// - false, otherwise.
188  bool CanGetX2(void) const;
189 
190  /// Reset X2 data member.
191  void ResetX2(void);
192 
193  /// Get the X2 member data.
194  ///
195  /// @return
196  /// Copy of the member data.
197  TX2 GetX2(void) const;
198 
199  /// Assign a value to X2 data member.
200  ///
201  /// @param value
202  /// Value to assign
203  void SetX2(TX2 value);
204 
205  /// Assign a value to X2 data member.
206  ///
207  /// @return
208  /// Reference to the data value.
209  TX2& SetX2(void);
210 
211  /// Check if a value has been assigned to Y2 data member.
212  ///
213  /// Data member Y2 is mandatory;
214  /// its type is defined as 'typedef double TY2'
215  /// @return
216  /// - true, if a value has been assigned.
217  /// - false, otherwise.
218  bool IsSetY2(void) const;
219 
220  /// Check if it is safe to call GetY2 method.
221  ///
222  /// @return
223  /// - true, if the data member is getatable.
224  /// - false, otherwise.
225  bool CanGetY2(void) const;
226 
227  /// Reset Y2 data member.
228  void ResetY2(void);
229 
230  /// Get the Y2 member data.
231  ///
232  /// @return
233  /// Copy of the member data.
234  TY2 GetY2(void) const;
235 
236  /// Assign a value to Y2 data member.
237  ///
238  /// @param value
239  /// Value to assign
240  void SetY2(TY2 value);
241 
242  /// Assign a value to Y2 data member.
243  ///
244  /// @return
245  /// Reference to the data value.
246  TY2& SetY2(void);
247 
248  /// Reset the whole object
249  virtual void Reset(void);
250 
251 
252 private:
253  // Prohibit copy constructor and assignment operator
256 
257  // data
258  Uint4 m_set_State[1];
259  double m_X1;
260  double m_Y1;
261  double m_X2;
262  double m_Y2;
263 };
264 
265 /* @} */
266 
267 
268 
269 
270 
271 ///////////////////////////////////////////////////////////
272 ///////////////////// inline methods //////////////////////
273 ///////////////////////////////////////////////////////////
274 inline
276 {
277  return ((m_set_State[0] & 0x3) != 0);
278 }
279 
280 inline
282 {
283  return IsSetX1();
284 }
285 
286 inline
288 {
289  m_X1 = 0;
290  m_set_State[0] &= ~0x3;
291 }
292 
293 inline
295 {
296  if (!CanGetX1()) {
297  ThrowUnassigned(0);
298  }
299  return m_X1;
300 }
301 
302 inline
304 {
305  m_X1 = value;
306  m_set_State[0] |= 0x3;
307 }
308 
309 inline
311 {
312 #ifdef _DEBUG
313  if (!IsSetX1()) {
314  memset(&m_X1,UnassignedByte(),sizeof(m_X1));
315  }
316 #endif
317  m_set_State[0] |= 0x1;
318  return m_X1;
319 }
320 
321 inline
323 {
324  return ((m_set_State[0] & 0xc) != 0);
325 }
326 
327 inline
329 {
330  return IsSetY1();
331 }
332 
333 inline
335 {
336  m_Y1 = 0;
337  m_set_State[0] &= ~0xc;
338 }
339 
340 inline
342 {
343  if (!CanGetY1()) {
344  ThrowUnassigned(1);
345  }
346  return m_Y1;
347 }
348 
349 inline
351 {
352  m_Y1 = value;
353  m_set_State[0] |= 0xc;
354 }
355 
356 inline
358 {
359 #ifdef _DEBUG
360  if (!IsSetY1()) {
361  memset(&m_Y1,UnassignedByte(),sizeof(m_Y1));
362  }
363 #endif
364  m_set_State[0] |= 0x4;
365  return m_Y1;
366 }
367 
368 inline
370 {
371  return ((m_set_State[0] & 0x30) != 0);
372 }
373 
374 inline
376 {
377  return IsSetX2();
378 }
379 
380 inline
382 {
383  m_X2 = 0;
384  m_set_State[0] &= ~0x30;
385 }
386 
387 inline
389 {
390  if (!CanGetX2()) {
391  ThrowUnassigned(2);
392  }
393  return m_X2;
394 }
395 
396 inline
398 {
399  m_X2 = value;
400  m_set_State[0] |= 0x30;
401 }
402 
403 inline
405 {
406 #ifdef _DEBUG
407  if (!IsSetX2()) {
408  memset(&m_X2,UnassignedByte(),sizeof(m_X2));
409  }
410 #endif
411  m_set_State[0] |= 0x10;
412  return m_X2;
413 }
414 
415 inline
417 {
418  return ((m_set_State[0] & 0xc0) != 0);
419 }
420 
421 inline
423 {
424  return IsSetY2();
425 }
426 
427 inline
429 {
430  m_Y2 = 0;
431  m_set_State[0] &= ~0xc0;
432 }
433 
434 inline
436 {
437  if (!CanGetY2()) {
438  ThrowUnassigned(3);
439  }
440  return m_Y2;
441 }
442 
443 inline
445 {
446  m_Y2 = value;
447  m_set_State[0] |= 0xc0;
448 }
449 
450 inline
452 {
453 #ifdef _DEBUG
454  if (!IsSetY2()) {
455  memset(&m_Y2,UnassignedByte(),sizeof(m_Y2));
456  }
457 #endif
458  m_set_State[0] |= 0x40;
459  return m_Y2;
460 }
461 
462 ///////////////////////////////////////////////////////////
463 ////////////////// end of inline methods //////////////////
464 ///////////////////////////////////////////////////////////
465 
466 
467 
468 
469 
470 END_objects_SCOPE // namespace ncbi::objects::
471 
473 
474 
475 #endif // OBJECTS_PCSUBSTANCE_PC_BRACKET_BASE_HPP
Display coordinates for a bracket (e.g.
Definition: PC_Bracket_.hpp:70
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_PCSUBSTANCE_EXPORT
Definition: ncbi_export.h:688
void ResetY1(void)
Reset Y1 data member.
TX1 & SetX1(void)
Assign a value to X1 data member.
void ResetY2(void)
Reset Y2 data member.
TX2 & SetX2(void)
Assign a value to X2 data member.
bool IsSetY2(void) const
Check if a value has been assigned to Y2 data member.
bool CanGetY2(void) const
Check if it is safe to call GetY2 method.
TY2 & SetY2(void)
Assign a value to Y2 data member.
TY1 & SetY1(void)
Assign a value to Y1 data member.
bool CanGetX2(void) const
Check if it is safe to call GetX2 method.
TY2 GetY2(void) const
Get the Y2 member data.
TX2 GetX2(void) const
Get the X2 member data.
CSerialObject Tparent
Definition: PC_Bracket_.hpp:71
TX1 GetX1(void) const
Get the X1 member data.
TY1 GetY1(void) const
Get the Y1 member data.
void ResetX1(void)
Reset X1 data member.
CPC_Bracket_Base & operator=(const CPC_Bracket_Base &)
bool IsSetX2(void) const
Check if a value has been assigned to X2 data member.
bool CanGetX1(void) const
Check if it is safe to call GetX1 method.
bool IsSetY1(void) const
Check if a value has been assigned to Y1 data member.
Uint4 m_set_State[1]
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: PC_Bracket_.hpp:95
void ResetX2(void)
Reset X2 data member.
bool IsSetX1(void) const
Check if a value has been assigned to X1 data member.
bool CanGetY1(void) const
Check if it is safe to call GetY1 method.
CPC_Bracket_Base(const CPC_Bracket_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Thu Apr 11 15:12:56 2024 by modify_doxy.py rev. 669887