NCBI C++ ToolKit
PC_AnnotatedXRef_.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 PC_AnnotatedXRef_.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/pcassay2/pcassay2.asn">pcassay2.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/pcassay2/pcassay2.def">pcassay2.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_PCASSAY2_PC_ANNOTATEDXREF_BASE_HPP
42 #define OBJECTS_PCASSAY2_PC_ANNOTATEDXREF_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 CPC_XRefData;
61 
62 #ifndef BEGIN_pcassay2_SCOPE
63 # define BEGIN_pcassay2_SCOPE BEGIN_SCOPE(pcassay2)
64 # define END_pcassay2_SCOPE END_SCOPE(pcassay2)
65 #endif
66 BEGIN_pcassay2_SCOPE // namespace ncbi::objects::pcassay2::
67 
68 
69 // generated classes
70 
71 
72 /** @addtogroup dataspec_NCBI_PCAssay2
73  *
74  * @{
75  */
76 
77 /////////////////////////////////////////////////////////////////////////////
78 /// Annotated Cross-Reference (XRef) Information to allow the XRef to be qualified, as to its meaning or context
79 ///
80 /// CPC_AnnotatedXRef_Base --
81 ///
82 
84 {
86 public:
87  // constructor
89  // destructor
90  virtual ~CPC_AnnotatedXRef_Base(void);
91 
92  // type info
94 
95  enum EType {
96  eType_pcit = 1, ///< primary PMID/citation directly associated with the current assay data
97  eType_pgene = 2 ///< gene encoding the protein assay target
98  };
99 
100  /// Access to EType's attributes (values, names) as defined in spec
101  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EType)(void);
102 
103  // types
104  typedef objects::CPC_XRefData TXref;
106  typedef int TType;
107 
108  // member index
109  enum class E_memberIndex {
110  e__allMandatory = 0,
111  e_xref,
112  e_comment,
113  e_type
114  };
116 
117  // getters
118  // setters
119 
120  /// Cross-Reference Information
121  /// Check if a value has been assigned to Xref data member.
122  ///
123  /// Data member Xref is mandatory;
124  /// its type is defined as 'typedef objects::CPC_XRefData TXref'
125  /// @return
126  /// - true, if a value has been assigned.
127  /// - false, otherwise.
128  bool IsSetXref(void) const;
129 
130  /// Check if it is safe to call GetXref method.
131  ///
132  /// @return
133  /// - true, if the data member is getatable.
134  /// - false, otherwise.
135  bool CanGetXref(void) const;
136 
137  /// Reset Xref data member.
138  void ResetXref(void);
139 
140  /// Get the Xref member data.
141  ///
142  /// @return
143  /// Reference to the member data.
144  const TXref& GetXref(void) const;
145 
146  /// Assign a value to Xref data member.
147  ///
148  /// @param value
149  /// Reference to value.
151 
152  /// Assign a value to Xref data member.
153  ///
154  /// @return
155  /// Reference to the data value.
156  TXref& SetXref(void);
157 
158  /// Annotation qualifier describing Cross-Reference meaning
159  /// Check if a value has been assigned to Comment data member.
160  ///
161  /// Data member Comment is optional;
162  /// its type is defined as 'typedef CStringUTF8 TComment'
163  /// @return
164  /// - true, if a value has been assigned.
165  /// - false, otherwise.
166  bool IsSetComment(void) const;
167 
168  /// Check if it is safe to call GetComment method.
169  ///
170  /// @return
171  /// - true, if the data member is getatable.
172  /// - false, otherwise.
173  bool CanGetComment(void) const;
174 
175  /// Reset Comment data member.
176  void ResetComment(void);
177 
178  /// Get the Comment member data.
179  ///
180  /// @return
181  /// Reference to the member data.
182  const TComment& GetComment(void) const;
183 
184  /// Assign a value to Comment data member.
185  ///
186  /// @param value
187  /// Value to assign
188  void SetComment(const TComment& value);
190 
191  /// Assign a value to Comment data member.
192  ///
193  /// @return
194  /// Reference to the data value.
196 
197  /// Check if a value has been assigned to Type data member.
198  ///
199  /// Data member Type is optional;
200  /// its type is defined as 'typedef int TType'
201  /// @return
202  /// - true, if a value has been assigned.
203  /// - false, otherwise.
204  bool IsSetType(void) const;
205 
206  /// Check if it is safe to call GetType method.
207  ///
208  /// @return
209  /// - true, if the data member is getatable.
210  /// - false, otherwise.
211  bool CanGetType(void) const;
212 
213  /// Reset Type data member.
214  void ResetType(void);
215 
216  /// Get the Type member data.
217  ///
218  /// @return
219  /// Copy of the member data.
220  TType GetType(void) const;
221 
222  /// Assign a value to Type data member.
223  ///
224  /// @param value
225  /// Value to assign
227 
228  /// Assign a value to Type data member.
229  ///
230  /// @return
231  /// Reference to the data value.
232  TType& SetType(void);
233 
234  /// Reset the whole object
235  virtual void Reset(void);
236 
237 
238 private:
239  // Prohibit copy constructor and assignment operator
242 
243  // data
244  Uint4 m_set_State[1];
247  int m_Type;
248 };
249 
250 /* @} */
251 
252 
253 
254 
255 
256 ///////////////////////////////////////////////////////////
257 ///////////////////// inline methods //////////////////////
258 ///////////////////////////////////////////////////////////
259 inline
260 bool CPC_AnnotatedXRef_Base::IsSetXref(void) const
261 {
262  return m_Xref.NotEmpty();
263 }
264 
265 inline
266 bool CPC_AnnotatedXRef_Base::CanGetXref(void) const
267 {
268  return true;
269 }
270 
271 inline
273 {
274  if ( !m_Xref ) {
275  const_cast<CPC_AnnotatedXRef_Base*>(this)->ResetXref();
276  }
277  return (*m_Xref);
278 }
279 
280 inline
282 {
283  if ( !m_Xref ) {
284  ResetXref();
285  }
286  return (*m_Xref);
287 }
288 
289 inline
291 {
292  return ((m_set_State[0] & 0xc) != 0);
293 }
294 
295 inline
297 {
298  return IsSetComment();
299 }
300 
301 inline
303 {
304  if (!CanGetComment()) {
305  ThrowUnassigned(1);
306  }
307  return m_Comment;
308 }
309 
310 inline
312 {
313  m_Comment = value;
314  m_set_State[0] |= 0xc;
315 }
316 
317 inline
319 {
320  m_Comment = std::forward<CPC_AnnotatedXRef_Base::TComment>(value);
321  m_set_State[0] |= 0xc;
322 }
323 
324 inline
326 {
327 #ifdef _DEBUG
328  if (!IsSetComment()) {
330  }
331 #endif
332  m_set_State[0] |= 0x4;
333  return m_Comment;
334 }
335 
336 inline
337 bool CPC_AnnotatedXRef_Base::IsSetType(void) const
338 {
339  return ((m_set_State[0] & 0x30) != 0);
340 }
341 
342 inline
343 bool CPC_AnnotatedXRef_Base::CanGetType(void) const
344 {
345  return IsSetType();
346 }
347 
348 inline
350 {
351  m_Type = (EType)(0);
352  m_set_State[0] &= ~0x30;
353 }
354 
355 inline
357 {
358  if (!CanGetType()) {
359  ThrowUnassigned(2);
360  }
361  return m_Type;
362 }
363 
364 inline
366 {
367  m_Type = value;
368  m_set_State[0] |= 0x30;
369 }
370 
371 inline
373 {
374 #ifdef _DEBUG
375  if (!IsSetType()) {
376  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
377  }
378 #endif
379  m_set_State[0] |= 0x10;
380  return m_Type;
381 }
382 
383 ///////////////////////////////////////////////////////////
384 ////////////////// end of inline methods //////////////////
385 ///////////////////////////////////////////////////////////
386 
387 
388 
389 
390 
391 END_pcassay2_SCOPE // namespace ncbi::objects::pcassay2::
392 
393 END_objects_SCOPE // namespace ncbi::objects::
394 
396 
397 
398 #endif // OBJECTS_PCASSAY2_PC_ANNOTATEDXREF_BASE_HPP
Annotated Cross-Reference (XRef) Information to allow the XRef to be qualified, as to its meaning or ...
CPC_XRefData –.
Definition: PC_XRefData.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
static CStringUTF8 UnassignedStringUTF8(void)
Definition: serialbase.hpp:178
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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
std::string CStringUTF8
Definition: ncbistl.hpp:254
TXref & SetXref(void)
Assign a value to Xref data member.
bool CanGetXref(void) const
Check if it is safe to call GetXref method.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
void ResetXref(void)
Reset Xref data member.
CPC_AnnotatedXRef_Base(const CPC_AnnotatedXRef_Base &)
virtual void Reset(void)
Reset the whole object.
bool IsSetComment(void) const
Annotation qualifier describing Cross-Reference meaning Check if a value has been assigned to Comment...
CPC_AnnotatedXRef_Base & operator=(const CPC_AnnotatedXRef_Base &)
objects::CPC_XRefData TXref
void SetComment(TComment &&value)
TType GetType(void) const
Get the Type member data.
bool CanGetType(void) const
Check if it is safe to call GetType method.
virtual ~CPC_AnnotatedXRef_Base(void)
const TComment & GetComment(void) const
Get the Comment member data.
void ResetType(void)
Reset Type data member.
TType & SetType(void)
Assign a value to Type data member.
TComment & SetComment(void)
Assign a value to Comment data member.
const TXref & GetXref(void) const
Get the Xref member data.
bool IsSetXref(void) const
Cross-Reference Information Check if a value has been assigned to Xref data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
void SetComment(const TComment &value)
Assign a value to Comment data member.
void ResetComment(void)
Reset Comment data member.
void SetXref(TXref &value)
Assign a value to Xref data member.
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
void SetType(TType value)
Assign a value to Type data member.
@ eType_pgene
gene encoding the protein assay target
@ eType_pcit
primary PMID/citation directly associated with the current assay data
bool CanGetXref(void) const
Check if it is safe to call GetXref method.
const TComment & GetComment(void) const
Get the Comment member data.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
bool IsSetComment(void) const
Annotation qualifier describing Cross-Reference meaning Check if a value has been assigned to Comment...
TXref & SetXref(void)
Assign a value to Xref data member.
TType GetType(void) const
Get the Type member data.
void ResetXref(void)
Reset Xref data member.
TComment & SetComment(void)
Assign a value to Comment data member.
bool CanGetType(void) const
Check if it is safe to call GetType method.
TType & SetType(void)
Assign a value to Type data member.
void ResetType(void)
Reset Type data member.
const TXref & GetXref(void) const
Get the Xref member data.
bool IsSetXref(void) const
Cross-Reference Information Check if a value has been assigned to Xref data member.
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define END_pcassay2_SCOPE
#define BEGIN_pcassay2_SCOPE
Modified on Sun May 05 05:21:12 2024 by modify_doxy.py rev. 669887