NCBI C++ ToolKit
SeqFeatXref_.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 SeqFeatXref_.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/seqfeat/seqfeat.asn">seqfeat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqfeat/seqfeat.def">seqfeat.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_SEQFEAT_SEQFEATXREF_BASE_HPP
42 #define OBJECTS_SEQFEAT_SEQFEATXREF_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // forward declarations
56 class CFeat_id;
57 class CSeqFeatData;
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_Seqfeat
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 /// both optional because can have one or both
70 ///
71 /// CSeqFeatXref_Base --
72 ///
73 
75 {
77 public:
78  // constructor
79  CSeqFeatXref_Base(void);
80  // destructor
81  virtual ~CSeqFeatXref_Base(void);
82 
83  // type info
85 
86  // types
87  typedef CFeat_id TId;
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_id,
94  e_data
95  };
97 
98  // getters
99  // setters
100 
101  /// the feature copied
102  /// Check if a value has been assigned to Id data member.
103  ///
104  /// Data member Id is optional;
105  /// its type is defined as 'typedef CFeat_id TId'
106  /// @return
107  /// - true, if a value has been assigned.
108  /// - false, otherwise.
109  bool IsSetId(void) const;
110 
111  /// Check if it is safe to call GetId method.
112  ///
113  /// @return
114  /// - true, if the data member is getatable.
115  /// - false, otherwise.
116  bool CanGetId(void) const;
117 
118  /// Reset Id data member.
119  void ResetId(void);
120 
121  /// Get the Id member data.
122  ///
123  /// @return
124  /// Reference to the member data.
125  const TId& GetId(void) const;
126 
127  /// Assign a value to Id data member.
128  ///
129  /// @param value
130  /// Reference to value.
131  void SetId(TId& value);
132 
133  /// Assign a value to Id data member.
134  ///
135  /// @return
136  /// Reference to the data value.
137  TId& SetId(void);
138 
139  /// the specific data
140  /// Check if a value has been assigned to Data data member.
141  ///
142  /// Data member Data is optional;
143  /// its type is defined as 'typedef CSeqFeatData TData'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetData(void) const;
148 
149  /// Check if it is safe to call GetData method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetData(void) const;
155 
156  /// Reset Data data member.
157  void ResetData(void);
158 
159  /// Get the Data member data.
160  ///
161  /// @return
162  /// Reference to the member data.
163  const TData& GetData(void) const;
164 
165  /// Assign a value to Data data member.
166  ///
167  /// @param value
168  /// Reference to value.
169  void SetData(TData& value);
170 
171  /// Assign a value to Data data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TData& SetData(void);
176 
177  /// Reset the whole object
178  virtual void Reset(void);
179 
180 
181 private:
182  // Prohibit copy constructor and assignment operator
185 
186  // data
187  Uint4 m_set_State[1];
190 };
191 
192 /* @} */
193 
194 
195 
196 
197 
198 ///////////////////////////////////////////////////////////
199 ///////////////////// inline methods //////////////////////
200 ///////////////////////////////////////////////////////////
201 inline
203 {
204  return m_Id.NotEmpty();
205 }
206 
207 inline
209 {
210  return IsSetId();
211 }
212 
213 inline
215 {
216  if (!CanGetId()) {
217  ThrowUnassigned(0);
218  }
219  return (*m_Id);
220 }
221 
222 inline
224 {
225  return m_Data.NotEmpty();
226 }
227 
228 inline
230 {
231  return IsSetData();
232 }
233 
234 inline
236 {
237  if (!CanGetData()) {
238  ThrowUnassigned(1);
239  }
240  return (*m_Data);
241 }
242 
243 ///////////////////////////////////////////////////////////
244 ////////////////// end of inline methods //////////////////
245 ///////////////////////////////////////////////////////////
246 
247 
248 
249 
250 
251 END_objects_SCOPE // namespace ncbi::objects::
252 
254 
255 
256 #endif // OBJECTS_SEQFEAT_SEQFEATXREF_BASE_HPP
CFeat_id –.
Definition: Feat_id.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
both optional because can have one or both
Base class for all serializable objects.
Definition: serialbase.hpp:150
void ThrowUnassigned(TMemberIndex index) const
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,...
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
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_SEQFEAT_EXPORT
Definition: ncbi_export.h:768
const TData & GetData(void) const
Get the Data member data.
const TId & GetId(void) const
Get the Id member data.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool CanGetId(void) const
Check if it is safe to call GetId method.
CSeqFeatXref_Base(const CSeqFeatXref_Base &)
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool CanGetData(void) const
Check if it is safe to call GetData method.
CSeqFeatXref_Base & operator=(const CSeqFeatXref_Base &)
CRef< TData > m_Data
CSeqFeatData TData
CSerialObject Tparent
bool IsSetId(void) const
the feature copied Check if a value has been assigned to Id data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat Jun 22 10:37:56 2024 by modify_doxy.py rev. 669887