NCBI C++ ToolKit
Field_set_.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_set_.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/valid/valid.asn">valid.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/valid/valid.def">valid.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_VALID_FIELD_SET_BASE_HPP
42 #define OBJECTS_VALID_FIELD_SET_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // forward declarations
60 class CField_rule;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_Structured_comment_validation
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CField_set_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CField_set_Base(void);
82  // destructor
83  virtual ~CField_set_Base(void);
84 
85  // type info
87 
88  // types
89  typedef list< CRef< CField_rule > > Tdata;
90 
91  // getters
92  // setters
93 
94  /// Check if a value has been assigned to data member.
95  ///
96  /// Data member is mandatory;
97  /// its type is defined as 'typedef list< CRef< CField_rule > > Tdata'
98  /// @return
99  /// - true, if a value has been assigned.
100  /// - false, otherwise.
101  bool IsSet(void) const;
102 
103  /// Check if it is safe to call Get method.
104  ///
105  /// @return
106  /// - true, if the data member is getatable.
107  /// - false, otherwise.
108  bool CanGet(void) const;
109 
110  /// Reset data member.
111  void Reset(void);
112 
113  /// Get the member data.
114  ///
115  /// @return
116  /// Reference to the member data.
117  const Tdata& Get(void) const;
118 
119  /// Assign a value to data member.
120  ///
121  /// @return
122  /// Reference to the data value.
123  Tdata& Set(void);
124 
125  /// Conversion operator to 'const Tdata' type.
126  operator const Tdata& (void) const;
127  /// Conversion operator to 'Tdata' type.
128  operator Tdata& (void);
129 
130 
131 
132 private:
133  // Prohibit copy constructor and assignment operator
136 
137  // data
138  Uint4 m_set_State[1];
139  list< CRef< CField_rule > > m_data;
140 };
141 
142 /* @} */
143 
144 
145 
146 
147 
148 ///////////////////////////////////////////////////////////
149 ///////////////////// inline methods //////////////////////
150 ///////////////////////////////////////////////////////////
151 inline
152 bool CField_set_Base::IsSet(void) const
153 {
154  return ((m_set_State[0] & 0x3) != 0);
155 }
156 
157 inline
158 bool CField_set_Base::CanGet(void) const
159 {
160  return true;
161 }
162 
163 inline
165 {
166  return m_data;
167 }
168 
169 inline
171 {
172  m_set_State[0] |= 0x1;
173  return m_data;
174 }
175 
176 inline
177 CField_set_Base::operator const CField_set_Base::Tdata& (void) const
178 {
179  return m_data;
180 }
181 
182 inline
183 CField_set_Base::operator CField_set_Base::Tdata& (void)
184 {
185  m_set_State[0] |= 0x1;
186  return m_data;
187 }
188 
189 ///////////////////////////////////////////////////////////
190 ////////////////// end of inline methods //////////////////
191 ///////////////////////////////////////////////////////////
192 
193 
194 
195 
196 
197 END_objects_SCOPE // namespace ncbi::objects::
198 
200 
201 
202 #endif // OBJECTS_VALID_FIELD_SET_BASE_HPP
CField_set_Base –.
Definition: Field_set_.hpp:77
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_VALID_EXPORT
Definition: ncbi_export.h:929
CSerialObject Tparent
Definition: Field_set_.hpp:78
list< CRef< CField_rule > > Tdata
Definition: Field_set_.hpp:89
CField_set_Base & operator=(const CField_set_Base &)
bool IsSet(void) const
Check if a value has been assigned to data member.
Definition: Field_set_.hpp:152
Uint4 m_set_State[1]
Definition: Field_set_.hpp:138
bool CanGet(void) const
Check if it is safe to call Get method.
Definition: Field_set_.hpp:158
Tdata & Set(void)
Assign a value to data member.
Definition: Field_set_.hpp:170
const Tdata & Get(void) const
Get the member data.
Definition: Field_set_.hpp:164
list< CRef< CField_rule > > m_data
Definition: Field_set_.hpp:139
CField_set_Base(const CField_set_Base &)
const TYPE & Get(const CNamedParameterList *param)
Modified on Wed Apr 17 13:10:06 2024 by modify_doxy.py rev. 669887