NCBI C++ ToolKit
GBStrucComment_.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 GBStrucComment_.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/gbseq/gbseq.asn">gbseq.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/gbseq/gbseq.def">gbseq.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_GBSEQ_GBSTRUCCOMMENT_BASE_HPP
42 #define OBJECTS_GBSEQ_GBSTRUCCOMMENT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #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 // forward declarations
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_GBSeq
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///
74 /// CGBStrucComment_Base --
75 ///
76 
78 {
80 public:
81  // constructor
83  // destructor
84  virtual ~CGBStrucComment_Base(void);
85 
86  // type info
88 
89  // types
90  typedef string TName;
91  typedef list< CRef< CGBStrucCommentItem > > TItems;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_name,
97  e_items
98  };
100 
101  // getters
102  // setters
103 
104  /// Check if a value has been assigned to Name data member.
105  ///
106  /// Data member Name is optional;
107  /// its type is defined as 'typedef string TName'
108  /// @return
109  /// - true, if a value has been assigned.
110  /// - false, otherwise.
111  bool IsSetName(void) const;
112 
113  /// Check if it is safe to call GetName method.
114  ///
115  /// @return
116  /// - true, if the data member is getatable.
117  /// - false, otherwise.
118  bool CanGetName(void) const;
119 
120  /// Reset Name data member.
121  void ResetName(void);
122 
123  /// Get the Name member data.
124  ///
125  /// @return
126  /// Reference to the member data.
127  const TName& GetName(void) const;
128 
129  /// Assign a value to Name data member.
130  ///
131  /// @param value
132  /// Value to assign
133  void SetName(const TName& value);
134  void SetName(TName&& value);
135 
136  /// Assign a value to Name data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TName& SetName(void);
141 
142  /// Check if a value has been assigned to Items data member.
143  ///
144  /// Data member Items is mandatory;
145  /// its type is defined as 'typedef list< CRef< CGBStrucCommentItem > > TItems'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetItems(void) const;
150 
151  /// Check if it is safe to call GetItems method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetItems(void) const;
157 
158  /// Reset Items data member.
159  void ResetItems(void);
160 
161  /// Get the Items member data.
162  ///
163  /// @return
164  /// Reference to the member data.
165  const TItems& GetItems(void) const;
166 
167  /// Assign a value to Items data member.
168  ///
169  /// @return
170  /// Reference to the data value.
171  TItems& SetItems(void);
172 
173  /// Reset the whole object
174  virtual void Reset(void);
175 
176 
177 private:
178  // Prohibit copy constructor and assignment operator
181 
182  // data
183  Uint4 m_set_State[1];
184  string m_Name;
185  list< CRef< CGBStrucCommentItem > > m_Items;
186 };
187 
188 /* @} */
189 
190 
191 
192 
193 
194 ///////////////////////////////////////////////////////////
195 ///////////////////// inline methods //////////////////////
196 ///////////////////////////////////////////////////////////
197 inline
199 {
200  return ((m_set_State[0] & 0x3) != 0);
201 }
202 
203 inline
205 {
206  return IsSetName();
207 }
208 
209 inline
211 {
212  if (!CanGetName()) {
213  ThrowUnassigned(0);
214  }
215  return m_Name;
216 }
217 
218 inline
220 {
221  m_Name = value;
222  m_set_State[0] |= 0x3;
223 }
224 
225 inline
227 {
228  m_Name = std::forward<CGBStrucComment_Base::TName>(value);
229  m_set_State[0] |= 0x3;
230 }
231 
232 inline
234 {
235 #ifdef _DEBUG
236  if (!IsSetName()) {
238  }
239 #endif
240  m_set_State[0] |= 0x1;
241  return m_Name;
242 }
243 
244 inline
246 {
247  return ((m_set_State[0] & 0xc) != 0);
248 }
249 
250 inline
252 {
253  return true;
254 }
255 
256 inline
258 {
259  return m_Items;
260 }
261 
262 inline
264 {
265  m_set_State[0] |= 0x4;
266  return m_Items;
267 }
268 
269 ///////////////////////////////////////////////////////////
270 ////////////////// end of inline methods //////////////////
271 ///////////////////////////////////////////////////////////
272 
273 
274 
275 
276 
277 END_objects_SCOPE // namespace ncbi::objects::
278 
280 
281 
282 #endif // OBJECTS_GBSEQ_GBSTRUCCOMMENT_BASE_HPP
CGBStrucCommentItem –.
CGBStrucComment_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_GBSEQ_EXPORT
Definition: ncbi_export.h:504
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
const TItems & GetItems(void) const
Get the Items member data.
TItems & SetItems(void)
Assign a value to Items data member.
CGBStrucComment_Base & operator=(const CGBStrucComment_Base &)
list< CRef< CGBStrucCommentItem > > TItems
bool CanGetName(void) const
Check if it is safe to call GetName method.
bool CanGetItems(void) const
Check if it is safe to call GetItems method.
bool IsSetItems(void) const
Check if a value has been assigned to Items data member.
TName & SetName(void)
Assign a value to Name data member.
CGBStrucComment_Base(const CGBStrucComment_Base &)
list< CRef< CGBStrucCommentItem > > m_Items
const TName & GetName(void) const
Get the Name member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:19 2024 by modify_doxy.py rev. 669887