NCBI C++ ToolKit
Source_qual_text_val_.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 Source_qual_text_val_.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_SOURCE_QUAL_TEXT_VAL_BASE_HPP
42 #define OBJECTS_MACRO_SOURCE_QUAL_TEXT_VAL_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_Macro
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 ///
70 /// CSource_qual_text_val_Base --
71 ///
72 
74 {
76 public:
77  // constructor
79  // destructor
80  virtual ~CSource_qual_text_val_Base(void);
81 
82  // type info
84 
85  // types
87  typedef string TVal;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_srcqual,
93  e_val
94  };
96 
97  // getters
98  // setters
99 
100  /// Check if a value has been assigned to Srcqual data member.
101  ///
102  /// Data member Srcqual is mandatory;
103  /// its type is defined as 'typedef ESource_qual TSrcqual'
104  /// @return
105  /// - true, if a value has been assigned.
106  /// - false, otherwise.
107  bool IsSetSrcqual(void) const;
108 
109  /// Check if it is safe to call GetSrcqual method.
110  ///
111  /// @return
112  /// - true, if the data member is getatable.
113  /// - false, otherwise.
114  bool CanGetSrcqual(void) const;
115 
116  /// Reset Srcqual data member.
117  void ResetSrcqual(void);
118 
119  /// Get the Srcqual member data.
120  ///
121  /// @return
122  /// Copy of the member data.
123  TSrcqual GetSrcqual(void) const;
124 
125  /// Assign a value to Srcqual data member.
126  ///
127  /// @param value
128  /// Value to assign
129  void SetSrcqual(TSrcqual value);
130 
131  /// Assign a value to Srcqual data member.
132  ///
133  /// @return
134  /// Reference to the data value.
135  TSrcqual& SetSrcqual(void);
136 
137  /// Check if a value has been assigned to Val data member.
138  ///
139  /// Data member Val is mandatory;
140  /// its type is defined as 'typedef string TVal'
141  /// @return
142  /// - true, if a value has been assigned.
143  /// - false, otherwise.
144  bool IsSetVal(void) const;
145 
146  /// Check if it is safe to call GetVal method.
147  ///
148  /// @return
149  /// - true, if the data member is getatable.
150  /// - false, otherwise.
151  bool CanGetVal(void) const;
152 
153  /// Reset Val data member.
154  void ResetVal(void);
155 
156  /// Get the Val member data.
157  ///
158  /// @return
159  /// Reference to the member data.
160  const TVal& GetVal(void) const;
161 
162  /// Assign a value to Val data member.
163  ///
164  /// @param value
165  /// Value to assign
166  void SetVal(const TVal& value);
167  void SetVal(TVal&& value);
168 
169  /// Assign a value to Val data member.
170  ///
171  /// @return
172  /// Reference to the data value.
173  TVal& SetVal(void);
174 
175  /// Reset the whole object
176  virtual void Reset(void);
177 
178 
179 private:
180  // Prohibit copy constructor and assignment operator
183 
184  // data
187  string m_Val;
188 };
189 
190 /* @} */
191 
192 
193 
194 
195 
196 ///////////////////////////////////////////////////////////
197 ///////////////////// inline methods //////////////////////
198 ///////////////////////////////////////////////////////////
199 inline
201 {
202  return ((m_set_State[0] & 0x3) != 0);
203 }
204 
205 inline
207 {
208  return IsSetSrcqual();
209 }
210 
211 inline
213 {
215  m_set_State[0] &= ~0x3;
216 }
217 
218 inline
220 {
221  if (!CanGetSrcqual()) {
222  ThrowUnassigned(0);
223  }
224  return m_Srcqual;
225 }
226 
227 inline
229 {
230  m_Srcqual = value;
231  m_set_State[0] |= 0x3;
232 }
233 
234 inline
236 {
237 #ifdef _DEBUG
238  if (!IsSetSrcqual()) {
239  memset(&m_Srcqual,UnassignedByte(),sizeof(m_Srcqual));
240  }
241 #endif
242  m_set_State[0] |= 0x1;
243  return m_Srcqual;
244 }
245 
246 inline
248 {
249  return ((m_set_State[0] & 0xc) != 0);
250 }
251 
252 inline
254 {
255  return IsSetVal();
256 }
257 
258 inline
260 {
261  if (!CanGetVal()) {
262  ThrowUnassigned(1);
263  }
264  return m_Val;
265 }
266 
267 inline
269 {
270  m_Val = value;
271  m_set_State[0] |= 0xc;
272 }
273 
274 inline
276 {
277  m_Val = std::forward<CSource_qual_text_val_Base::TVal>(value);
278  m_set_State[0] |= 0xc;
279 }
280 
281 inline
283 {
284 #ifdef _DEBUG
285  if (!IsSetVal()) {
287  }
288 #endif
289  m_set_State[0] |= 0x4;
290  return m_Val;
291 }
292 
293 ///////////////////////////////////////////////////////////
294 ////////////////// end of inline methods //////////////////
295 ///////////////////////////////////////////////////////////
296 
297 
298 
299 
300 
301 END_objects_SCOPE // namespace ncbi::objects::
302 
304 
305 
306 #endif // OBJECTS_MACRO_SOURCE_QUAL_TEXT_VAL_BASE_HPP
User-defined methods of the data storage class.
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSource_qual_text_val_Base –.
char value[7]
Definition: config.c:431
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
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
void ResetVal(void)
Reset Val data member.
ESource_qual
Access to ESource_qual's attributes (values, names) as defined in spec.
const TVal & GetVal(void) const
Get the Val member data.
bool IsSetSrcqual(void) const
Check if a value has been assigned to Srcqual data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TSrcqual & SetSrcqual(void)
Assign a value to Srcqual data member.
bool CanGetVal(void) const
Check if it is safe to call GetVal method.
CSource_qual_text_val_Base(const CSource_qual_text_val_Base &)
TSrcqual GetSrcqual(void) const
Get the Srcqual member data.
bool IsSetVal(void) const
Check if a value has been assigned to Val data member.
void ResetSrcqual(void)
Reset Srcqual data member.
bool CanGetSrcqual(void) const
Check if it is safe to call GetSrcqual method.
CSource_qual_text_val_Base & operator=(const CSource_qual_text_val_Base &)
TVal & SetVal(void)
Assign a value to Val data member.
virtual void Reset(void)
Reset the whole object.
Modified on Fri Mar 01 10:06:47 2024 by modify_doxy.py rev. 669887