NCBI C++ ToolKit
GC_Project_.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 GC_Project_.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/genomecoll/genome_collection.asn">genome_collection.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/genomecoll/genome_collection.def">genome_collection.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_GENOMECOLL_GC_PROJECT_BASE_HPP
42 #define OBJECTS_GENOMECOLL_GC_PROJECT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
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_GenomeCollection
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CGC_Project_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CGC_Project_Base(void);
78  // destructor
79  virtual ~CGC_Project_Base(void);
80 
81  // type info
83 
84  // types
85  typedef string TProject_role;
86  typedef int TProject_id;
87 
88  // member index
89  enum class E_memberIndex {
90  e__allMandatory = 0,
91  e_project_role,
92  e_project_id
93  };
95 
96  // getters
97  // setters
98 
99  /// Genbank / Refseq
100  /// Check if a value has been assigned to Project_role data member.
101  ///
102  /// Data member Project_role is mandatory;
103  /// its type is defined as 'typedef string TProject_role'
104  /// @return
105  /// - true, if a value has been assigned.
106  /// - false, otherwise.
107  bool IsSetProject_role(void) const;
108 
109  /// Check if it is safe to call GetProject_role method.
110  ///
111  /// @return
112  /// - true, if the data member is getatable.
113  /// - false, otherwise.
114  bool CanGetProject_role(void) const;
115 
116  /// Reset Project_role data member.
117  void ResetProject_role(void);
118 
119  /// Get the Project_role member data.
120  ///
121  /// @return
122  /// Reference to the member data.
123  const TProject_role& GetProject_role(void) const;
124 
125  /// Assign a value to Project_role data member.
126  ///
127  /// @param value
128  /// Value to assign
129  void SetProject_role(const TProject_role& value);
130  void SetProject_role(TProject_role&& value);
131 
132  /// Assign a value to Project_role data member.
133  ///
134  /// @return
135  /// Reference to the data value.
136  TProject_role& SetProject_role(void);
137 
138  /// Check if a value has been assigned to Project_id data member.
139  ///
140  /// Data member Project_id is mandatory;
141  /// its type is defined as 'typedef int TProject_id'
142  /// @return
143  /// - true, if a value has been assigned.
144  /// - false, otherwise.
145  bool IsSetProject_id(void) const;
146 
147  /// Check if it is safe to call GetProject_id method.
148  ///
149  /// @return
150  /// - true, if the data member is getatable.
151  /// - false, otherwise.
152  bool CanGetProject_id(void) const;
153 
154  /// Reset Project_id data member.
155  void ResetProject_id(void);
156 
157  /// Get the Project_id member data.
158  ///
159  /// @return
160  /// Copy of the member data.
161  TProject_id GetProject_id(void) const;
162 
163  /// Assign a value to Project_id data member.
164  ///
165  /// @param value
166  /// Value to assign
167  void SetProject_id(TProject_id value);
168 
169  /// Assign a value to Project_id data member.
170  ///
171  /// @return
172  /// Reference to the data value.
173  TProject_id& SetProject_id(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
185  Uint4 m_set_State[1];
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 IsSetProject_role();
209 }
210 
211 inline
213 {
214  if (!CanGetProject_role()) {
215  ThrowUnassigned(0);
216  }
217  return m_Project_role;
218 }
219 
220 inline
222 {
224  m_set_State[0] |= 0x3;
225 }
226 
227 inline
229 {
230  m_Project_role = std::forward<CGC_Project_Base::TProject_role>(value);
231  m_set_State[0] |= 0x3;
232 }
233 
234 inline
236 {
237 #ifdef _DEBUG
238  if (!IsSetProject_role()) {
240  }
241 #endif
242  m_set_State[0] |= 0x1;
243  return m_Project_role;
244 }
245 
246 inline
248 {
249  return ((m_set_State[0] & 0xc) != 0);
250 }
251 
252 inline
254 {
255  return IsSetProject_id();
256 }
257 
258 inline
260 {
261  m_Project_id = 0;
262  m_set_State[0] &= ~0xc;
263 }
264 
265 inline
267 {
268  if (!CanGetProject_id()) {
269  ThrowUnassigned(1);
270  }
271  return m_Project_id;
272 }
273 
274 inline
276 {
278  m_set_State[0] |= 0xc;
279 }
280 
281 inline
283 {
284 #ifdef _DEBUG
285  if (!IsSetProject_id()) {
286  memset(&m_Project_id,UnassignedByte(),sizeof(m_Project_id));
287  }
288 #endif
289  m_set_State[0] |= 0x4;
290  return m_Project_id;
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_GENOMECOLL_GC_PROJECT_BASE_HPP
CGC_Project_Base –.
Definition: GC_Project_.hpp:73
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
#define NCBI_GENOME_COLLECTION_EXPORT
Definition: ncbi_export.h:528
TProject_id & SetProject_id(void)
Assign a value to Project_id data member.
TProject_id GetProject_id(void) const
Get the Project_id member data.
CSerialObject Tparent
Definition: GC_Project_.hpp:74
bool IsSetProject_role(void) const
Genbank / Refseq Check if a value has been assigned to Project_role data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: GC_Project_.hpp:94
TProject_role & SetProject_role(void)
Assign a value to Project_role data member.
bool CanGetProject_role(void) const
Check if it is safe to call GetProject_role method.
void ResetProject_id(void)
Reset Project_id data member.
const TProject_role & GetProject_role(void) const
Get the Project_role member data.
CGC_Project_Base(const CGC_Project_Base &)
CGC_Project_Base & operator=(const CGC_Project_Base &)
bool IsSetProject_id(void) const
Check if a value has been assigned to Project_id data member.
bool CanGetProject_id(void) const
Check if it is safe to call GetProject_id method.
Uint4 m_set_State[1]
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Tue May 21 10:54:15 2024 by modify_doxy.py rev. 669887