NCBI C++ ToolKit
Byte_graph_.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 Byte_graph_.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/seqres/seqres.asn">seqres.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqres/seqres.def">seqres.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_SEQRES_BYTE_GRAPH_BASE_HPP
42 #define OBJECTS_SEQRES_BYTE_GRAPH_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_Seqres
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// integer from 0-255
69 ///
70 /// CByte_graph_Base --
71 ///
72 
74 {
76 public:
77  // constructor
78  CByte_graph_Base(void);
79  // destructor
80  virtual ~CByte_graph_Base(void);
81 
82  // type info
84 
85  // types
86  typedef int TMax;
87  typedef int TMin;
88  typedef int TAxis;
89  typedef vector< char > TValues;
90 
91  // member index
92  enum class E_memberIndex {
93  e__allMandatory = 0,
94  e_max,
95  e_min,
96  e_axis,
97  e_values
98  };
100 
101  // getters
102  // setters
103 
104  /// Check if a value has been assigned to Max data member.
105  ///
106  /// Data member Max is mandatory;
107  /// its type is defined as 'typedef int TMax'
108  /// @return
109  /// - true, if a value has been assigned.
110  /// - false, otherwise.
111  bool IsSetMax(void) const;
112 
113  /// Check if it is safe to call GetMax method.
114  ///
115  /// @return
116  /// - true, if the data member is getatable.
117  /// - false, otherwise.
118  bool CanGetMax(void) const;
119 
120  /// Reset Max data member.
121  void ResetMax(void);
122 
123  /// Get the Max member data.
124  ///
125  /// @return
126  /// Copy of the member data.
127  TMax GetMax(void) const;
128 
129  /// Assign a value to Max data member.
130  ///
131  /// @param value
132  /// Value to assign
133  void SetMax(TMax value);
134 
135  /// Assign a value to Max data member.
136  ///
137  /// @return
138  /// Reference to the data value.
139  TMax& SetMax(void);
140 
141  /// Check if a value has been assigned to Min data member.
142  ///
143  /// Data member Min is mandatory;
144  /// its type is defined as 'typedef int TMin'
145  /// @return
146  /// - true, if a value has been assigned.
147  /// - false, otherwise.
148  bool IsSetMin(void) const;
149 
150  /// Check if it is safe to call GetMin method.
151  ///
152  /// @return
153  /// - true, if the data member is getatable.
154  /// - false, otherwise.
155  bool CanGetMin(void) const;
156 
157  /// Reset Min data member.
158  void ResetMin(void);
159 
160  /// Get the Min member data.
161  ///
162  /// @return
163  /// Copy of the member data.
164  TMin GetMin(void) const;
165 
166  /// Assign a value to Min data member.
167  ///
168  /// @param value
169  /// Value to assign
170  void SetMin(TMin value);
171 
172  /// Assign a value to Min data member.
173  ///
174  /// @return
175  /// Reference to the data value.
176  TMin& SetMin(void);
177 
178  /// Check if a value has been assigned to Axis data member.
179  ///
180  /// Data member Axis is mandatory;
181  /// its type is defined as 'typedef int TAxis'
182  /// @return
183  /// - true, if a value has been assigned.
184  /// - false, otherwise.
185  bool IsSetAxis(void) const;
186 
187  /// Check if it is safe to call GetAxis method.
188  ///
189  /// @return
190  /// - true, if the data member is getatable.
191  /// - false, otherwise.
192  bool CanGetAxis(void) const;
193 
194  /// Reset Axis data member.
195  void ResetAxis(void);
196 
197  /// Get the Axis member data.
198  ///
199  /// @return
200  /// Copy of the member data.
201  TAxis GetAxis(void) const;
202 
203  /// Assign a value to Axis data member.
204  ///
205  /// @param value
206  /// Value to assign
207  void SetAxis(TAxis value);
208 
209  /// Assign a value to Axis data member.
210  ///
211  /// @return
212  /// Reference to the data value.
213  TAxis& SetAxis(void);
214 
215  /// Check if a value has been assigned to Values data member.
216  ///
217  /// Data member Values is mandatory;
218  /// its type is defined as 'typedef vector< char > TValues'
219  /// @return
220  /// - true, if a value has been assigned.
221  /// - false, otherwise.
222  bool IsSetValues(void) const;
223 
224  /// Check if it is safe to call GetValues method.
225  ///
226  /// @return
227  /// - true, if the data member is getatable.
228  /// - false, otherwise.
229  bool CanGetValues(void) const;
230 
231  /// Reset Values data member.
232  void ResetValues(void);
233 
234  /// Get the Values member data.
235  ///
236  /// @return
237  /// Reference to the member data.
238  const TValues& GetValues(void) const;
239 
240  /// Assign a value to Values data member.
241  ///
242  /// @return
243  /// Reference to the data value.
244  TValues& SetValues(void);
245 
246  /// Reset the whole object
247  virtual void Reset(void);
248 
249 
250 private:
251  // Prohibit copy constructor and assignment operator
254 
255  // data
256  Uint4 m_set_State[1];
257  int m_Max;
258  int m_Min;
259  int m_Axis;
260  vector< char > m_Values;
261 };
262 
263 /* @} */
264 
265 
266 
267 
268 
269 ///////////////////////////////////////////////////////////
270 ///////////////////// inline methods //////////////////////
271 ///////////////////////////////////////////////////////////
272 inline
274 {
275  return ((m_set_State[0] & 0x3) != 0);
276 }
277 
278 inline
280 {
281  return IsSetMax();
282 }
283 
284 inline
286 {
287  m_Max = 0;
288  m_set_State[0] &= ~0x3;
289 }
290 
291 inline
293 {
294  if (!CanGetMax()) {
295  ThrowUnassigned(0);
296  }
297  return m_Max;
298 }
299 
300 inline
302 {
303  m_Max = value;
304  m_set_State[0] |= 0x3;
305 }
306 
307 inline
309 {
310 #ifdef _DEBUG
311  if (!IsSetMax()) {
312  memset(&m_Max,UnassignedByte(),sizeof(m_Max));
313  }
314 #endif
315  m_set_State[0] |= 0x1;
316  return m_Max;
317 }
318 
319 inline
321 {
322  return ((m_set_State[0] & 0xc) != 0);
323 }
324 
325 inline
327 {
328  return IsSetMin();
329 }
330 
331 inline
333 {
334  m_Min = 0;
335  m_set_State[0] &= ~0xc;
336 }
337 
338 inline
340 {
341  if (!CanGetMin()) {
342  ThrowUnassigned(1);
343  }
344  return m_Min;
345 }
346 
347 inline
349 {
350  m_Min = value;
351  m_set_State[0] |= 0xc;
352 }
353 
354 inline
356 {
357 #ifdef _DEBUG
358  if (!IsSetMin()) {
359  memset(&m_Min,UnassignedByte(),sizeof(m_Min));
360  }
361 #endif
362  m_set_State[0] |= 0x4;
363  return m_Min;
364 }
365 
366 inline
368 {
369  return ((m_set_State[0] & 0x30) != 0);
370 }
371 
372 inline
374 {
375  return IsSetAxis();
376 }
377 
378 inline
380 {
381  m_Axis = 0;
382  m_set_State[0] &= ~0x30;
383 }
384 
385 inline
387 {
388  if (!CanGetAxis()) {
389  ThrowUnassigned(2);
390  }
391  return m_Axis;
392 }
393 
394 inline
396 {
397  m_Axis = value;
398  m_set_State[0] |= 0x30;
399 }
400 
401 inline
403 {
404 #ifdef _DEBUG
405  if (!IsSetAxis()) {
406  memset(&m_Axis,UnassignedByte(),sizeof(m_Axis));
407  }
408 #endif
409  m_set_State[0] |= 0x10;
410  return m_Axis;
411 }
412 
413 inline
415 {
416  return ((m_set_State[0] & 0xc0) != 0);
417 }
418 
419 inline
421 {
422  return IsSetValues();
423 }
424 
425 inline
427 {
428  if (!CanGetValues()) {
429  ThrowUnassigned(3);
430  }
431  return m_Values;
432 }
433 
434 inline
436 {
437  m_set_State[0] |= 0x40;
438  return m_Values;
439 }
440 
441 ///////////////////////////////////////////////////////////
442 ////////////////// end of inline methods //////////////////
443 ///////////////////////////////////////////////////////////
444 
445 
446 
447 
448 
449 END_objects_SCOPE // namespace ncbi::objects::
450 
452 
453 
454 #endif // OBJECTS_SEQRES_BYTE_GRAPH_BASE_HPP
integer from 0-255
Definition: Byte_graph_.hpp:74
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_SEQRES_EXPORT
Definition: ncbi_export.h:785
CSerialObject Tparent
Definition: Byte_graph_.hpp:75
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.
CByte_graph_Base & operator=(const CByte_graph_Base &)
bool CanGetMin(void) const
Check if it is safe to call GetMin method.
bool CanGetValues(void) const
Check if it is safe to call GetValues method.
vector< char > TValues
Definition: Byte_graph_.hpp:89
bool CanGetAxis(void) const
Check if it is safe to call GetAxis method.
void ResetAxis(void)
Reset Axis data member.
TAxis GetAxis(void) const
Get the Axis member data.
bool IsSetValues(void) const
Check if a value has been assigned to Values data member.
TValues & SetValues(void)
Assign a value to Values data member.
TMax GetMax(void) const
Get the Max member data.
TMin GetMin(void) const
Get the Min member data.
TMin & SetMin(void)
Assign a value to Min data member.
const TValues & GetValues(void) const
Get the Values member data.
TMax & SetMax(void)
Assign a value to Max data member.
vector< char > m_Values
bool IsSetAxis(void) const
Check if a value has been assigned to Axis data member.
void ResetMin(void)
Reset Min data member.
CByte_graph_Base(const CByte_graph_Base &)
TAxis & SetAxis(void)
Assign a value to Axis data member.
Uint4 m_set_State[1]
void ResetMax(void)
Reset Max data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Byte_graph_.hpp:99
bool IsSetMax(void) const
Check if a value has been assigned to Max data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:40 2024 by modify_doxy.py rev. 669887