NCBI C++ ToolKit
GBComment_.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 GBComment_.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_GBCOMMENT_BASE_HPP
42 #define OBJECTS_GBSEQ_GBCOMMENT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
51 
53 
54 #ifndef BEGIN_objects_SCOPE
55 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
56 # define END_objects_SCOPE END_SCOPE(objects)
57 #endif
58 BEGIN_objects_SCOPE // namespace ncbi::objects::
59 
60 
61 // generated classes
62 
63 
64 /** @addtogroup dataspec_NCBI_GBSeq
65  *
66  * @{
67  */
68 
69 /////////////////////////////////////////////////////////////////////////////
70 ///
71 /// CGBComment_Base --
72 ///
73 
75 {
77 public:
78  // constructor
79  CGBComment_Base(void);
80  // destructor
81  virtual ~CGBComment_Base(void);
82 
83  // type info
85 
86  // types
87  typedef string TType;
88  typedef list< CGBCommentParagraph > TParagraphs;
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_type,
94  e_paragraphs
95  };
97 
98  // getters
99  // setters
100 
101  /// Check if a value has been assigned to Type data member.
102  ///
103  /// Data member Type is optional;
104  /// its type is defined as 'typedef string TType'
105  /// @return
106  /// - true, if a value has been assigned.
107  /// - false, otherwise.
108  bool IsSetType(void) const;
109 
110  /// Check if it is safe to call GetType method.
111  ///
112  /// @return
113  /// - true, if the data member is getatable.
114  /// - false, otherwise.
115  bool CanGetType(void) const;
116 
117  /// Reset Type data member.
118  void ResetType(void);
119 
120  /// Get the Type member data.
121  ///
122  /// @return
123  /// Reference to the member data.
124  const TType& GetType(void) const;
125 
126  /// Assign a value to Type data member.
127  ///
128  /// @param value
129  /// Value to assign
130  void SetType(const TType& value);
131  void SetType(TType&& value);
132 
133  /// Assign a value to Type data member.
134  ///
135  /// @return
136  /// Reference to the data value.
137  TType& SetType(void);
138 
139  /// Check if a value has been assigned to Paragraphs data member.
140  ///
141  /// Data member Paragraphs is mandatory;
142  /// its type is defined as 'typedef list< CGBCommentParagraph > TParagraphs'
143  /// @return
144  /// - true, if a value has been assigned.
145  /// - false, otherwise.
146  bool IsSetParagraphs(void) const;
147 
148  /// Check if it is safe to call GetParagraphs method.
149  ///
150  /// @return
151  /// - true, if the data member is getatable.
152  /// - false, otherwise.
153  bool CanGetParagraphs(void) const;
154 
155  /// Reset Paragraphs data member.
156  void ResetParagraphs(void);
157 
158  /// Get the Paragraphs member data.
159  ///
160  /// @return
161  /// Reference to the member data.
162  const TParagraphs& GetParagraphs(void) const;
163 
164  /// Assign a value to Paragraphs data member.
165  ///
166  /// @return
167  /// Reference to the data value.
168  TParagraphs& SetParagraphs(void);
169 
170  /// Reset the whole object
171  virtual void Reset(void);
172 
173 
174 private:
175  // Prohibit copy constructor and assignment operator
178 
179  // data
180  Uint4 m_set_State[1];
181  string m_Type;
182  list< CGBCommentParagraph > m_Paragraphs;
183 };
184 
185 /* @} */
186 
187 
188 
189 
190 
191 ///////////////////////////////////////////////////////////
192 ///////////////////// inline methods //////////////////////
193 ///////////////////////////////////////////////////////////
194 inline
196 {
197  return ((m_set_State[0] & 0x3) != 0);
198 }
199 
200 inline
202 {
203  return IsSetType();
204 }
205 
206 inline
208 {
209  if (!CanGetType()) {
210  ThrowUnassigned(0);
211  }
212  return m_Type;
213 }
214 
215 inline
217 {
218  m_Type = value;
219  m_set_State[0] |= 0x3;
220 }
221 
222 inline
224 {
225  m_Type = std::forward<CGBComment_Base::TType>(value);
226  m_set_State[0] |= 0x3;
227 }
228 
229 inline
231 {
232 #ifdef _DEBUG
233  if (!IsSetType()) {
235  }
236 #endif
237  m_set_State[0] |= 0x1;
238  return m_Type;
239 }
240 
241 inline
243 {
244  return ((m_set_State[0] & 0xc) != 0);
245 }
246 
247 inline
249 {
250  return true;
251 }
252 
253 inline
255 {
256  return m_Paragraphs;
257 }
258 
259 inline
261 {
262  m_set_State[0] |= 0x4;
263  return m_Paragraphs;
264 }
265 
266 ///////////////////////////////////////////////////////////
267 ////////////////// end of inline methods //////////////////
268 ///////////////////////////////////////////////////////////
269 
270 
271 
272 
273 
274 END_objects_SCOPE // namespace ncbi::objects::
275 
277 
278 
279 #endif // OBJECTS_GBSEQ_GBCOMMENT_BASE_HPP
User-defined methods of the data storage class.
CGBComment_Base –.
Definition: GBComment_.hpp:75
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
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
TType & SetType(void)
Assign a value to Type data member.
Definition: GBComment_.hpp:230
bool IsSetParagraphs(void) const
Check if a value has been assigned to Paragraphs data member.
Definition: GBComment_.hpp:242
TParagraphs & SetParagraphs(void)
Assign a value to Paragraphs data member.
Definition: GBComment_.hpp:260
const TParagraphs & GetParagraphs(void) const
Get the Paragraphs member data.
Definition: GBComment_.hpp:254
list< CGBCommentParagraph > m_Paragraphs
Definition: GBComment_.hpp:182
CSerialObject Tparent
Definition: GBComment_.hpp:76
Uint4 m_set_State[1]
Definition: GBComment_.hpp:180
CGBComment_Base(const CGBComment_Base &)
bool CanGetType(void) const
Check if it is safe to call GetType method.
Definition: GBComment_.hpp:201
bool CanGetParagraphs(void) const
Check if it is safe to call GetParagraphs method.
Definition: GBComment_.hpp:248
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
Definition: GBComment_.hpp:195
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: GBComment_.hpp:96
const TType & GetType(void) const
Get the Type member data.
Definition: GBComment_.hpp:207
CGBComment_Base & operator=(const CGBComment_Base &)
list< CGBCommentParagraph > TParagraphs
Definition: GBComment_.hpp:88
Modified on Wed Feb 21 09:55:54 2024 by modify_doxy.py rev. 669887