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

Go to the SVN repository for this file.

1 /* $Id: Blast4_parameters.cpp 37078 2008-03-03 15:03:30Z camacho $
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: Irena Zaretskaya
27  *
28  * File Description:
29  * Blast4_parameteres helper functions
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using the following specifications:
34  * 'blast.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 
40 // generated includes
42 
43 // generated classes
44 
46 
47 BEGIN_objects_SCOPE // namespace ncbi::objects::
48 
49 // destructor
51 {
52 }
53 
55 {
57  p = GetParamByName(name);
58  if(p.Empty()) {
59  p.Reset(new CBlast4_parameter);
61  v->SetInteger(value);
62  p->SetName(name);
63  p->SetValue(*v);
64  this->Set().push_back(p);
65  }
66  else {
67  p->SetValue().SetInteger(value);
68  }
69  return p;
70 }
71 
72 
73 CRef< CBlast4_parameter> CBlast4_parameters::Add(const string name,const string &value)
74 {
76  p = GetParamByName(name);
77  if(p.Empty()) {
78  p.Reset(new CBlast4_parameter);
80  v->SetString(value);
81  p->SetName(name);
82  p->SetValue(*v);
83  this->Set().push_back(p);
84  }
85  else {
86  p->SetValue().SetString(value);
87  }
88  return p;
89 }
90 
91 
92 
94 {
96  p = GetParamByName(name);
97  if(p.Empty()) {
100  v->SetBoolean(value);
101  param->SetName(name);
102  param->SetValue(*v);
103  this->Set().push_back(param);
104  }
105  else {
106  p->SetValue().SetBoolean(value);
107  }
108  return p;
109 }
110 
111 CRef< CBlast4_parameter> CBlast4_parameters::Add(const string name,const double &value)
112 {
114  p = GetParamByName(name);
115  if(p.Empty()) {
118  v->SetReal(value);
119  param->SetName(name);
120  param->SetValue(*v);
121  this->Set().push_back(param);
122  }
123  else {
124  p->SetValue().SetReal(value);
125  }
126  return p;
127 }
128 
129 
131 {
133  p = GetParamByName(name);
134  if(p.Empty()) {
137  v->SetBig_integer(value);
138  param->SetName(name);
139  param->SetValue(*v);
140  this->Set().push_back(param);
141  }
142  else {
143  p->SetValue().SetBig_integer(value);
144  }
145  return p;
146 }
147 
149 {
151  p = GetParamByName(name);
152  if(p.Empty()) {
155  v->SetStrand_type(value);
156  param->SetName(name);
157  param->SetValue(*v);
158  this->Set().push_back(param);
159  }
160  else {
161  p->SetValue().SetStrand_type(value);
162  }
163  return p;
164 }
165 
167 {
169  p = GetParamByName(name);
170  if(p.Empty()) {
171  p.Reset(new CBlast4_parameter);
174  p->SetName(name);
175  p->SetValue(*v);
176  this->Set().push_back(p);
177  }
178  else {
179  p->SetValue().SetCutoff((CBlast4_cutoff &)value);
180  }
181  return p;
182 }
183 
184 
185 
187 CBlast4_parameters::GetParamByName(const string name) const
188 {
189  CRef <CBlast4_parameter> blast4ParamFound;
190 
191  ITERATE(Tdata,it,this->Get()) {
192  if((*it)->GetName() == name) {
193  blast4ParamFound = (*it);
194  break;
195  }
196  }
197  return blast4ParamFound;
198 }
199 
200 END_objects_SCOPE // namespace ncbi::objects::
201 
203 
204 /* Original file checksum: lines: 65, chars: 1911, CRC32: c0649b03 */
User-defined methods of the data storage class.
CBlast4_cutoff –.
CBlast4_parameter –.
CRef< CBlast4_parameter > GetParamByName(const string name) const
Returns Blast4_parameter with specified name.
~CBlast4_parameters(void)
destructor
CRef< CBlast4_parameter > Add(const string name, const int &value)
Append Blast4_parameter.
CBlast4_value –.
CRef –.
Definition: ncbiobj.hpp:618
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
Definition: ncbiobj.hpp:719
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
TBig_integer & SetBig_integer(void)
Select the variant.
TReal & SetReal(void)
Select the variant.
TStrand_type & SetStrand_type(void)
Select the variant.
Tdata & Set(void)
Assign a value to data member.
const Tdata & Get(void) const
Get the member data.
TCutoff & SetCutoff(void)
Select the variant.
TBoolean & SetBoolean(void)
Select the variant.
list< CRef< CBlast4_parameter > > Tdata
TString & SetString(void)
Select the variant.
EBlast4_strand_type
Access to EBlast4_strand_type's attributes (values, names) as defined in spec.
TInteger & SetInteger(void)
Select the variant.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:28 2024 by modify_doxy.py rev. 669887