NCBI C++ ToolKit
primary_edit.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_UTILS___PRIMARY_EDIT__HPP
2 #define GUI_UTILS___PRIMARY_EDIT__HPP
3 
4 /* $Id: primary_edit.hpp 47106 2022-08-09 13:30:47Z asztalos $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Igor Filippov
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbiobj.hpp>
37 #include <objmgr/bioseq_handle.hpp>
38 #include <objmgr/seqdesc_ci.hpp>
39 
40 
43 
44 // This object is intended to be created on the fly
45 // Not related to any other bio object
46 // But it can be used by Seqdesc editor for initialization and
47 // after modification applied to CBioseq_Handle.
48 
49 class CPrimaryEdit : public CSeqdesc
50 {
51 public:
52  CPrimaryEdit(CBioseq_Handle& bh) : m_BH(bh)
53  {
54  for ( CSeqdesc_CI desc(m_BH, CSeqdesc::e_User); desc; ++desc )
55  {
56  const CUser_object& o = desc->GetUser();
57  if ( o.IsSetType() && o.GetType().IsStr() && o.GetType().GetStr() == "TpaAssembly")
58  {
59  SetUser(const_cast<CUser_object&>(desc->GetUser()));
60  break;
61  }
62  }
63  }
64 
65 
66  CBioseq_Handle GetBioseq_Handle() const { return m_BH; }
67 
68 protected:
70 };
71 
74 
75 #endif // GUI_UTILS___PRIMARY_EDIT__HPP
CBioseq_Handle –.
CPrimaryEdit(CBioseq_Handle &bh)
CBioseq_Handle m_BH
CBioseq_Handle GetBioseq_Handle() const
CSeqdesc_CI –.
Definition: seqdesc_ci.hpp:65
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
const TType & GetType(void) const
Get the Type member data.
@ e_User
user defined object
Definition: Seqdesc_.hpp:124
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Fri Sep 20 14:57:53 2024 by modify_doxy.py rev. 669887