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

Go to the SVN repository for this file.

1 /* $Id: 5col_annot_assembler.cpp 86362 2019-05-02 15:04:11Z ludwigf $
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: Frank Ludwig
27  *
28  * File Description: Iterate through file names matching a given glob pattern
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 #include <corelib/ncbifile.hpp>
35 
42 
44 #include "featid_generator.hpp"
45 #include "5col_annot_assembler.hpp"
46 #include "5col_import_data.hpp"
47 
48 #include <assert.h>
49 
52 
53 // ============================================================================
55  CImportMessageHandler& errorReporter):
56 // ============================================================================
57  CFeatAnnotAssembler(errorReporter)
58 {
60 }
61 
62 // ============================================================================
64 // ============================================================================
65 {
66 }
67 
68 // ============================================================================
69 void
71  const CFeatImportData& record_,
72  CSeq_annot& annot)
73 // ============================================================================
74 {
75  assert(dynamic_cast<const C5ColImportData*>(&record_));
76  const C5ColImportData& record = static_cast<const C5ColImportData&>(record_);
77  const CSeq_feat& feature = record.GetFeature();
78  auto featSubtype = feature.GetData().GetSubtype();
79  if (featSubtype == CSeq_feat::TData::eSubtype_bad) {
80  return;
81  }
82  CRef<CSeq_feat> pNewFeature(new CSeq_feat);
83  pNewFeature->Assign(feature);
84  annot.SetData().SetFtable().push_back(pNewFeature);
85 }
USING_SCOPE(objects)
User-defined methods of the data storage class.
void ProcessRecord(const CFeatImportData &, CSeq_annot &) override
unique_ptr< CFeatureIdGenerator > mpIdGenerator
C5ColAnnotAssembler(CImportMessageHandler &)
const CSeq_feat & GetFeature() const
ESubtype GetSubtype(void) const
@ eSubtype_bad
These no longer need to match the FEATDEF values in the C toolkit's objfdef.h.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
#define assert(x)
Definition: srv_diag.hpp:58
Modified on Wed Apr 17 13:08:52 2024 by modify_doxy.py rev. 669887