NCBI C++ ToolKit
CtermExtension_.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 CtermExtension_.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/varrep/varrep.asn">varrep.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/varrep/varrep.def">varrep.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_VARREP_CTERMEXTENSION_BASE_HPP
42 #define OBJECTS_VARREP_CTERMEXTENSION_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
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 // forward declarations
60 class CCount;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_VariationIRep
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CCtermExtension_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CCtermExtension_Base(void);
84 
85  // type info
87 
88  // types
89  typedef int TRefStop;
90  typedef string TNewAa;
91  typedef CCount TLength;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_refStop,
97  e_newAa,
98  e_length
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to RefStop data member.
106  ///
107  /// Data member RefStop is mandatory;
108  /// its type is defined as 'typedef int TRefStop'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetRefStop(void) const;
113 
114  /// Check if it is safe to call GetRefStop method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetRefStop(void) const;
120 
121  /// Reset RefStop data member.
122  void ResetRefStop(void);
123 
124  /// Get the RefStop member data.
125  ///
126  /// @return
127  /// Copy of the member data.
128  TRefStop GetRefStop(void) const;
129 
130  /// Assign a value to RefStop data member.
131  ///
132  /// @param value
133  /// Value to assign
134  void SetRefStop(TRefStop value);
135 
136  /// Assign a value to RefStop data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TRefStop& SetRefStop(void);
141 
142  /// Check if a value has been assigned to NewAa data member.
143  ///
144  /// Data member NewAa is mandatory;
145  /// its type is defined as 'typedef string TNewAa'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetNewAa(void) const;
150 
151  /// Check if it is safe to call GetNewAa method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetNewAa(void) const;
157 
158  /// Reset NewAa data member.
159  void ResetNewAa(void);
160 
161  /// Get the NewAa member data.
162  ///
163  /// @return
164  /// Reference to the member data.
165  const TNewAa& GetNewAa(void) const;
166 
167  /// Assign a value to NewAa data member.
168  ///
169  /// @param value
170  /// Value to assign
171  void SetNewAa(const TNewAa& value);
172  void SetNewAa(TNewAa&& value);
173 
174  /// Assign a value to NewAa data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TNewAa& SetNewAa(void);
179 
180  /// Check if a value has been assigned to Length data member.
181  ///
182  /// Data member Length is mandatory;
183  /// its type is defined as 'typedef CCount TLength'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetLength(void) const;
188 
189  /// Check if it is safe to call GetLength method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetLength(void) const;
195 
196  /// Reset Length data member.
197  void ResetLength(void);
198 
199  /// Get the Length member data.
200  ///
201  /// @return
202  /// Reference to the member data.
203  const TLength& GetLength(void) const;
204 
205  /// Assign a value to Length data member.
206  ///
207  /// @param value
208  /// Reference to value.
209  void SetLength(TLength& value);
210 
211  /// Assign a value to Length data member.
212  ///
213  /// @return
214  /// Reference to the data value.
215  TLength& SetLength(void);
216 
217  /// Reset the whole object
218  virtual void Reset(void);
219 
220 
221 private:
222  // Prohibit copy constructor and assignment operator
225 
226  // data
229  string m_NewAa;
231 };
232 
233 /* @} */
234 
235 
236 
237 
238 
239 ///////////////////////////////////////////////////////////
240 ///////////////////// inline methods //////////////////////
241 ///////////////////////////////////////////////////////////
242 inline
244 {
245  return ((m_set_State[0] & 0x3) != 0);
246 }
247 
248 inline
250 {
251  return IsSetRefStop();
252 }
253 
254 inline
256 {
257  m_RefStop = 0;
258  m_set_State[0] &= ~0x3;
259 }
260 
261 inline
263 {
264  if (!CanGetRefStop()) {
265  ThrowUnassigned(0);
266  }
267  return m_RefStop;
268 }
269 
270 inline
272 {
273  m_RefStop = value;
274  m_set_State[0] |= 0x3;
275 }
276 
277 inline
279 {
280 #ifdef _DEBUG
281  if (!IsSetRefStop()) {
282  memset(&m_RefStop,UnassignedByte(),sizeof(m_RefStop));
283  }
284 #endif
285  m_set_State[0] |= 0x1;
286  return m_RefStop;
287 }
288 
289 inline
291 {
292  return ((m_set_State[0] & 0xc) != 0);
293 }
294 
295 inline
297 {
298  return IsSetNewAa();
299 }
300 
301 inline
303 {
304  if (!CanGetNewAa()) {
305  ThrowUnassigned(1);
306  }
307  return m_NewAa;
308 }
309 
310 inline
312 {
313  m_NewAa = value;
314  m_set_State[0] |= 0xc;
315 }
316 
317 inline
319 {
320  m_NewAa = std::forward<CCtermExtension_Base::TNewAa>(value);
321  m_set_State[0] |= 0xc;
322 }
323 
324 inline
326 {
327 #ifdef _DEBUG
328  if (!IsSetNewAa()) {
330  }
331 #endif
332  m_set_State[0] |= 0x4;
333  return m_NewAa;
334 }
335 
336 inline
338 {
339  return m_Length.NotEmpty();
340 }
341 
342 inline
344 {
345  return true;
346 }
347 
348 inline
350 {
351  if ( !m_Length ) {
352  const_cast<CCtermExtension_Base*>(this)->ResetLength();
353  }
354  return (*m_Length);
355 }
356 
357 inline
359 {
360  if ( !m_Length ) {
361  ResetLength();
362  }
363  return (*m_Length);
364 }
365 
366 ///////////////////////////////////////////////////////////
367 ////////////////// end of inline methods //////////////////
368 ///////////////////////////////////////////////////////////
369 
370 
371 
372 
373 
374 END_objects_SCOPE // namespace ncbi::objects::
375 
377 
378 
379 #endif // OBJECTS_VARREP_CTERMEXTENSION_BASE_HPP
CCount –.
Definition: Count.hpp:66
CCtermExtension_Base –.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
CCtermExtension_Base & operator=(const CCtermExtension_Base &)
virtual void Reset(void)
Reset the whole object.
TRefStop GetRefStop(void) const
Get the RefStop member data.
void ResetLength(void)
Reset Length data member.
bool CanGetRefStop(void) const
Check if it is safe to call GetRefStop method.
bool CanGetLength(void) const
Check if it is safe to call GetLength method.
bool IsSetRefStop(void) const
Check if a value has been assigned to RefStop data member.
bool CanGetNewAa(void) const
Check if it is safe to call GetNewAa method.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool IsSetLength(void) const
Check if a value has been assigned to Length data member.
virtual ~CCtermExtension_Base(void)
CRef< TLength > m_Length
const TLength & GetLength(void) const
Get the Length member data.
TRefStop & SetRefStop(void)
Assign a value to RefStop data member.
TNewAa & SetNewAa(void)
Assign a value to NewAa data member.
void ResetRefStop(void)
Reset RefStop data member.
const TNewAa & GetNewAa(void) const
Get the NewAa member data.
void ResetNewAa(void)
Reset NewAa data member.
CCtermExtension_Base(const CCtermExtension_Base &)
TLength & SetLength(void)
Assign a value to Length data member.
bool IsSetNewAa(void) const
Check if a value has been assigned to NewAa data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed May 01 14:18:05 2024 by modify_doxy.py rev. 669887