NCBI C++ ToolKit
ID2S_Feat_type_Info_.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 ID2S_Feat_type_Info_.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/seqsplit/seqsplit.asn">seqsplit.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqsplit/seqsplit.def">seqsplit.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_SEQSPLIT_ID2S_FEAT_TYPE_INFO_BASE_HPP
42 #define OBJECTS_SEQSPLIT_ID2S_FEAT_TYPE_INFO_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_Seq_split
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CID2S_Feat_type_Info_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CID2S_Feat_type_Info_Base(void);
80 
81  // type info
83 
84  // types
85  typedef int TType;
86  typedef list< int > TSubtypes;
87 
88  // member index
89  enum class E_memberIndex {
90  e__allMandatory = 0,
91  e_type,
92  e_subtypes
93  };
95 
96  // getters
97  // setters
98 
99  /// Check if a value has been assigned to Type data member.
100  ///
101  /// Data member Type is mandatory;
102  /// its type is defined as 'typedef int TType'
103  /// @return
104  /// - true, if a value has been assigned.
105  /// - false, otherwise.
106  bool IsSetType(void) const;
107 
108  /// Check if it is safe to call GetType method.
109  ///
110  /// @return
111  /// - true, if the data member is getatable.
112  /// - false, otherwise.
113  bool CanGetType(void) const;
114 
115  /// Reset Type data member.
116  void ResetType(void);
117 
118  /// Get the Type member data.
119  ///
120  /// @return
121  /// Copy of the member data.
122  TType GetType(void) const;
123 
124  /// Assign a value to Type data member.
125  ///
126  /// @param value
127  /// Value to assign
128  void SetType(TType value);
129 
130  /// Assign a value to Type data member.
131  ///
132  /// @return
133  /// Reference to the data value.
134  TType& SetType(void);
135 
136  /// Check if a value has been assigned to Subtypes data member.
137  ///
138  /// Data member Subtypes is optional;
139  /// its type is defined as 'typedef list< int > TSubtypes'
140  /// @return
141  /// - true, if a value has been assigned.
142  /// - false, otherwise.
143  bool IsSetSubtypes(void) const;
144 
145  /// Check if it is safe to call GetSubtypes method.
146  ///
147  /// @return
148  /// - true, if the data member is getatable.
149  /// - false, otherwise.
150  bool CanGetSubtypes(void) const;
151 
152  /// Reset Subtypes data member.
153  void ResetSubtypes(void);
154 
155  /// Get the Subtypes member data.
156  ///
157  /// @return
158  /// Reference to the member data.
159  const TSubtypes& GetSubtypes(void) const;
160 
161  /// Assign a value to Subtypes data member.
162  ///
163  /// @return
164  /// Reference to the data value.
165  TSubtypes& SetSubtypes(void);
166 
167  /// Reset the whole object
168  virtual void Reset(void);
169 
170 
171 private:
172  // Prohibit copy constructor and assignment operator
175 
176  // data
177  Uint4 m_set_State[1];
178  int m_Type;
179  list< int > m_Subtypes;
180 };
181 
182 /* @} */
183 
184 
185 
186 
187 
188 ///////////////////////////////////////////////////////////
189 ///////////////////// inline methods //////////////////////
190 ///////////////////////////////////////////////////////////
191 inline
193 {
194  return ((m_set_State[0] & 0x3) != 0);
195 }
196 
197 inline
199 {
200  return IsSetType();
201 }
202 
203 inline
205 {
206  m_Type = 0;
207  m_set_State[0] &= ~0x3;
208 }
209 
210 inline
212 {
213  if (!CanGetType()) {
214  ThrowUnassigned(0);
215  }
216  return m_Type;
217 }
218 
219 inline
221 {
222  m_Type = value;
223  m_set_State[0] |= 0x3;
224 }
225 
226 inline
228 {
229 #ifdef _DEBUG
230  if (!IsSetType()) {
231  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
232  }
233 #endif
234  m_set_State[0] |= 0x1;
235  return m_Type;
236 }
237 
238 inline
240 {
241  return ((m_set_State[0] & 0xc) != 0);
242 }
243 
244 inline
246 {
247  return true;
248 }
249 
250 inline
252 {
253  return m_Subtypes;
254 }
255 
256 inline
258 {
259  m_set_State[0] |= 0x4;
260  return m_Subtypes;
261 }
262 
263 ///////////////////////////////////////////////////////////
264 ////////////////// end of inline methods //////////////////
265 ///////////////////////////////////////////////////////////
266 
267 
268 
269 
270 
271 END_objects_SCOPE // namespace ncbi::objects::
272 
274 
275 
276 #endif // OBJECTS_SEQSPLIT_ID2S_FEAT_TYPE_INFO_BASE_HPP
CID2S_Feat_type_Info_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
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_ID2_EXPORT
Definition: ncbi_export.h:552
const TSubtypes & GetSubtypes(void) const
Get the Subtypes member data.
bool IsSetSubtypes(void) const
Check if a value has been assigned to Subtypes data member.
TSubtypes & SetSubtypes(void)
Assign a value to Subtypes 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.
CID2S_Feat_type_Info_Base(const CID2S_Feat_type_Info_Base &)
void ResetType(void)
Reset Type data member.
CID2S_Feat_type_Info_Base & operator=(const CID2S_Feat_type_Info_Base &)
bool CanGetSubtypes(void) const
Check if it is safe to call GetSubtypes method.
bool CanGetType(void) const
Check if it is safe to call GetType method.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TType GetType(void) const
Get the Type member data.
Modified on Thu Dec 07 10:08:53 2023 by modify_doxy.py rev. 669887