NCBI C++ ToolKit
AaSite_.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 AaSite_.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_AASITE_BASE_HPP
42 #define OBJECTS_VARREP_AASITE_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 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_VariationIRep
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CAaSite_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CAaSite_Base(void);
78  // destructor
79  virtual ~CAaSite_Base(void);
80 
81  // type info
83 
84  // types
85  typedef TSeqPos TIndex;
86  typedef string TAa;
87 
88  // member index
89  enum class E_memberIndex {
90  e__allMandatory = 0,
91  e_index,
92  e_aa
93  };
95 
96  // getters
97  // setters
98 
99  /// Check if a value has been assigned to Index data member.
100  ///
101  /// Data member Index is mandatory;
102  /// its type is defined as 'typedef TSeqPos TIndex'
103  /// @return
104  /// - true, if a value has been assigned.
105  /// - false, otherwise.
106  bool IsSetIndex(void) const;
107 
108  /// Check if it is safe to call GetIndex method.
109  ///
110  /// @return
111  /// - true, if the data member is getatable.
112  /// - false, otherwise.
113  bool CanGetIndex(void) const;
114 
115  /// Reset Index data member.
116  void ResetIndex(void);
117 
118  /// Get the Index member data.
119  ///
120  /// @return
121  /// Copy of the member data.
122  TIndex GetIndex(void) const;
123 
124  /// Assign a value to Index data member.
125  ///
126  /// @param value
127  /// Value to assign
128  void SetIndex(TIndex value);
129 
130  /// Assign a value to Index data member.
131  ///
132  /// @return
133  /// Reference to the data value.
134  TIndex& SetIndex(void);
135 
136  /// Check if a value has been assigned to Aa data member.
137  ///
138  /// Data member Aa is mandatory;
139  /// its type is defined as 'typedef string TAa'
140  /// @return
141  /// - true, if a value has been assigned.
142  /// - false, otherwise.
143  bool IsSetAa(void) const;
144 
145  /// Check if it is safe to call GetAa method.
146  ///
147  /// @return
148  /// - true, if the data member is getatable.
149  /// - false, otherwise.
150  bool CanGetAa(void) const;
151 
152  /// Reset Aa data member.
153  void ResetAa(void);
154 
155  /// Get the Aa member data.
156  ///
157  /// @return
158  /// Reference to the member data.
159  const TAa& GetAa(void) const;
160 
161  /// Assign a value to Aa data member.
162  ///
163  /// @param value
164  /// Value to assign
165  void SetAa(const TAa& value);
166  void SetAa(TAa&& value);
167 
168  /// Assign a value to Aa data member.
169  ///
170  /// @return
171  /// Reference to the data value.
172  TAa& SetAa(void);
173 
174  /// Reset the whole object
175  virtual void Reset(void);
176 
177 
178 private:
179  // Prohibit copy constructor and assignment operator
182 
183  // data
186  string m_Aa;
187 };
188 
189 /* @} */
190 
191 
192 
193 
194 
195 ///////////////////////////////////////////////////////////
196 ///////////////////// inline methods //////////////////////
197 ///////////////////////////////////////////////////////////
198 inline
199 bool CAaSite_Base::IsSetIndex(void) const
200 {
201  return ((m_set_State[0] & 0x3) != 0);
202 }
203 
204 inline
206 {
207  return IsSetIndex();
208 }
209 
210 inline
212 {
213  m_Index = 0;
214  m_set_State[0] &= ~0x3;
215 }
216 
217 inline
219 {
220  if (!CanGetIndex()) {
221  ThrowUnassigned(0);
222  }
223  return m_Index;
224 }
225 
226 inline
228 {
229  m_Index = value;
230  m_set_State[0] |= 0x3;
231 }
232 
233 inline
235 {
236 #ifdef _DEBUG
237  if (!IsSetIndex()) {
238  memset(&m_Index,UnassignedByte(),sizeof(m_Index));
239  }
240 #endif
241  m_set_State[0] |= 0x1;
242  return m_Index;
243 }
244 
245 inline
246 bool CAaSite_Base::IsSetAa(void) const
247 {
248  return ((m_set_State[0] & 0xc) != 0);
249 }
250 
251 inline
252 bool CAaSite_Base::CanGetAa(void) const
253 {
254  return IsSetAa();
255 }
256 
257 inline
259 {
260  if (!CanGetAa()) {
261  ThrowUnassigned(1);
262  }
263  return m_Aa;
264 }
265 
266 inline
268 {
269  m_Aa = value;
270  m_set_State[0] |= 0xc;
271 }
272 
273 inline
275 {
276  m_Aa = std::forward<CAaSite_Base::TAa>(value);
277  m_set_State[0] |= 0xc;
278 }
279 
280 inline
282 {
283 #ifdef _DEBUG
284  if (!IsSetAa()) {
286  }
287 #endif
288  m_set_State[0] |= 0x4;
289  return m_Aa;
290 }
291 
292 ///////////////////////////////////////////////////////////
293 ////////////////// end of inline methods //////////////////
294 ///////////////////////////////////////////////////////////
295 
296 
297 
298 
299 
300 END_objects_SCOPE // namespace ncbi::objects::
301 
303 
304 
305 #endif // OBJECTS_VARREP_AASITE_BASE_HPP
CAaSite_Base –.
Definition: AaSite_.hpp:73
Base class for all serializable objects.
Definition: serialbase.hpp:150
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
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
CAaSite_Base(const CAaSite_Base &)
CAaSite_Base & operator=(const CAaSite_Base &)
Uint4 m_set_State[1]
Definition: AaSite_.hpp:184
virtual ~CAaSite_Base(void)
Definition: AaSite_.cpp:81
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: AaSite_.hpp:94
DECLARE_INTERNAL_TYPE_INFO()
TSeqPos m_Index
Definition: AaSite_.hpp:185
bool CanGetAa(void) const
Check if it is safe to call GetAa method.
Definition: AaSite_.hpp:252
bool IsSetIndex(void) const
Check if a value has been assigned to Index data member.
Definition: AaSite_.hpp:199
TIndex GetIndex(void) const
Get the Index member data.
Definition: AaSite_.hpp:218
const TAa & GetAa(void) const
Get the Aa member data.
Definition: AaSite_.hpp:258
string TAa
Definition: AaSite_.hpp:86
void ResetIndex(void)
Reset Index data member.
Definition: AaSite_.hpp:211
bool IsSetAa(void) const
Check if a value has been assigned to Aa data member.
Definition: AaSite_.hpp:246
TSeqPos TIndex
Definition: AaSite_.hpp:85
CAaSite_Base(void)
Definition: AaSite_.cpp:74
string m_Aa
Definition: AaSite_.hpp:186
TIndex & SetIndex(void)
Assign a value to Index data member.
Definition: AaSite_.hpp:234
void ResetAa(void)
Reset Aa data member.
Definition: AaSite_.cpp:50
CSerialObject Tparent
Definition: AaSite_.hpp:74
TAa & SetAa(void)
Assign a value to Aa data member.
Definition: AaSite_.hpp:281
virtual void Reset(void)
Reset the whole object.
Definition: AaSite_.cpp:56
bool CanGetIndex(void) const
Check if it is safe to call GetIndex method.
Definition: AaSite_.hpp:205
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed May 22 11:28:17 2024 by modify_doxy.py rev. 669887