NCBI C++ ToolKit
Field_edit_.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 Field_edit_.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/macro/macro.asn">macro.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/macro/macro.def">macro.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_MACRO_FIELD_EDIT_BASE_HPP
42 #define OBJECTS_MACRO_FIELD_EDIT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_Macro
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 ///
70 /// CField_edit_Base --
71 ///
72 
74 {
76 public:
77  // constructor
78  CField_edit_Base(void);
79  // destructor
80  virtual ~CField_edit_Base(void);
81 
82  // type info
84 
85  // types
86  typedef string TFind_txt;
87  typedef string TRepl_txt;
89  typedef bool TCase_insensitive;
90 
91  // member index
92  enum class E_memberIndex {
93  e__allMandatory = 0,
94  e_find_txt,
95  e_repl_txt,
96  e_location,
98  };
100 
101  // getters
102  // setters
103 
104  /// Check if a value has been assigned to Find_txt data member.
105  ///
106  /// Data member Find_txt is mandatory;
107  /// its type is defined as 'typedef string TFind_txt'
108  /// @return
109  /// - true, if a value has been assigned.
110  /// - false, otherwise.
111  bool IsSetFind_txt(void) const;
112 
113  /// Check if it is safe to call GetFind_txt method.
114  ///
115  /// @return
116  /// - true, if the data member is getatable.
117  /// - false, otherwise.
118  bool CanGetFind_txt(void) const;
119 
120  /// Reset Find_txt data member.
121  void ResetFind_txt(void);
122 
123  /// Get the Find_txt member data.
124  ///
125  /// @return
126  /// Reference to the member data.
127  const TFind_txt& GetFind_txt(void) const;
128 
129  /// Assign a value to Find_txt data member.
130  ///
131  /// @param value
132  /// Value to assign
133  void SetFind_txt(const TFind_txt& value);
134  void SetFind_txt(TFind_txt&& value);
135 
136  /// Assign a value to Find_txt data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TFind_txt& SetFind_txt(void);
141 
142  /// Check if a value has been assigned to Repl_txt data member.
143  ///
144  /// Data member Repl_txt is optional;
145  /// its type is defined as 'typedef string TRepl_txt'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetRepl_txt(void) const;
150 
151  /// Check if it is safe to call GetRepl_txt method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetRepl_txt(void) const;
157 
158  /// Reset Repl_txt data member.
159  void ResetRepl_txt(void);
160 
161  /// Get the Repl_txt member data.
162  ///
163  /// @return
164  /// Reference to the member data.
165  const TRepl_txt& GetRepl_txt(void) const;
166 
167  /// Assign a value to Repl_txt data member.
168  ///
169  /// @param value
170  /// Value to assign
171  void SetRepl_txt(const TRepl_txt& value);
172  void SetRepl_txt(TRepl_txt&& value);
173 
174  /// Assign a value to Repl_txt data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TRepl_txt& SetRepl_txt(void);
179 
180  /// Check if a value has been assigned to Location data member.
181  ///
182  /// Data member Location is optional with default eField_edit_location_anywhere;
183  /// its type is defined as 'typedef EField_edit_location TLocation'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetLocation(void) const;
188 
189  /// Check if it is safe to call GetLocation method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetLocation(void) const;
195 
196  /// Reset Location data member.
197  void ResetLocation(void);
198 
199  /// Assign default value to Location data member.
200  void SetDefaultLocation(void);
201 
202  /// Get the Location member data.
203  ///
204  /// @return
205  /// Copy of the member data.
206  TLocation GetLocation(void) const;
207 
208  /// Assign a value to Location data member.
209  ///
210  /// @param value
211  /// Value to assign
213 
214  /// Assign a value to Location data member.
215  ///
216  /// @return
217  /// Reference to the data value.
218  TLocation& SetLocation(void);
219 
220  /// Check if a value has been assigned to Case_insensitive data member.
221  ///
222  /// Data member Case_insensitive is optional with default false;
223  /// its type is defined as 'typedef bool TCase_insensitive'
224  /// @return
225  /// - true, if a value has been assigned.
226  /// - false, otherwise.
227  bool IsSetCase_insensitive(void) const;
228 
229  /// Check if it is safe to call GetCase_insensitive method.
230  ///
231  /// @return
232  /// - true, if the data member is getatable.
233  /// - false, otherwise.
234  bool CanGetCase_insensitive(void) const;
235 
236  /// Reset Case_insensitive data member.
237  void ResetCase_insensitive(void);
238 
239  /// Assign default value to Case_insensitive data member.
240  void SetDefaultCase_insensitive(void);
241 
242  /// Get the Case_insensitive member data.
243  ///
244  /// @return
245  /// Copy of the member data.
247 
248  /// Assign a value to Case_insensitive data member.
249  ///
250  /// @param value
251  /// Value to assign
253 
254  /// Assign a value to Case_insensitive data member.
255  ///
256  /// @return
257  /// Reference to the data value.
259 
260  /// Reset the whole object
261  virtual void Reset(void);
262 
263 
264 private:
265  // Prohibit copy constructor and assignment operator
268 
269  // data
271  string m_Find_txt;
272  string m_Repl_txt;
275 };
276 
277 /* @} */
278 
279 
280 
281 
282 
283 ///////////////////////////////////////////////////////////
284 ///////////////////// inline methods //////////////////////
285 ///////////////////////////////////////////////////////////
286 inline
288 {
289  return ((m_set_State[0] & 0x3) != 0);
290 }
291 
292 inline
294 {
295  return IsSetFind_txt();
296 }
297 
298 inline
300 {
301  if (!CanGetFind_txt()) {
302  ThrowUnassigned(0);
303  }
304  return m_Find_txt;
305 }
306 
307 inline
309 {
310  m_Find_txt = value;
311  m_set_State[0] |= 0x3;
312 }
313 
314 inline
316 {
317  m_Find_txt = std::forward<CField_edit_Base::TFind_txt>(value);
318  m_set_State[0] |= 0x3;
319 }
320 
321 inline
323 {
324 #ifdef _DEBUG
325  if (!IsSetFind_txt()) {
327  }
328 #endif
329  m_set_State[0] |= 0x1;
330  return m_Find_txt;
331 }
332 
333 inline
335 {
336  return ((m_set_State[0] & 0xc) != 0);
337 }
338 
339 inline
341 {
342  return IsSetRepl_txt();
343 }
344 
345 inline
347 {
348  if (!CanGetRepl_txt()) {
349  ThrowUnassigned(1);
350  }
351  return m_Repl_txt;
352 }
353 
354 inline
356 {
357  m_Repl_txt = value;
358  m_set_State[0] |= 0xc;
359 }
360 
361 inline
363 {
364  m_Repl_txt = std::forward<CField_edit_Base::TRepl_txt>(value);
365  m_set_State[0] |= 0xc;
366 }
367 
368 inline
370 {
371 #ifdef _DEBUG
372  if (!IsSetRepl_txt()) {
374  }
375 #endif
376  m_set_State[0] |= 0x4;
377  return m_Repl_txt;
378 }
379 
380 inline
382 {
383  return ((m_set_State[0] & 0x30) != 0);
384 }
385 
386 inline
388 {
389  return true;
390 }
391 
392 inline
394 {
396  m_set_State[0] &= ~0x30;
397 }
398 
399 inline
401 {
402  ResetLocation();
403 }
404 
405 inline
407 {
408  return m_Location;
409 }
410 
411 inline
413 {
414  m_Location = value;
415  m_set_State[0] |= 0x30;
416 }
417 
418 inline
420 {
421 #ifdef _DEBUG
422  if (!IsSetLocation()) {
423  memset(&m_Location,UnassignedByte(),sizeof(m_Location));
424  }
425 #endif
426  m_set_State[0] |= 0x10;
427  return m_Location;
428 }
429 
430 inline
432 {
433  return ((m_set_State[0] & 0xc0) != 0);
434 }
435 
436 inline
438 {
439  return true;
440 }
441 
442 inline
444 {
445  m_Case_insensitive = false;
446  m_set_State[0] &= ~0xc0;
447 }
448 
449 inline
451 {
453 }
454 
455 inline
457 {
458  return m_Case_insensitive;
459 }
460 
461 inline
463 {
465  m_set_State[0] |= 0xc0;
466 }
467 
468 inline
470 {
471 #ifdef _DEBUG
472  if (!IsSetCase_insensitive()) {
474  }
475 #endif
476  m_set_State[0] |= 0x40;
477  return m_Case_insensitive;
478 }
479 
480 ///////////////////////////////////////////////////////////
481 ////////////////// end of inline methods //////////////////
482 ///////////////////////////////////////////////////////////
483 
484 
485 
486 
487 
488 END_objects_SCOPE // namespace ncbi::objects::
489 
491 
492 
493 #endif // OBJECTS_MACRO_FIELD_EDIT_BASE_HPP
User-defined methods of the data storage class.
CField_edit_Base –.
Definition: Field_edit_.hpp:74
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
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
virtual void Reset(void)
Reset the whole object.
Definition: Field_edit_.cpp:62
TLocation & SetLocation(void)
Assign a value to Location data member.
bool CanGetCase_insensitive(void) const
Check if it is safe to call GetCase_insensitive method.
bool IsSetLocation(void) const
Check if a value has been assigned to Location data member.
TRepl_txt & SetRepl_txt(void)
Assign a value to Repl_txt data member.
bool IsSetCase_insensitive(void) const
Check if a value has been assigned to Case_insensitive data member.
EField_edit_location
Access to EField_edit_location's attributes (values, names) as defined in spec.
bool CanGetFind_txt(void) const
Check if it is safe to call GetFind_txt method.
void ResetRepl_txt(void)
Reset Repl_txt data member.
Definition: Field_edit_.cpp:56
Uint4 m_set_State[1]
void SetDefaultCase_insensitive(void)
Assign default value to Case_insensitive data member.
const TRepl_txt & GetRepl_txt(void) const
Get the Repl_txt member data.
CSerialObject Tparent
Definition: Field_edit_.hpp:75
bool IsSetFind_txt(void) const
Check if a value has been assigned to Find_txt data member.
void ResetFind_txt(void)
Reset Find_txt data member.
Definition: Field_edit_.cpp:50
virtual ~CField_edit_Base(void)
Definition: Field_edit_.cpp:91
const TFind_txt & GetFind_txt(void) const
Get the Find_txt member data.
CField_edit_Base & operator=(const CField_edit_Base &)
TCase_insensitive GetCase_insensitive(void) const
Get the Case_insensitive member data.
TLocation GetLocation(void) const
Get the Location member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Field_edit_.hpp:99
EField_edit_location m_Location
EField_edit_location TLocation
Definition: Field_edit_.hpp:88
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
bool CanGetRepl_txt(void) const
Check if it is safe to call GetRepl_txt method.
TFind_txt & SetFind_txt(void)
Assign a value to Find_txt data member.
TCase_insensitive & SetCase_insensitive(void)
Assign a value to Case_insensitive data member.
void ResetLocation(void)
Reset Location data member.
CField_edit_Base(const CField_edit_Base &)
void ResetCase_insensitive(void)
Reset Case_insensitive data member.
bool IsSetRepl_txt(void) const
Check if a value has been assigned to Repl_txt data member.
void SetDefaultLocation(void)
Assign default value to Location data member.
@ eField_edit_location_anywhere
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat Jun 08 14:24:31 2024 by modify_doxy.py rev. 669887