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

Go to the SVN repository for this file.

1 /* $Id: SeqTable_column_info.cpp 53717 2012-04-12 14:25:35Z vasilche $
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 the following specifications:
34  * 'seqtable.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 
40 // generated includes
42 #include <util/static_map.hpp>
43 
44 // generated classes
45 
47 
48 BEGIN_objects_SCOPE // namespace ncbi::objects::
49 
50 // destructor
52 {
53 }
54 
55 
57 static const TNameToIdPair s_NameToIdArr[] = {
68  { "location.fuzz.from.lim", CSeqTable_column_info::eField_id_location_fuzz_from_lim },
77  { "product.fuzz.from.lim", CSeqTable_column_info::eField_id_product_fuzz_from_lim },
87 };
88 
90 
92 
93 static const char* s_Field_id_names[] = {
94  "location",
95  "location.id",
96  "location.gi",
97  "location.from",
98  "location.to",
99  "location.strand",
100  "location.fuzz.from.lim",
101  "location.fuzz.to.lim",
102  "",
103  "",
104  "product",
105  "product.id",
106  "product.gi",
107  "product.from",
108  "product.to",
109  "product.strand",
110  "product.fuzz.from.lim",
111  "product.fuzz.to.lim",
112  "",
113  "",
114  "id.local",
115  "xref.id.local",
116  "partial",
117  "comment",
118  "title",
119  "", // ext, field-name must be "E.xxx"
120  "", // qual, field-name must be "Q.xxx"
121  "", // dbxref, field-name must be "D.xxx"
122  "",
123  "",
124  "data.imp.key",
125  "data.region",
126  "data.cdregion.frame",
127  "",
128  "",
129  "",
130  "",
131  "",
132  "",
133  "",
134  "ext.type",
135  "qual.qual",
136  "qual.val",
137  "dbxref.db",
138  "dbxref.tag"
139 };
140 
141 
142 int CSeqTable_column_info::GetIdForName(const string& name)
143 {
144  TNameToIdMap::const_iterator iter = s_NameToIdMap.find(name.c_str());
145  return iter == s_NameToIdMap.end()? -1: iter->second;
146 }
147 
148 
150 {
151  size_t index = id;
152  if ( index < sizeof(s_Field_id_names)/sizeof(s_Field_id_names[0]) ) {
153  return s_Field_id_names[index];
154  }
155  return "";
156 }
157 
158 
159 END_objects_SCOPE // namespace ncbi::objects::
160 
static const char * s_Field_id_names[]
SStaticPair< const char *, CSeqTable_column_info::EField_id > TNameToIdPair
static const TNameToIdPair s_NameToIdArr[]
DEFINE_STATIC_ARRAY_MAP(TNameToIdMap, s_NameToIdMap, s_NameToIdArr)
CStaticPairArrayMap< const char *, CSeqTable_column_info::EField_id, PCase_CStr > TNameToIdMap
User-defined methods of the data storage class.
static const char * GetNameForId(int id)
static int GetIdForName(const string &name)
class CStaticArrayMap<> is an array adaptor that provides an STLish interface to statically-defined a...
Definition: static_map.hpp:105
TBase::const_iterator const_iterator
Definition: static_map.hpp:109
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
@ eField_id_location
location as Seq-loc
@ eField_id_location_strand
location strand
@ eField_id_id_local
main feature fields id.local.id
@ eField_id_ext_type
extra fields, see also special values for str below
@ eField_id_product_to
product interval to
@ eField_id_product
product as Seq-loc
@ eField_id_data_imp_key
various data fields
@ eField_id_product_from
product interval from
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
Definition: static_set.hpp:60
Modified on Wed Apr 17 13:08:15 2024 by modify_doxy.py rev. 669887