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

Go to the SVN repository for this file.

1 /* $Id: field_handler.hpp 95059 2021-10-02 09:47:34Z stakhovv $
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: Colleen Bollin
27  */
28 
29 
30 #ifndef _FIELD_HANDLER_H_
31 #define _FIELD_HANDLER_H_
32 
33 #include <corelib/ncbistd.hpp>
34 
35 #include <objmgr/scope.hpp>
36 
37 #include <objmgr/scope.hpp>
38 #include <objmgr/bioseq_handle.hpp>
39 #include <objects/seq/Seqdesc.hpp>
41 
44 
46 
49 
50 
52 {
53 public:
54  virtual vector<CConstRef<CObject>> GetObjects(CBioseq_Handle bsh) = 0;
55  virtual vector<CConstRef<CObject>> GetObjects(CSeq_entry_Handle seh,
56  const string& constraint_field,
57  CRef<CStringConstraint> string_constraint) = 0;
58  virtual vector<CRef<CApplyObject>> GetApplyObjects(CBioseq_Handle bsh) = 0;
59  virtual string GetVal(const CObject& object) = 0;
60  virtual vector<string> GetVals(const CObject& object) = 0;
61  virtual bool IsEmpty(const CObject& object) const = 0;
62  virtual void ClearVal(CObject& object) = 0;
63  virtual bool SetVal(CObject& object, const string& val, EExistingText existing_text) = 0;
64  virtual string IsValid(const string& /*value*/) { return string(); }
65  virtual vector<string> IsValid(const vector<string>& /*values*/) { return vector<string>(); }
68  virtual void SetConstraint(const string& field, CConstRef<CStringConstraint> string_constraint) = 0;
69  virtual bool AllowMultipleValues() = 0;
70  virtual vector<CConstRef<CObject>> GetRelatedObjects(const CObject& object, CRef<CScope> scope) = 0;
71  virtual vector<CConstRef<CObject>> GetRelatedObjects(const CApplyObject& object) = 0;
72  virtual vector<CRef<CApplyObject>> GetRelatedApplyObjects(const CObject& object, CRef<CScope> scope);
73  static bool QualifierNamesAreEquivalent(string name1, string name2);
74  static vector<CRef<CApplyObject>> GetApplyObjectsFromRelatedObjects(vector<CConstRef<CObject>>, CRef<CScope> scope);
75 };
76 
77 
79 {
80 public:
81  static CRef<CFieldHandler> Create(const string &field_name);
82  static bool s_IsSequenceIDField(const string& field);
83 };
84 
85 
86 NCBI_XOBJEDIT_EXPORT bool DoesObjectMatchFieldConstraint (const CObject& object, const string& field_name, CRef<CStringConstraint> string_constraint, CRef<CScope> scope);
87 NCBI_XOBJEDIT_EXPORT bool DoesApplyObjectMatchFieldConstraint (const CApplyObject& object, const string& field_name, CRef<CStringConstraint> string_constraint);
88 NCBI_XOBJEDIT_EXPORT vector<CConstRef<CSeq_feat> > GetRelatedFeatures(const CSeq_feat& obj_feat, CSeqFeatData::ESubtype constraint_type, CRef<CScope> scope);
89 
90 static const string kFieldTypeSeqId = "SeqId";
91 const string kDefinitionLineLabel = "Definition Line";
92 const string kCommentDescriptorLabel = "Comment Descriptor";
93 const string kGenbankBlockKeyword = "Keyword";
94 
98 
99 #endif
100 
CBioseq_Handle –.
CConstRef –.
Definition: ncbiobj.hpp:1266
static CRef< CFieldHandler > Create(const string &field_name)
virtual vector< CConstRef< CObject > > GetRelatedObjects(const CObject &object, CRef< CScope > scope)=0
virtual void SetConstraint(const string &field, CConstRef< CStringConstraint > string_constraint)=0
virtual CSeqFeatData::ESubtype GetFeatureSubtype()=0
virtual bool IsEmpty(const CObject &object) const =0
virtual vector< CConstRef< CObject > > GetRelatedObjects(const CApplyObject &object)=0
virtual CSeqdesc::E_Choice GetDescriptorSubtype()=0
virtual vector< string > IsValid(const vector< string > &)
virtual vector< CRef< CApplyObject > > GetApplyObjects(CBioseq_Handle bsh)=0
virtual void ClearVal(CObject &object)=0
virtual vector< CConstRef< CObject > > GetObjects(CSeq_entry_Handle seh, const string &constraint_field, CRef< CStringConstraint > string_constraint)=0
virtual vector< CConstRef< CObject > > GetObjects(CBioseq_Handle bsh)=0
virtual string GetVal(const CObject &object)=0
virtual bool SetVal(CObject &object, const string &val, EExistingText existing_text)=0
virtual bool AllowMultipleValues()=0
virtual vector< string > GetVals(const CObject &object)=0
virtual string IsValid(const string &)
CObject –.
Definition: ncbiobj.hpp:180
CSeq_entry_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Include a standard set of the NCBI C++ Toolkit most basic headers.
string
Definition: cgiapp.hpp:687
#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
#define NCBI_XOBJEDIT_EXPORT
Definition: ncbi_export.h:1291
E_Choice
Choice variants.
Definition: Seqdesc_.hpp:109
Definition: fix_pub.hpp:45
const string kDefinitionLineLabel
bool DoesApplyObjectMatchFieldConstraint(const CApplyObject &object, const string &field_name, CRef< CStringConstraint > string_constraint)
vector< CConstRef< CSeq_feat > > GetRelatedFeatures(const CSeq_feat &obj_feat, CSeqFeatData::ESubtype constraint_type, CRef< CScope > scope)
bool DoesObjectMatchFieldConstraint(const CObject &object, const string &field_name, CRef< CStringConstraint > string_constraint, CRef< CScope > scope)
const string kGenbankBlockKeyword
const string kCommentDescriptorLabel
static const string kFieldTypeSeqId
bool QualifierNamesAreEquivalent(string name1, string name2)
EExistingText
Modified on Fri Apr 12 17:15:46 2024 by modify_doxy.py rev. 669887