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

Go to the SVN repository for this file.

1 /* $Id: GC_Replicon.cpp 56418 2012-11-29 20:08:33Z smithrg $
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  * 'genome_collection.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 
40 // generated includes
46 
47 // generated classes
48 
50 
51 BEGIN_objects_SCOPE // namespace ncbi::objects::
52 
53 // constructor
55  : m_Assembly(NULL)
56  , m_AssemblyUnit(NULL)
57 {
58 }
59 
60 // destructor
62 {
63 }
64 
65 
66 /// Access the assembly unit the sequence belongs to
68 {
70 }
71 
72 
73 /// Access the assembly the sequence belongs to
75 {
77 }
78 
79 static
81 {
82  const CGC_Sequence& seq = rep.GetSequence().GetSingle();
83  if (seq.IsSetDescr()) {
84  ITERATE(CSeq_descr::Tdata, dit, seq.GetDescr().Get()) {
85  if ((*dit)->IsUser()) {
86  const CUser_object& uo = (*dit)->GetUser();
87  if ( uo.GetType().IsStr() && uo.GetType().GetStr() == "molecule-location-type") {
88  return CConstRef<CUser_object>(&uo);
89  }
90  }
91  }
92  }
93  return CConstRef<CUser_object>();
94 }
95 
97 {
99  if (uo) {
100  return uo->GetField("location").GetData().GetStr();
101  }
102  return kEmptyStr;
103 }
104 
106 {
108  if (uo) {
109  return uo->GetField("type").GetData().GetStr();
110  }
111  return kEmptyStr;
112 }
113 
115 {
117  if (uo) {
118  return uo->GetField("label").GetData().GetStr();
119  }
120  return kEmptyStr;
121 }
122 
123 END_objects_SCOPE // namespace ncbi::objects::
124 
126 
127 /* Original file checksum: lines: 57, chars: 1758, CRC32: 4b99539e */
User-defined methods of the data storage class.
User-defined methods of the data storage class.
static CConstRef< CUser_object > x_GetMolLocTypeUserObj(const CGC_Replicon &rep)
Definition: GC_Replicon.cpp:80
User-defined methods of the data storage class.
CConstRef –.
Definition: ncbiobj.hpp:1266
CConstRef< CGC_AssemblyUnit > GetAssemblyUnit() const
Access the assembly unit the sequence belongs to.
Definition: GC_Replicon.cpp:67
CGC_Replicon(void)
Definition: GC_Replicon.cpp:54
string GetMoleculeLabel() const
CGC_AssemblyUnit * m_AssemblyUnit
Definition: GC_Replicon.hpp:78
~CGC_Replicon(void)
Definition: GC_Replicon.cpp:61
string GetMoleculeLocation() const
Definition: GC_Replicon.cpp:96
CConstRef< CGC_Assembly > GetFullAssembly() const
Access the most specific full assembly the replicon belongs to This is needed because assemblies are ...
Definition: GC_Replicon.cpp:74
string GetMoleculeType() const
CGC_Assembly * m_Assembly
Definition: GC_Replicon.hpp:77
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user object.
Definition: User_object.cpp:71
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
#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 kEmptyStr
Definition: ncbistr.hpp:123
const TStr & GetStr(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
const TData & GetData(void) const
Get the Data member data.
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
const TType & GetType(void) const
Get the Type member data.
const TDescr & GetDescr(void) const
Get the Descr member data.
bool IsSetDescr(void) const
Various attributes assigned at this level: biosrc, comments, publications...
const TSequence & GetSequence(void) const
Get the Sequence member data.
const TSingle & GetSingle(void) const
Get the variant data.
list< CRef< CSeqdesc > > Tdata
Definition: Seq_descr_.hpp:91
const Tdata & Get(void) const
Get the member data.
Definition: Seq_descr_.hpp:166
Modified on Thu Sep 21 03:41:54 2023 by modify_doxy.py rev. 669887