NCBI C++ ToolKit
Word_substitution_.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 Word_substitution_.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_WORD_SUBSTITUTION_BASE_HPP
42 #define OBJECTS_MACRO_WORD_SUBSTITUTION_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #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 /// CWord_substitution_Base --
71 ///
72 
74 {
76 public:
77  // constructor
79  // destructor
80  virtual ~CWord_substitution_Base(void);
81 
82  // type info
84 
85  // types
86  typedef string TWord;
87  typedef list< string > TSynonyms;
88  typedef bool TCase_sensitive;
89  typedef bool TWhole_word;
90 
91  // member index
92  enum class E_memberIndex {
93  e__allMandatory = 0,
94  e_word,
95  e_synonyms,
98  };
100 
101  // getters
102  // setters
103 
104  /// Check if a value has been assigned to Word data member.
105  ///
106  /// Data member Word is optional;
107  /// its type is defined as 'typedef string TWord'
108  /// @return
109  /// - true, if a value has been assigned.
110  /// - false, otherwise.
111  bool IsSetWord(void) const;
112 
113  /// Check if it is safe to call GetWord method.
114  ///
115  /// @return
116  /// - true, if the data member is getatable.
117  /// - false, otherwise.
118  bool CanGetWord(void) const;
119 
120  /// Reset Word data member.
121  void ResetWord(void);
122 
123  /// Get the Word member data.
124  ///
125  /// @return
126  /// Reference to the member data.
127  const TWord& GetWord(void) const;
128 
129  /// Assign a value to Word data member.
130  ///
131  /// @param value
132  /// Value to assign
133  void SetWord(const TWord& value);
134  void SetWord(TWord&& value);
135 
136  /// Assign a value to Word data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TWord& SetWord(void);
141 
142  /// Check if a value has been assigned to Synonyms data member.
143  ///
144  /// Data member Synonyms is optional;
145  /// its type is defined as 'typedef list< string > TSynonyms'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetSynonyms(void) const;
150 
151  /// Check if it is safe to call GetSynonyms method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetSynonyms(void) const;
157 
158  /// Reset Synonyms data member.
159  void ResetSynonyms(void);
160 
161  /// Get the Synonyms member data.
162  ///
163  /// @return
164  /// Reference to the member data.
165  const TSynonyms& GetSynonyms(void) const;
166 
167  /// Assign a value to Synonyms data member.
168  ///
169  /// @return
170  /// Reference to the data value.
171  TSynonyms& SetSynonyms(void);
172 
173  /// Check if a value has been assigned to Case_sensitive data member.
174  ///
175  /// Data member Case_sensitive is optional with default false;
176  /// its type is defined as 'typedef bool TCase_sensitive'
177  /// @return
178  /// - true, if a value has been assigned.
179  /// - false, otherwise.
180  bool IsSetCase_sensitive(void) const;
181 
182  /// Check if it is safe to call GetCase_sensitive method.
183  ///
184  /// @return
185  /// - true, if the data member is getatable.
186  /// - false, otherwise.
187  bool CanGetCase_sensitive(void) const;
188 
189  /// Reset Case_sensitive data member.
190  void ResetCase_sensitive(void);
191 
192  /// Assign default value to Case_sensitive data member.
193  void SetDefaultCase_sensitive(void);
194 
195  /// Get the Case_sensitive member data.
196  ///
197  /// @return
198  /// Copy of the member data.
200 
201  /// Assign a value to Case_sensitive data member.
202  ///
203  /// @param value
204  /// Value to assign
206 
207  /// Assign a value to Case_sensitive data member.
208  ///
209  /// @return
210  /// Reference to the data value.
212 
213  /// Check if a value has been assigned to Whole_word data member.
214  ///
215  /// Data member Whole_word is optional with default false;
216  /// its type is defined as 'typedef bool TWhole_word'
217  /// @return
218  /// - true, if a value has been assigned.
219  /// - false, otherwise.
220  bool IsSetWhole_word(void) const;
221 
222  /// Check if it is safe to call GetWhole_word method.
223  ///
224  /// @return
225  /// - true, if the data member is getatable.
226  /// - false, otherwise.
227  bool CanGetWhole_word(void) const;
228 
229  /// Reset Whole_word data member.
230  void ResetWhole_word(void);
231 
232  /// Assign default value to Whole_word data member.
233  void SetDefaultWhole_word(void);
234 
235  /// Get the Whole_word member data.
236  ///
237  /// @return
238  /// Copy of the member data.
239  TWhole_word GetWhole_word(void) const;
240 
241  /// Assign a value to Whole_word data member.
242  ///
243  /// @param value
244  /// Value to assign
246 
247  /// Assign a value to Whole_word data member.
248  ///
249  /// @return
250  /// Reference to the data value.
251  TWhole_word& SetWhole_word(void);
252 
253  /// Reset the whole object
254  virtual void Reset(void);
255 
256 
257 private:
258  // Prohibit copy constructor and assignment operator
261 
262  // data
264  string m_Word;
265  list< string > m_Synonyms;
268 };
269 
270 /* @} */
271 
272 
273 
274 
275 
276 ///////////////////////////////////////////////////////////
277 ///////////////////// inline methods //////////////////////
278 ///////////////////////////////////////////////////////////
279 inline
281 {
282  return ((m_set_State[0] & 0x3) != 0);
283 }
284 
285 inline
287 {
288  return IsSetWord();
289 }
290 
291 inline
293 {
294  if (!CanGetWord()) {
295  ThrowUnassigned(0);
296  }
297  return m_Word;
298 }
299 
300 inline
302 {
303  m_Word = value;
304  m_set_State[0] |= 0x3;
305 }
306 
307 inline
309 {
310  m_Word = std::forward<CWord_substitution_Base::TWord>(value);
311  m_set_State[0] |= 0x3;
312 }
313 
314 inline
316 {
317 #ifdef _DEBUG
318  if (!IsSetWord()) {
320  }
321 #endif
322  m_set_State[0] |= 0x1;
323  return m_Word;
324 }
325 
326 inline
328 {
329  return ((m_set_State[0] & 0xc) != 0);
330 }
331 
332 inline
334 {
335  return true;
336 }
337 
338 inline
340 {
341  return m_Synonyms;
342 }
343 
344 inline
346 {
347  m_set_State[0] |= 0x4;
348  return m_Synonyms;
349 }
350 
351 inline
353 {
354  return ((m_set_State[0] & 0x30) != 0);
355 }
356 
357 inline
359 {
360  return true;
361 }
362 
363 inline
365 {
366  m_Case_sensitive = false;
367  m_set_State[0] &= ~0x30;
368 }
369 
370 inline
372 {
374 }
375 
376 inline
378 {
379  return m_Case_sensitive;
380 }
381 
382 inline
384 {
386  m_set_State[0] |= 0x30;
387 }
388 
389 inline
391 {
392 #ifdef _DEBUG
393  if (!IsSetCase_sensitive()) {
395  }
396 #endif
397  m_set_State[0] |= 0x10;
398  return m_Case_sensitive;
399 }
400 
401 inline
403 {
404  return ((m_set_State[0] & 0xc0) != 0);
405 }
406 
407 inline
409 {
410  return true;
411 }
412 
413 inline
415 {
416  m_Whole_word = false;
417  m_set_State[0] &= ~0xc0;
418 }
419 
420 inline
422 {
423  ResetWhole_word();
424 }
425 
426 inline
428 {
429  return m_Whole_word;
430 }
431 
432 inline
434 {
436  m_set_State[0] |= 0xc0;
437 }
438 
439 inline
441 {
442 #ifdef _DEBUG
443  if (!IsSetWhole_word()) {
444  memset(&m_Whole_word,UnassignedByte(),sizeof(m_Whole_word));
445  }
446 #endif
447  m_set_State[0] |= 0x40;
448  return m_Whole_word;
449 }
450 
451 ///////////////////////////////////////////////////////////
452 ////////////////// end of inline methods //////////////////
453 ///////////////////////////////////////////////////////////
454 
455 
456 
457 
458 
459 END_objects_SCOPE // namespace ncbi::objects::
460 
462 
463 
464 #endif // OBJECTS_MACRO_WORD_SUBSTITUTION_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CWord_substitution_Base –.
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
bool CanGetCase_sensitive(void) const
Check if it is safe to call GetCase_sensitive method.
TWhole_word GetWhole_word(void) const
Get the Whole_word member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
virtual void Reset(void)
Reset the whole object.
void ResetWord(void)
Reset Word data member.
const TWord & GetWord(void) const
Get the Word member data.
bool IsSetSynonyms(void) const
Check if a value has been assigned to Synonyms data member.
TCase_sensitive & SetCase_sensitive(void)
Assign a value to Case_sensitive data member.
virtual ~CWord_substitution_Base(void)
const TSynonyms & GetSynonyms(void) const
Get the Synonyms member data.
void SetDefaultCase_sensitive(void)
Assign default value to Case_sensitive data member.
TSynonyms & SetSynonyms(void)
Assign a value to Synonyms data member.
bool IsSetWhole_word(void) const
Check if a value has been assigned to Whole_word data member.
bool CanGetSynonyms(void) const
Check if it is safe to call GetSynonyms method.
bool CanGetWord(void) const
Check if it is safe to call GetWord method.
void ResetWhole_word(void)
Reset Whole_word data member.
void SetDefaultWhole_word(void)
Assign default value to Whole_word data member.
void ResetSynonyms(void)
Reset Synonyms data member.
CWord_substitution_Base(const CWord_substitution_Base &)
bool CanGetWhole_word(void) const
Check if it is safe to call GetWhole_word method.
void ResetCase_sensitive(void)
Reset Case_sensitive data member.
TWord & SetWord(void)
Assign a value to Word data member.
CWord_substitution_Base & operator=(const CWord_substitution_Base &)
bool IsSetWord(void) const
Check if a value has been assigned to Word data member.
bool IsSetCase_sensitive(void) const
Check if a value has been assigned to Case_sensitive data member.
TCase_sensitive GetCase_sensitive(void) const
Get the Case_sensitive member data.
TWhole_word & SetWhole_word(void)
Assign a value to Whole_word data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Apr 17 13:08:38 2024 by modify_doxy.py rev. 669887