NCBI C++ ToolKit
GC_External_Seqid_.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_External_Seqid_.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_EXTERNAL_SEQID_BASE_HPP
42 #define OBJECTS_GENOMECOLL_GC_EXTERNAL_SEQID_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 // forward declarations
60 class CSeq_id;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_GenomeCollection
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CGC_External_Seqid_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CGC_External_Seqid_Base(void);
84 
85  // type info
87 
88  // types
89  typedef string TExternal;
90  typedef CSeq_id TId;
91 
92  // member index
93  enum class E_memberIndex {
94  e__allMandatory = 0,
95  e_external,
96  e_id
97  };
99 
100  // getters
101  // setters
102 
103  /// Check if a value has been assigned to External data member.
104  ///
105  /// Data member External is mandatory;
106  /// its type is defined as 'typedef string TExternal'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetExternal(void) const;
111 
112  /// Check if it is safe to call GetExternal method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetExternal(void) const;
118 
119  /// Reset External data member.
120  void ResetExternal(void);
121 
122  /// Get the External member data.
123  ///
124  /// @return
125  /// Reference to the member data.
126  const TExternal& GetExternal(void) const;
127 
128  /// Assign a value to External data member.
129  ///
130  /// @param value
131  /// Value to assign
132  void SetExternal(const TExternal& value);
133  void SetExternal(TExternal&& value);
134 
135  /// Assign a value to External data member.
136  ///
137  /// @return
138  /// Reference to the data value.
139  TExternal& SetExternal(void);
140 
141  /// Check if a value has been assigned to Id data member.
142  ///
143  /// Data member Id is mandatory;
144  /// its type is defined as 'typedef CSeq_id TId'
145  /// @return
146  /// - true, if a value has been assigned.
147  /// - false, otherwise.
148  bool IsSetId(void) const;
149 
150  /// Check if it is safe to call GetId method.
151  ///
152  /// @return
153  /// - true, if the data member is getatable.
154  /// - false, otherwise.
155  bool CanGetId(void) const;
156 
157  /// Reset Id data member.
158  void ResetId(void);
159 
160  /// Get the Id member data.
161  ///
162  /// @return
163  /// Reference to the member data.
164  const TId& GetId(void) const;
165 
166  /// Assign a value to Id data member.
167  ///
168  /// @param value
169  /// Reference to value.
170  void SetId(TId& value);
171 
172  /// Assign a value to Id data member.
173  ///
174  /// @return
175  /// Reference to the data value.
176  TId& SetId(void);
177 
178  /// Reset the whole object
179  virtual void Reset(void);
180 
181 
182 private:
183  // Prohibit copy constructor and assignment operator
186 
187  // data
188  Uint4 m_set_State[1];
189  string m_External;
191 };
192 
193 /* @} */
194 
195 
196 
197 
198 
199 ///////////////////////////////////////////////////////////
200 ///////////////////// inline methods //////////////////////
201 ///////////////////////////////////////////////////////////
202 inline
204 {
205  return ((m_set_State[0] & 0x3) != 0);
206 }
207 
208 inline
210 {
211  return IsSetExternal();
212 }
213 
214 inline
216 {
217  if (!CanGetExternal()) {
218  ThrowUnassigned(0);
219  }
220  return m_External;
221 }
222 
223 inline
225 {
226  m_External = value;
227  m_set_State[0] |= 0x3;
228 }
229 
230 inline
232 {
233  m_External = std::forward<CGC_External_Seqid_Base::TExternal>(value);
234  m_set_State[0] |= 0x3;
235 }
236 
237 inline
239 {
240 #ifdef _DEBUG
241  if (!IsSetExternal()) {
243  }
244 #endif
245  m_set_State[0] |= 0x1;
246  return m_External;
247 }
248 
249 inline
251 {
252  return m_Id.NotEmpty();
253 }
254 
255 inline
257 {
258  return true;
259 }
260 
261 inline
263 {
264  if ( !m_Id ) {
265  const_cast<CGC_External_Seqid_Base*>(this)->ResetId();
266  }
267  return (*m_Id);
268 }
269 
270 inline
272 {
273  if ( !m_Id ) {
274  ResetId();
275  }
276  return (*m_Id);
277 }
278 
279 ///////////////////////////////////////////////////////////
280 ////////////////// end of inline methods //////////////////
281 ///////////////////////////////////////////////////////////
282 
283 
284 
285 
286 
287 END_objects_SCOPE // namespace ncbi::objects::
288 
290 
291 
292 #endif // OBJECTS_GENOMECOLL_GC_EXTERNAL_SEQID_BASE_HPP
CGC_External_Seqid_Base –.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
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
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
const TId & GetId(void) const
Get the Id member data.
CGC_External_Seqid_Base(const CGC_External_Seqid_Base &)
TExternal & SetExternal(void)
Assign a value to External data member.
CGC_External_Seqid_Base & operator=(const CGC_External_Seqid_Base &)
const TExternal & GetExternal(void) const
Get the External member data.
TId & SetId(void)
Assign a value to Id data member.
bool IsSetExternal(void) const
Check if a value has been assigned to External data member.
bool CanGetId(void) const
Check if it is safe to call GetId method.
void ResetId(void)
Reset Id data member.
bool CanGetExternal(void) const
Check if it is safe to call GetExternal method.
Modified on Sat Dec 09 04:50:00 2023 by modify_doxy.py rev. 669887