NCBI C++ ToolKit
PC_StereoGroup_.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_StereoGroup_.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_STEREOGROUP_BASE_HPP
42 #define OBJECTS_PCSUBSTANCE_PC_STEREOGROUP_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
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_PCSubstance
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// List of atom identifiers which are in a common stereochemistry group.
69 /// All atoms in this group possess the characteristic of the type specified.
70 /// The convention adopted is intended to be compatible with MDL's Enhanced
71 /// Stereochemical Representation white paper.
72 /// An atom can only be member of a single stereo group, and all atoms
73 /// in a stereo group must have a stereo descriptor.
74 /// Stereogroups only apply to stereocenters that can have parity.
75 ///
76 /// CPC_StereoGroup_Base --
77 ///
78 
80 {
82 public:
83  // constructor
85  // destructor
86  virtual ~CPC_StereoGroup_Base(void);
87 
88  // type info
90 
91  enum EType {
92  eType_absolute = 1, ///< Absolute configuration is known
93  eType_or = 2, ///< Relative configuration is known (absolute configuration is unknown)
94  eType_and = 3, ///< Mixture of stereoisomers
95  eType_unknown = 255 ///< Unknown configuration type
96  };
97 
98  /// Access to EType's attributes (values, names) as defined in spec
99  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EType)(void);
100 
101  // types
102  typedef int TType;
103  typedef list< int > TAid;
104 
105  // member index
106  enum class E_memberIndex {
107  e__allMandatory = 0,
108  e_type,
109  e_aid
110  };
112 
113  // getters
114  // setters
115 
116  /// Check if a value has been assigned to Type data member.
117  ///
118  /// Data member Type is mandatory;
119  /// its type is defined as 'typedef int TType'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetType(void) const;
124 
125  /// Check if it is safe to call GetType method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetType(void) const;
131 
132  /// Reset Type data member.
133  void ResetType(void);
134 
135  /// Get the Type member data.
136  ///
137  /// @return
138  /// Copy of the member data.
139  TType GetType(void) const;
140 
141  /// Assign a value to Type data member.
142  ///
143  /// @param value
144  /// Value to assign
145  void SetType(TType value);
146 
147  /// Assign a value to Type data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TType& SetType(void);
152 
153  /// Atom Identifiers of atoms in this group
154  /// Note: Atom ID's must be greater than "0"
155  /// Check if a value has been assigned to Aid data member.
156  ///
157  /// Data member Aid is mandatory;
158  /// its type is defined as 'typedef list< int > TAid'
159  /// @return
160  /// - true, if a value has been assigned.
161  /// - false, otherwise.
162  bool IsSetAid(void) const;
163 
164  /// Check if it is safe to call GetAid method.
165  ///
166  /// @return
167  /// - true, if the data member is getatable.
168  /// - false, otherwise.
169  bool CanGetAid(void) const;
170 
171  /// Reset Aid data member.
172  void ResetAid(void);
173 
174  /// Get the Aid member data.
175  ///
176  /// @return
177  /// Reference to the member data.
178  const TAid& GetAid(void) const;
179 
180  /// Assign a value to Aid data member.
181  ///
182  /// @return
183  /// Reference to the data value.
184  TAid& SetAid(void);
185 
186  /// Reset the whole object
187  virtual void Reset(void);
188 
189 
190 private:
191  // Prohibit copy constructor and assignment operator
194 
195  // data
196  Uint4 m_set_State[1];
197  int m_Type;
198  list< int > m_Aid;
199 };
200 
201 /* @} */
202 
203 
204 
205 
206 
207 ///////////////////////////////////////////////////////////
208 ///////////////////// inline methods //////////////////////
209 ///////////////////////////////////////////////////////////
210 inline
212 {
213  return ((m_set_State[0] & 0x3) != 0);
214 }
215 
216 inline
218 {
219  return IsSetType();
220 }
221 
222 inline
224 {
225  m_Type = (EType)(0);
226  m_set_State[0] &= ~0x3;
227 }
228 
229 inline
231 {
232  if (!CanGetType()) {
233  ThrowUnassigned(0);
234  }
235  return m_Type;
236 }
237 
238 inline
240 {
241  m_Type = value;
242  m_set_State[0] |= 0x3;
243 }
244 
245 inline
247 {
248 #ifdef _DEBUG
249  if (!IsSetType()) {
250  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
251  }
252 #endif
253  m_set_State[0] |= 0x1;
254  return m_Type;
255 }
256 
257 inline
259 {
260  return ((m_set_State[0] & 0xc) != 0);
261 }
262 
263 inline
265 {
266  return true;
267 }
268 
269 inline
271 {
272  return m_Aid;
273 }
274 
275 inline
277 {
278  m_set_State[0] |= 0x4;
279  return m_Aid;
280 }
281 
282 ///////////////////////////////////////////////////////////
283 ////////////////// end of inline methods //////////////////
284 ///////////////////////////////////////////////////////////
285 
286 
287 
288 
289 
290 END_objects_SCOPE // namespace ncbi::objects::
291 
293 
294 
295 #endif // OBJECTS_PCSUBSTANCE_PC_STEREOGROUP_BASE_HPP
List of atom identifiers which are in a common stereochemistry group.
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
CPC_StereoGroup_Base & operator=(const CPC_StereoGroup_Base &)
bool CanGetAid(void) const
Check if it is safe to call GetAid method.
TAid & SetAid(void)
Assign a value to Aid data member.
TType GetType(void) const
Get the Type member data.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
void ResetType(void)
Reset Type data member.
TType & SetType(void)
Assign a value to Type data member.
const TAid & GetAid(void) const
Get the Aid member data.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool IsSetAid(void) const
Atom Identifiers of atoms in this group Note: Atom ID's must be greater than "0" Check if a value has...
bool CanGetType(void) const
Check if it is safe to call GetType method.
CPC_StereoGroup_Base(const CPC_StereoGroup_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Tue Apr 23 07:39:08 2024 by modify_doxy.py rev. 669887