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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_TEXT___SEQ_TEXT_JOB__HPP
2 #define GUI_WIDGETS_SEQ_TEXT___SEQ_TEXT_JOB__HPP
3 
4 /* $Id: seq_text_job.hpp 26649 2012-10-18 20:31:07Z katargir $
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: Colleen Bollin, based on a file by Vlad Lebedev
30  *
31  * File Description:
32  * This file contains the class declaration for the CSeqTextJob class,
33  * which will be used to load and format data for the Sequence Text View widget
34  * in a background thread.
35  *
36  */
37 
38 
39 
40 #include <gui/gui.hpp>
41 #include <objmgr/scope.hpp>
42 #include <objmgr/bioseq_handle.hpp>
43 #include <objmgr/seq_vector.hpp>
44 #include <gui/gui_export.h>
45 
46 #include <gui/utils/app_job.hpp>
49 
51 
52 
53 class CSeqTextJobResult;
54 
55 /// CSeqTextJobResult
57 {
58 public:
59 
61  typedef vector<bool> TAvailableSubtypeVector;
62 
63  virtual ~CSeqTextJobResult() {};
64 
65  size_t size() { return m_AvailableSubtypes.size(); }
66 
67  objects::SAnnotSelector m_Sel;
68 
70 };
71 
72 
73 ///////////////////////////////////////////////////////////////////////////////
74 /// CSeqTextJob
75 // Job will load data from ObjectManager for a specific layer in the layout
76 //
78 {
79 public:
80  enum EJobTask { // Data loading tasks
81  eLoadFeatureTypesTask
82  };
83 
84  typedef EJobTask TJobTask;
85  typedef int TSelectorResolveDepth;
86 
87  CSeqTextJob (const objects::CSeq_loc& loc,
88  objects::CScope& scope,
89  TJobTask task);
90 
91  /// @name IAppJob implementation
92  /// @{
93  virtual EJobState Run();
94  virtual CConstIRef<IAppJobProgress> GetProgress();
95  virtual CRef<CObject> GetResult();
96  virtual CConstIRef<IAppJobError> GetError();
97  virtual string GetDescr() const;
98  /// @}
99 
100 protected:
101  // levels for data retrieval
102  void x_LoadFeatureTypes();
103 
104  const objects::CSeq_loc& m_Loc;
105  objects::CScope& m_Scope;
106  objects::SAnnotSelector m_Sel; // our selector
107  TJobTask m_TaskID; // what is this job for
108 
109  // for job results/status
113 
114 
115 };
116 
117 
118 
120 
121 #endif // GUI_WIDGETS_SEQ_TEXT___SEQ_TEXT_JOB__HPP
Base class to build jobs with cancel functionality.
CObject –.
Definition: ncbiobj.hpp:180
CSeqTextJobResult.
TAvailableSubtypeVector m_AvailableSubtypes
vector< bool > TAvailableSubtypeVector
objects::SAnnotSelector m_Sel
virtual ~CSeqTextJobResult()
CSeqTextJob.
CRef< CSeqTextJobResult > m_Result
objects::SAnnotSelector m_Sel
CRef< CAppJobProgress > m_Progress
TJobTask m_TaskID
int TSelectorResolveDepth
objects::CScope & m_Scope
const objects::CSeq_loc & m_Loc
EJobTask TJobTask
CRef< CAppJobError > m_Error
EJobState
Job states (describe FSM)
Definition: app_job.hpp:86
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
void Run(void)
Enter the main loop.
#define NCBI_GUIWIDGETS_SEQTEXT_EXPORT
Definition: gui_export.h:538
Defines to provide correct exporting from DLLs in Windows.
Modified on Mon Jun 17 05:05:20 2024 by modify_doxy.py rev. 669887