NCBI C++ ToolKit
TMgr_SwitchTrackException_.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 TMgr_SwitchTrackException_.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/trackmgr/trackmgr.asn">trackmgr.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/trackmgr/trackmgr.def">trackmgr.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_TRACKMGR_TMGR_SWITCHTRACKEXCEPTION_BASE_HPP
42 #define OBJECTS_TRACKMGR_TMGR_SWITCHTRACKEXCEPTION_BASE_HPP
43 
44 // extra headers
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
52 
54 
55 #ifndef BEGIN_objects_SCOPE
56 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
57 # define END_objects_SCOPE END_SCOPE(objects)
58 #endif
59 BEGIN_objects_SCOPE // namespace ncbi::objects::
60 
61 
62 // forward declarations
63 class CTMgr_DTrackId;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_TrackManager
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///
76 /// CTMgr_SwitchTrackException_Base --
77 ///
78 
80 {
82 public:
83  // constructor
85  // destructor
86  virtual ~CTMgr_SwitchTrackException_Base(void);
87 
88  // type info
90 
91  // types
93  typedef int TCode;
94 
95  // member index
96  enum class E_memberIndex {
97  e__allMandatory = 0,
98  e_dtrack_id,
99  e_code
100  };
102 
103  // getters
104  // setters
105 
106  /// Check if a value has been assigned to Dtrack_id data member.
107  ///
108  /// Data member Dtrack_id is mandatory;
109  /// its type is defined as 'typedef CTMgr_DTrackId TDtrack_id'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetDtrack_id(void) const;
114 
115  /// Check if it is safe to call GetDtrack_id method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetDtrack_id(void) const;
121 
122  /// Reset Dtrack_id data member.
123  void ResetDtrack_id(void);
124 
125  /// Get the Dtrack_id member data.
126  ///
127  /// @return
128  /// Reference to the member data.
129  const TDtrack_id& GetDtrack_id(void) const;
130 
131  /// Assign a value to Dtrack_id data member.
132  ///
133  /// @param value
134  /// Reference to value.
135  void SetDtrack_id(TDtrack_id& value);
136 
137  /// Assign a value to Dtrack_id data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TDtrack_id& SetDtrack_id(void);
142 
143  /// Check if a value has been assigned to Code data member.
144  ///
145  /// Data member Code is optional;
146  /// its type is defined as 'typedef int TCode'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetCode(void) const;
151 
152  /// Check if it is safe to call GetCode method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetCode(void) const;
158 
159  /// Reset Code data member.
160  void ResetCode(void);
161 
162  /// Get the Code member data.
163  ///
164  /// @return
165  /// Copy of the member data.
166  TCode GetCode(void) const;
167 
168  /// Assign a value to Code data member.
169  ///
170  /// @param value
171  /// Value to assign
172  void SetCode(TCode value);
173 
174  /// Assign a value to Code data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TCode& SetCode(void);
179 
180  /// Reset the whole object
181  virtual void Reset(void);
182 
183 
184 private:
185  // Prohibit copy constructor and assignment operator
188 
189  // data
190  Uint4 m_set_State[1];
192  int m_Code;
193 };
194 
195 /* @} */
196 
197 
198 
199 
200 
201 ///////////////////////////////////////////////////////////
202 ///////////////////// inline methods //////////////////////
203 ///////////////////////////////////////////////////////////
204 inline
206 {
207  return m_Dtrack_id.NotEmpty();
208 }
209 
210 inline
212 {
213  return true;
214 }
215 
216 inline
218 {
219  if ( !m_Dtrack_id ) {
220  const_cast<CTMgr_SwitchTrackException_Base*>(this)->ResetDtrack_id();
221  }
222  return (*m_Dtrack_id);
223 }
224 
225 inline
227 {
228  if ( !m_Dtrack_id ) {
229  ResetDtrack_id();
230  }
231  return (*m_Dtrack_id);
232 }
233 
234 inline
236 {
237  return ((m_set_State[0] & 0xc) != 0);
238 }
239 
240 inline
242 {
243  return IsSetCode();
244 }
245 
246 inline
248 {
249  m_Code = (int)(0);
250  m_set_State[0] &= ~0xc;
251 }
252 
253 inline
255 {
256  if (!CanGetCode()) {
257  ThrowUnassigned(1);
258  }
259  return m_Code;
260 }
261 
262 inline
264 {
265  m_Code = value;
266  m_set_State[0] |= 0xc;
267 }
268 
269 inline
271 {
272 #ifdef _DEBUG
273  if (!IsSetCode()) {
274  memset(&m_Code,UnassignedByte(),sizeof(m_Code));
275  }
276 #endif
277  m_set_State[0] |= 0x4;
278  return m_Code;
279 }
280 
281 ///////////////////////////////////////////////////////////
282 ////////////////// end of inline methods //////////////////
283 ///////////////////////////////////////////////////////////
284 
285 
286 
287 
288 
289 END_objects_SCOPE // namespace ncbi::objects::
290 
292 
293 
294 #endif // OBJECTS_TRACKMGR_TMGR_SWITCHTRACKEXCEPTION_BASE_HPP
User-defined methods of the data storage class.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTMgr_SwitchTrackException_Base –.
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
bool IsSetDtrack_id(void) const
Check if a value has been assigned to Dtrack_id data member.
void ResetCode(void)
Reset Code data member.
bool CanGetDtrack_id(void) const
Check if it is safe to call GetDtrack_id method.
void ResetDtrack_id(void)
Reset Dtrack_id data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TDtrack_id & SetDtrack_id(void)
Assign a value to Dtrack_id data member.
CTMgr_SwitchTrackException_Base & operator=(const CTMgr_SwitchTrackException_Base &)
CTMgr_SwitchTrackException_Base(const CTMgr_SwitchTrackException_Base &)
const TDtrack_id & GetDtrack_id(void) const
Get the Dtrack_id member data.
TCode GetCode(void) const
Get the Code member data.
bool IsSetCode(void) const
Check if a value has been assigned to Code data member.
TCode & SetCode(void)
Assign a value to Code data member.
bool CanGetCode(void) const
Check if it is safe to call GetCode method.
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
Defines to provide correct exporting from DLLs in Windows.
#define NCBI_TRACKMGR_EXPORT
Modified on Thu Nov 30 04:55:02 2023 by modify_doxy.py rev. 669887