NCBI C++ ToolKit
PC_AtomRadical_.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_AtomRadical_.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_ATOMRADICAL_BASE_HPP
42 #define OBJECTS_PCSUBSTANCE_PC_ATOMRADICAL_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 /// Rudimentary Atom Electronic Configuration Designation
65 ///
66 /// CPC_AtomRadical_Base --
67 ///
68 
70 {
72 public:
73  // constructor
75  // destructor
76  virtual ~CPC_AtomRadical_Base(void);
77 
78  // type info
80 
81  /// Type of Atom Radical
82  enum EType {
83  eType_singlet = 1, ///< Open-Shell Singlet
84  eType_doublet = 2, ///< Open-Shell Doublet
85  eType_triplet = 3, ///< Open-Shell Triplet
86  eType_quartet = 4, ///< Open-Shell Quartet
87  eType_quintet = 5, ///< Open-Shell Quintet
88  eType_hextet = 6, ///< Open-Shell Hextet
89  eType_heptet = 7, ///< Open-Shell Quintet
90  eType_octet = 8, ///< Open-Shell Octet
91  eType_none = 255 ///< Closed-Shell Singlet
92  };
93 
94  /// Access to EType's attributes (values, names) as defined in spec
95  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EType)(void);
96 
97  // types
98  typedef int TAid;
99  typedef int TType;
100 
101  // member index
102  enum class E_memberIndex {
103  e__allMandatory = 0,
104  e_aid,
105  e_type
106  };
108 
109  // getters
110  // setters
111 
112  /// Atom Identifier for the Value
113  /// Note: Atom ID's must be greater than "0"
114  /// Check if a value has been assigned to Aid data member.
115  ///
116  /// Data member Aid is mandatory;
117  /// its type is defined as 'typedef int TAid'
118  /// @return
119  /// - true, if a value has been assigned.
120  /// - false, otherwise.
121  bool IsSetAid(void) const;
122 
123  /// Check if it is safe to call GetAid method.
124  ///
125  /// @return
126  /// - true, if the data member is getatable.
127  /// - false, otherwise.
128  bool CanGetAid(void) const;
129 
130  /// Reset Aid data member.
131  void ResetAid(void);
132 
133  /// Get the Aid member data.
134  ///
135  /// @return
136  /// Copy of the member data.
137  TAid GetAid(void) const;
138 
139  /// Assign a value to Aid data member.
140  ///
141  /// @param value
142  /// Value to assign
143  void SetAid(TAid value);
144 
145  /// Assign a value to Aid data member.
146  ///
147  /// @return
148  /// Reference to the data value.
149  TAid& SetAid(void);
150 
151  /// Check if a value has been assigned to Type data member.
152  ///
153  /// Data member Type is mandatory;
154  /// its type is defined as 'typedef int TType'
155  /// @return
156  /// - true, if a value has been assigned.
157  /// - false, otherwise.
158  bool IsSetType(void) const;
159 
160  /// Check if it is safe to call GetType method.
161  ///
162  /// @return
163  /// - true, if the data member is getatable.
164  /// - false, otherwise.
165  bool CanGetType(void) const;
166 
167  /// Reset Type data member.
168  void ResetType(void);
169 
170  /// Get the Type member data.
171  ///
172  /// @return
173  /// Copy of the member data.
174  TType GetType(void) const;
175 
176  /// Assign a value to Type data member.
177  ///
178  /// @param value
179  /// Value to assign
180  void SetType(TType value);
181 
182  /// Assign a value to Type data member.
183  ///
184  /// @return
185  /// Reference to the data value.
186  TType& SetType(void);
187 
188  /// Reset the whole object
189  virtual void Reset(void);
190 
191 
192 private:
193  // Prohibit copy constructor and assignment operator
196 
197  // data
198  Uint4 m_set_State[1];
199  int m_Aid;
200  int m_Type;
201 };
202 
203 /* @} */
204 
205 
206 
207 
208 
209 ///////////////////////////////////////////////////////////
210 ///////////////////// inline methods //////////////////////
211 ///////////////////////////////////////////////////////////
212 inline
214 {
215  return ((m_set_State[0] & 0x3) != 0);
216 }
217 
218 inline
220 {
221  return IsSetAid();
222 }
223 
224 inline
226 {
227  m_Aid = 0;
228  m_set_State[0] &= ~0x3;
229 }
230 
231 inline
233 {
234  if (!CanGetAid()) {
235  ThrowUnassigned(0);
236  }
237  return m_Aid;
238 }
239 
240 inline
242 {
243  m_Aid = value;
244  m_set_State[0] |= 0x3;
245 }
246 
247 inline
249 {
250 #ifdef _DEBUG
251  if (!IsSetAid()) {
252  memset(&m_Aid,UnassignedByte(),sizeof(m_Aid));
253  }
254 #endif
255  m_set_State[0] |= 0x1;
256  return m_Aid;
257 }
258 
259 inline
261 {
262  return ((m_set_State[0] & 0xc) != 0);
263 }
264 
265 inline
267 {
268  return IsSetType();
269 }
270 
271 inline
273 {
274  m_Type = (EType)(0);
275  m_set_State[0] &= ~0xc;
276 }
277 
278 inline
280 {
281  if (!CanGetType()) {
282  ThrowUnassigned(1);
283  }
284  return m_Type;
285 }
286 
287 inline
289 {
290  m_Type = value;
291  m_set_State[0] |= 0xc;
292 }
293 
294 inline
296 {
297 #ifdef _DEBUG
298  if (!IsSetType()) {
299  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
300  }
301 #endif
302  m_set_State[0] |= 0x4;
303  return m_Type;
304 }
305 
306 ///////////////////////////////////////////////////////////
307 ////////////////// end of inline methods //////////////////
308 ///////////////////////////////////////////////////////////
309 
310 
311 
312 
313 
314 END_objects_SCOPE // namespace ncbi::objects::
315 
317 
318 
319 #endif // OBJECTS_PCSUBSTANCE_PC_ATOMRADICAL_BASE_HPP
Rudimentary Atom Electronic Configuration Designation.
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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 ResetAid(void)
Reset Aid data member.
bool IsSetAid(void) const
Atom Identifier for the Value Note: Atom ID's must be greater than "0" Check if a value has been assi...
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool CanGetType(void) const
Check if it is safe to call GetType method.
CPC_AtomRadical_Base(const CPC_AtomRadical_Base &)
TAid & SetAid(void)
Assign a value to Aid data member.
bool CanGetAid(void) const
Check if it is safe to call GetAid method.
TType GetType(void) const
Get the Type member data.
EType
Type of Atom Radical.
CPC_AtomRadical_Base & operator=(const CPC_AtomRadical_Base &)
void ResetType(void)
Reset Type data member.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
TType & SetType(void)
Assign a value to Type data member.
TAid GetAid(void) const
Get the Aid member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
@ eType_none
Modified on Sat Apr 20 12:16:59 2024 by modify_doxy.py rev. 669887