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

Go to the SVN repository for this file.

1 /* $Id: table_data_seq_annot.cpp 36071 2016-08-03 18:14:45Z katargir $
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  * Authors: Roman Katargin
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
37 
39 
40 #include "table_data_ftable.hpp"
41 #include "table_data_seq_table.hpp"
42 
43 
45 
48 
49 class CTableDataSeq_annot : public CObject, public ITableData
50 {
51 public:
52  static CObject* CreateObject(SConstScopedObject& object, ICreateParams* params);
53 
54  virtual ColumnType GetColumnType(size_t col) const { return kNone; }
55  virtual string GetColumnLabel(size_t col) const { return ""; }
56 
57  virtual size_t GetRowsCount() const { return 0; }
58  virtual size_t GetColsCount() const { return 0; }
59 };
60 
62 {
64  typeid(ITableData).name(),
65  CSeq_annot::GetTypeInfo(),
67 }
68 
70 {
71  const CSeq_annot& seq_annot = dynamic_cast<const CSeq_annot&>(*object.object);
72  if (seq_annot.IsFtable()) {
73  return CTableDataFTable::CreateObject(object, params);
74  }
75  else if (seq_annot.IsSeq_table()) {
76  const CSeq_table& seq_table = seq_annot.GetData().GetSeq_table();
77  SConstScopedObject new_object;
78  new_object.object = CConstRef<CObject>(&seq_table);
79  new_object.scope = object.scope;
80  return CTableDataSeq_table::CreateObject(new_object, params);
81  }
82  else if (seq_annot.IsAlign()) {
84  objects.push_back(object);
85  return new CTableDataAlnSummary(objects);
86  }
87  return NULL;
88 }
89 
User-defined methods of the data storage class.
static void RegisterFactory(const string &interface_name, IInterfaceFactory *factory)
CObject –.
Definition: ncbiobj.hpp:180
bool IsAlign(void) const
Definition: Seq_annot.cpp:182
bool IsSeq_table(void) const
Definition: Seq_annot.cpp:202
bool IsFtable(void) const
Definition: Seq_annot.cpp:177
virtual ColumnType GetColumnType(size_t col) const
static CObject * CreateObject(SConstScopedObject &object, ICreateParams *params)
virtual size_t GetRowsCount() const
virtual size_t GetColsCount() const
virtual string GetColumnLabel(size_t col) const
#define NULL
Definition: ncbistd.hpp:225
CRef< objects::CScope > scope
Definition: objects.hpp:53
static CTableDataFTable * CreateObject(SConstScopedObject &object, ICreateParams *params)
static CTableDataSeq_table * CreateObject(SConstScopedObject &object, ICreateParams *params)
CConstRef< CObject > object
Definition: objects.hpp:52
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const TSeq_table & GetSeq_table(void) const
Get the variant data.
Definition: Seq_annot_.cpp:153
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_annot_.hpp:873
USING_SCOPE(objects)
void initCTableDataSeq_annot()
Modified on Tue Jul 16 13:23:23 2024 by modify_doxy.py rev. 669887