NCBI C++ ToolKit
ELinkResult_.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 ELinkResult_.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/objtools/eutils/elink/elink.dtd">elink.dtd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objtools/eutils/elink/elink.def">elink.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 elink__OBJTOOLS_EUTILS_ELINK_ELINKRESULT_BASE_HPP
42 #define elink__OBJTOOLS_EUTILS_ELINK_ELINKRESULT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 
51 #ifndef BEGIN_elink_SCOPE
52 # define BEGIN_elink_SCOPE BEGIN_SCOPE(elink)
53 # define END_elink_SCOPE END_SCOPE(elink)
54 #endif
55 BEGIN_elink_SCOPE // namespace elink::
56 
57 
58 // forward declarations
59 class CLinkSet;
60 
61 
62 // generated classes
63 
64 
65 /** @addtogroup dataspec_elink
66  *
67  * @{
68  */
69 
70 /////////////////////////////////////////////////////////////////////////////
71 ///
72 /// CELinkResult_Base --
73 ///
74 
75 class NCBI_EUTILS_EXPORT CELinkResult_Base : public NCBI_NS_NCBI::CSerialObject
76 {
77  typedef NCBI_NS_NCBI::CSerialObject Tparent;
78 public:
79  // constructor
80  CELinkResult_Base(void);
81  // destructor
82  virtual ~CELinkResult_Base(void);
83 
84  // type info
86 
87  // types
88  typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CLinkSet > > TLinkSet;
90 
91  // member index
92  enum class E_memberIndex {
93  e__allMandatory = 0,
94  e_LinkSet,
95  e_ERROR
96  };
97  typedef Tparent::CMemberIndex<E_memberIndex, 3> TmemberIndex;
98 
99  // getters
100  // setters
101 
102  /// Common
103  /// Check if a value has been assigned to LinkSet data member.
104  ///
105  /// Data member LinkSet is optional;
106  /// its type is defined as 'typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CLinkSet > > TLinkSet'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetLinkSet(void) const;
111 
112  /// Check if it is safe to call GetLinkSet method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetLinkSet(void) const;
118 
119  /// Reset LinkSet data member.
120  void ResetLinkSet(void);
121 
122  /// Get the LinkSet member data.
123  ///
124  /// @return
125  /// Reference to the member data.
126  const TLinkSet& GetLinkSet(void) const;
127 
128  /// Assign a value to LinkSet data member.
129  ///
130  /// @return
131  /// Reference to the data value.
132  TLinkSet& SetLinkSet(void);
133 
134  /// .+
135  /// Check if a value has been assigned to ERROR data member.
136  ///
137  /// Data member ERROR is optional;
138  /// its type is defined as 'typedef NCBI_NS_STD::string TERROR'
139  /// @return
140  /// - true, if a value has been assigned.
141  /// - false, otherwise.
142  bool IsSetERROR(void) const;
143 
144  /// Check if it is safe to call GetERROR method.
145  ///
146  /// @return
147  /// - true, if the data member is getatable.
148  /// - false, otherwise.
149  bool CanGetERROR(void) const;
150 
151  /// Reset ERROR data member.
152  void ResetERROR(void);
153 
154  /// Get the ERROR member data.
155  ///
156  /// @return
157  /// Reference to the member data.
158  const TERROR& GetERROR(void) const;
159 
160  /// Assign a value to ERROR data member.
161  ///
162  /// @param value
163  /// Value to assign
164  void SetERROR(const TERROR& value);
165  void SetERROR(TERROR&& value);
166 
167  /// Assign a value to ERROR data member.
168  ///
169  /// @return
170  /// Reference to the data value.
171  TERROR& SetERROR(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  NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CLinkSet > > m_LinkSet;
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 true;
207 }
208 
209 inline
211 {
212  return m_LinkSet;
213 }
214 
215 inline
217 {
218  m_set_State[0] |= 0x1;
219  return m_LinkSet;
220 }
221 
222 inline
224 {
225  return ((m_set_State[0] & 0xc) != 0);
226 }
227 
228 inline
230 {
231  return IsSetERROR();
232 }
233 
234 inline
236 {
237  if (!CanGetERROR()) {
238  ThrowUnassigned(1);
239  }
240  return m_ERROR;
241 }
242 
243 inline
245 {
246  m_ERROR = value;
247  m_set_State[0] |= 0xc;
248 }
249 
250 inline
252 {
253  m_ERROR = std::forward<CELinkResult_Base::TERROR>(value);
254  m_set_State[0] |= 0xc;
255 }
256 
257 inline
259 {
260 #ifdef _DEBUG
261  if (!IsSetERROR()) {
262  m_ERROR = UnassignedString();
263  }
264 #endif
265  m_set_State[0] |= 0x4;
266  return m_ERROR;
267 }
268 
269 ///////////////////////////////////////////////////////////
270 ////////////////// end of inline methods //////////////////
271 ///////////////////////////////////////////////////////////
272 
273 
274 
275 
276 
277 END_elink_SCOPE // namespace elink::
278 
279 
280 #endif // elink__OBJTOOLS_EUTILS_ELINK_ELINKRESULT_BASE_HPP
#define END_elink_SCOPE
#define BEGIN_elink_SCOPE
CELinkResult_Base –.
CLinkSet –.
Definition: LinkSet.hpp:64
string
Definition: cgiapp.hpp:690
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define NCBI_EUTILS_EXPORT
Definition: ncbi_export.h:1460
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:09 2024 by modify_doxy.py rev. 669887