NCBI C++ ToolKit
PluginObject_.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 PluginObject_.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/gui/objects/gui_objects.asn">gui_objects.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/gui/objects/gui_objects.def">gui_objects.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 GUI_OBJECTS_PLUGINOBJECT_BASE_HPP
42 #define GUI_OBJECTS_PLUGINOBJECT_BASE_HPP
43 
44 // extra headers
45 #include <gui/gui_export.h>
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
51 #include <string>
52 
54 
55 #ifndef BEGIN_objects_SCOPE
56 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
57 # define END_objects_SCOPE END_SCOPE(objects)
58 #endif
59 BEGIN_objects_SCOPE // namespace ncbi::objects::
60 
61 
62 // generated classes
63 
64 
65 /** @addtogroup dataspec_NCBI_Plugin
66  *
67  * @{
68  */
69 
70 /////////////////////////////////////////////////////////////////////////////
71 ///-
72 ///- Wrappers for non-serializable objects
73 ///- For these we encode a pointer and a name of the object type
74 ///-
75 ///
76 /// CPluginObject_Base --
77 ///
78 
80 {
82 public:
83  // constructor
84  CPluginObject_Base(void);
85  // destructor
86  virtual ~CPluginObject_Base(void);
87 
88  // type info
90 
91  // types
92  typedef string TObjaddr;
93  typedef string TSubtype;
94 
95  // member index
96  enum class E_memberIndex {
97  e__allMandatory = 0,
98  e_objaddr,
99  e_subtype
100  };
102 
103  // getters
104  // setters
105 
106  /// Check if a value has been assigned to Objaddr data member.
107  ///
108  /// Data member Objaddr is mandatory;
109  /// its type is defined as 'typedef string TObjaddr'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetObjaddr(void) const;
114 
115  /// Check if it is safe to call GetObjaddr method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetObjaddr(void) const;
121 
122  /// Reset Objaddr data member.
123  void ResetObjaddr(void);
124 
125  /// Get the Objaddr member data.
126  ///
127  /// @return
128  /// Reference to the member data.
129  const TObjaddr& GetObjaddr(void) const;
130 
131  /// Assign a value to Objaddr data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetObjaddr(const TObjaddr& value);
136  void SetObjaddr(TObjaddr&& value);
137 
138  /// Assign a value to Objaddr data member.
139  ///
140  /// @return
141  /// Reference to the data value.
142  TObjaddr& SetObjaddr(void);
143 
144  /// Check if a value has been assigned to Subtype data member.
145  ///
146  /// Data member Subtype is mandatory;
147  /// its type is defined as 'typedef string TSubtype'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetSubtype(void) const;
152 
153  /// Check if it is safe to call GetSubtype method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetSubtype(void) const;
159 
160  /// Reset Subtype data member.
161  void ResetSubtype(void);
162 
163  /// Get the Subtype member data.
164  ///
165  /// @return
166  /// Reference to the member data.
167  const TSubtype& GetSubtype(void) const;
168 
169  /// Assign a value to Subtype data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetSubtype(const TSubtype& value);
174  void SetSubtype(TSubtype&& value);
175 
176  /// Assign a value to Subtype data member.
177  ///
178  /// @return
179  /// Reference to the data value.
180  TSubtype& SetSubtype(void);
181 
182  /// Reset the whole object
183  virtual void Reset(void);
184 
185 
186 private:
187  // Prohibit copy constructor and assignment operator
190 
191  // data
192  Uint4 m_set_State[1];
193  string m_Objaddr;
194  string m_Subtype;
195 };
196 
197 /* @} */
198 
199 
200 
201 
202 
203 ///////////////////////////////////////////////////////////
204 ///////////////////// inline methods //////////////////////
205 ///////////////////////////////////////////////////////////
206 inline
208 {
209  return ((m_set_State[0] & 0x3) != 0);
210 }
211 
212 inline
214 {
215  return IsSetObjaddr();
216 }
217 
218 inline
220 {
221  if (!CanGetObjaddr()) {
222  ThrowUnassigned(0);
223  }
224  return m_Objaddr;
225 }
226 
227 inline
229 {
230  m_Objaddr = value;
231  m_set_State[0] |= 0x3;
232 }
233 
234 inline
236 {
237  m_Objaddr = std::forward<CPluginObject_Base::TObjaddr>(value);
238  m_set_State[0] |= 0x3;
239 }
240 
241 inline
243 {
244 #ifdef _DEBUG
245  if (!IsSetObjaddr()) {
247  }
248 #endif
249  m_set_State[0] |= 0x1;
250  return m_Objaddr;
251 }
252 
253 inline
255 {
256  return ((m_set_State[0] & 0xc) != 0);
257 }
258 
259 inline
261 {
262  return IsSetSubtype();
263 }
264 
265 inline
267 {
268  if (!CanGetSubtype()) {
269  ThrowUnassigned(1);
270  }
271  return m_Subtype;
272 }
273 
274 inline
276 {
277  m_Subtype = value;
278  m_set_State[0] |= 0xc;
279 }
280 
281 inline
283 {
284  m_Subtype = std::forward<CPluginObject_Base::TSubtype>(value);
285  m_set_State[0] |= 0xc;
286 }
287 
288 inline
290 {
291 #ifdef _DEBUG
292  if (!IsSetSubtype()) {
294  }
295 #endif
296  m_set_State[0] |= 0x4;
297  return m_Subtype;
298 }
299 
300 ///////////////////////////////////////////////////////////
301 ////////////////// end of inline methods //////////////////
302 ///////////////////////////////////////////////////////////
303 
304 
305 
306 
307 
308 END_objects_SCOPE // namespace ncbi::objects::
309 
311 
312 
313 #endif // GUI_OBJECTS_PLUGINOBJECT_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
int GetSubtype(CFieldNamePanel *field_name_panel, string &ncRNA_class)
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_GUIOBJECTS_EXPORT
Definition: gui_export.h:511
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
CPluginObject_Base & operator=(const CPluginObject_Base &)
CSerialObject Tparent
const TObjaddr & GetObjaddr(void) const
Get the Objaddr member data.
bool CanGetObjaddr(void) const
Check if it is safe to call GetObjaddr method.
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
TObjaddr & SetObjaddr(void)
Assign a value to Objaddr data member.
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
bool IsSetObjaddr(void) const
Check if a value has been assigned to Objaddr data member.
CPluginObject_Base(const CPluginObject_Base &)
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool CanGetSubtype(void) const
Check if it is safe to call GetSubtype method.
Defines to provide correct exporting from DLLs in Windows.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon May 20 04:59:56 2024 by modify_doxy.py rev. 669887