NCBI C++ ToolKit
Feature_field_.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 Feature_field_.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/macro/macro.asn">macro.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/macro/macro.def">macro.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_MACRO_FEATURE_FIELD_BASE_HPP
42 #define OBJECTS_MACRO_FEATURE_FIELD_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
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 CFeat_qual_choice;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_Macro
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CFeature_field_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CFeature_field_Base(void);
82  // destructor
83  virtual ~CFeature_field_Base(void);
84 
85  // type info
87 
88  // types
91 
92  // member index
93  enum class E_memberIndex {
94  e__allMandatory = 0,
95  e_type,
96  e_field
97  };
99 
100  // getters
101  // setters
102 
103  /// Check if a value has been assigned to Type data member.
104  ///
105  /// Data member Type is mandatory;
106  /// its type is defined as 'typedef EMacro_feature_type TType'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetType(void) const;
111 
112  /// Check if it is safe to call GetType method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetType(void) const;
118 
119  /// Reset Type data member.
120  void ResetType(void);
121 
122  /// Get the Type member data.
123  ///
124  /// @return
125  /// Copy of the member data.
126  TType GetType(void) const;
127 
128  /// Assign a value to Type data member.
129  ///
130  /// @param value
131  /// Value to assign
132  void SetType(TType value);
133 
134  /// Assign a value to Type data member.
135  ///
136  /// @return
137  /// Reference to the data value.
138  TType& SetType(void);
139 
140  /// Check if a value has been assigned to Field data member.
141  ///
142  /// Data member Field is mandatory;
143  /// its type is defined as 'typedef CFeat_qual_choice TField'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetField(void) const;
148 
149  /// Check if it is safe to call GetField method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetField(void) const;
155 
156  /// Reset Field data member.
157  void ResetField(void);
158 
159  /// Get the Field member data.
160  ///
161  /// @return
162  /// Reference to the member data.
163  const TField& GetField(void) const;
164 
165  /// Assign a value to Field data member.
166  ///
167  /// @param value
168  /// Reference to value.
169  void SetField(TField& value);
170 
171  /// Assign a value to Field data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TField& SetField(void);
176 
177  /// Reset the whole object
178  virtual void Reset(void);
179 
180 
181 private:
182  // Prohibit copy constructor and assignment operator
185 
186  // data
190 };
191 
192 /* @} */
193 
194 
195 
196 
197 
198 ///////////////////////////////////////////////////////////
199 ///////////////////// inline methods //////////////////////
200 ///////////////////////////////////////////////////////////
201 inline
203 {
204  return ((m_set_State[0] & 0x3) != 0);
205 }
206 
207 inline
209 {
210  return IsSetType();
211 }
212 
213 inline
215 {
217  m_set_State[0] &= ~0x3;
218 }
219 
220 inline
222 {
223  if (!CanGetType()) {
224  ThrowUnassigned(0);
225  }
226  return m_Type;
227 }
228 
229 inline
231 {
232  m_Type = value;
233  m_set_State[0] |= 0x3;
234 }
235 
236 inline
238 {
239 #ifdef _DEBUG
240  if (!IsSetType()) {
241  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
242  }
243 #endif
244  m_set_State[0] |= 0x1;
245  return m_Type;
246 }
247 
248 inline
250 {
251  return m_Field.NotEmpty();
252 }
253 
254 inline
256 {
257  return true;
258 }
259 
260 inline
262 {
263  if ( !m_Field ) {
264  const_cast<CFeature_field_Base*>(this)->ResetField();
265  }
266  return (*m_Field);
267 }
268 
269 inline
271 {
272  if ( !m_Field ) {
273  ResetField();
274  }
275  return (*m_Field);
276 }
277 
278 ///////////////////////////////////////////////////////////
279 ////////////////// end of inline methods //////////////////
280 ///////////////////////////////////////////////////////////
281 
282 
283 
284 
285 
286 END_objects_SCOPE // namespace ncbi::objects::
287 
289 
290 
291 #endif // OBJECTS_MACRO_FEATURE_FIELD_BASE_HPP
User-defined methods of the data storage class.
CFeature_field_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
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
TField & SetField(void)
Assign a value to Field data member.
void ResetField(void)
Reset Field data member.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
virtual void Reset(void)
Reset the whole object.
CFeature_field_Base(const CFeature_field_Base &)
CFeature_field_Base & operator=(const CFeature_field_Base &)
CFeat_qual_choice TField
bool CanGetField(void) const
Check if it is safe to call GetField method.
void ResetType(void)
Reset Type data member.
TType & SetType(void)
Assign a value to Type data member.
EMacro_feature_type
feature values
CSerialObject Tparent
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool IsSetField(void) const
Check if a value has been assigned to Field data member.
EMacro_feature_type TType
EMacro_feature_type m_Type
CRef< TField > m_Field
virtual ~CFeature_field_Base(void)
TType GetType(void) const
Get the Type member data.
bool CanGetType(void) const
Check if it is safe to call GetType method.
const TField & GetField(void) const
Get the Field member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:09 2024 by modify_doxy.py rev. 669887