NCBI C++ ToolKit
PluginValueConstraint.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: PluginValueConstraint.cpp 14666 2007-07-09 13:40:22Z dicuccio $
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  * Author: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the data definition file
34  * 'plugin.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
40 
41 // generated includes
44 
45 // generated classes
46 
48 
49 BEGIN_objects_SCOPE // namespace ncbi::objects::
50 
51 // destructor
53 {
54 }
55 
56 
57 // static creators
60 {
62  con->SetLower(low_val);
63  return con.Release();
64 }
65 
66 
69 {
71  con->SetUpper(hi_val);
72  return con.Release();
73 }
74 
75 
78  const string& hi_val)
79 {
81  con->SetRange().SetLower(low_val);
82  con->SetRange().SetUpper(hi_val);
83  return con.Release();
84 }
85 
86 
89 {
91  con->SetSet();
92  return con.Release();
93 }
94 
95 
98 {
100  con->SetSeq_repr();
101  return con.Release();
102 }
103 
104 
107 {
109  con->SetSeq_mol();
110  return con.Release();
111 }
112 
113 
116 {
118  con->SetSeq_mol_same_type();
119  return con.Release();
120 }
121 
122 
125 {
127  con->SetSeq_length_lower(min_len);
128  return con.Release();
129 }
130 
131 
134 {
136  con->SetSeq_length_upper(max_len);
137  return con.Release();
138 }
139 
140 
143 {
145  CPluginValueRangeConstraint& range = con->SetSeq_length_range();
146  range.SetLower(NStr::IntToString(min_len));
147  range.SetUpper(NStr::IntToString(max_len));
148  return con.Release();
149 }
150 
151 
154 {
156  con->SetAnnot_type(type);
157  return con.Release();
158 }
159 
160 
163 {
165  con->SetFeat_type();
166  return con.Release();
167 }
168 
169 
172 {
174  con->SetFeat_subtype();
175  return con.Release();
176 }
177 
178 
181 {
183  con->SetFeat_has_product();
184  return con.Release();
185 }
186 
187 
190 {
192  con->SetProject_item_type(info->GetName());
193  return con.Release();
194 }
195 
196 
197 //
198 // operator, for adding values
199 //
201 {
202  if (Which() != e_Set) {
203  NCBI_THROW(CPluginException, eInvalidArg,
204  "CPluginValueConstraint::operator,() is only valid for "
205  "set constraints");
206  }
207 
208  SetSet().push_back(val);
209  return *this;
210 }
211 
212 
213 //
214 // operator, for adding values to non-set types
215 //
217 {
218  switch (Which()) {
219  case e_Seq_mol:
220  SetSeq_mol().push_back(val);
221  return *this;
222 
223  case e_Seq_repr:
224  SetSeq_repr().push_back(val);
225  return *this;
226 
227  case e_Feat_type:
228  SetFeat_type().push_back(val);
229  return *this;
230 
231  case e_Feat_subtype:
232  SetFeat_subtype().push_back(val);
233  return *this;
234 
235  default:
236  NCBI_THROW(CPluginException, eInvalidArg,
237  "CPluginValueConstraint::operator,(int): "
238  "inavlid constraint type");
239  }
240 }
241 
242 
243 END_objects_SCOPE // namespace ncbi::objects::
244 
246 
247 /* Original file checksum: lines: 64, chars: 1912, CRC32: ba941e07 */
User-defined methods of the data storage class.
static CPluginValueConstraint * CreateUpper(const string &hi_val)
static CPluginValueConstraint * CreateFeatProduct()
static CPluginValueConstraint * CreateSet(void)
static CPluginValueConstraint * CreateRange(const string &low_val, const string &hi_val)
static CPluginValueConstraint * CreateProjectItemType(const CTypeInfo *info)
static CPluginValueConstraint * CreateFeatSubtype()
static CPluginValueConstraint * CreateAnnotType(CSeq_annot::TData::E_Choice)
static CPluginValueConstraint * CreateSeqMol()
static CPluginValueConstraint * CreateSeqLenRange(TSeqPos min_len, TSeqPos max_len)
CPluginValueConstraint & operator,(const string &val)
static CPluginValueConstraint * CreateSeqLenLower(TSeqPos min_len)
static CPluginValueConstraint * CreateSeqRepr()
static CPluginValueConstraint * CreateSeqSameMol(void)
static CPluginValueConstraint * CreateLower(const string &low_val)
static CPluginValueConstraint * CreateFeatType()
static CPluginValueConstraint * CreateSeqLenUpper(TSeqPos max_len)
CRef –.
Definition: ncbiobj.hpp:618
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Definition: typeinfo.hpp:76
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
Definition: ncbiobj.hpp:846
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
TFeat_subtype & SetFeat_subtype(void)
Select the variant.
TSet & SetSet(void)
Select the variant.
TSeq_repr & SetSeq_repr(void)
Select the variant.
TFeat_type & SetFeat_type(void)
Select the variant.
E_Choice Which(void) const
Which variant is currently selected.
TSeq_mol & SetSeq_mol(void)
Select the variant.
E_Choice
Choice variants.
Definition: Seq_annot_.hpp:131
static MDB_envinfo info
Definition: mdb_load.c:37
range(_Ty, _Ty) -> range< _Ty >
Definition: type.c:6
Modified on Thu Mar 28 17:13:04 2024 by modify_doxy.py rev. 669887