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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ___FLATFILE_SEQUENCE_LIST_JOB__HPP
2 #define GUI_WIDGETS_SEQ___FLATFILE_SEQUENCE_LIST_JOB__HPP
3 
4 /* $Id: flat_file_sequence_list_job.hpp 44629 2020-02-10 18:30:10Z 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: Roman Katargin
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbiobj.hpp>
36 #include <corelib/ncbimtx.hpp>
37 
39 
44 
46 
48 
50  class CSeq_loc;
51  class CSubmit_block;
53 
55 {
56 public:
57  CTextViewSequenceListResult(const vector<CFlatFileSeq>& sequenceList)
58  : m_SequenceList(sequenceList) {}
59 
61 
62  const vector<CFlatFileSeq>& GetData()
63  {
64  return m_SequenceList;
65  }
66 
67 private:
70 
71  vector<CFlatFileSeq> m_SequenceList;
72 };
73 
74 
76 {
77 public:
79  objects::CSeq_entry_Handle& h,
80  const objects::CSubmit_block* submitBlock,
81  const objects::CSeq_loc* seq_loc,
82  objects::CFlatFileConfig::EStyle style);
83 
84  virtual ~CFlatFileSequenceListJob();
85 
86  /// @name IAppJob implementation
87  /// @{
88  virtual EJobState Run();
90  virtual CRef<CObject> GetResult();
92  /// @}
93 
94 
95  /// @name IAppJob implementation
96  /// @{
97  virtual string GetDescr() const { return "Retrieve list of sequences for text view"; }
98  /// @}
99 
100 private:
101  virtual string x_GetJobName() const { return "FlatFileSequenceListJob"; }
102  EJobState x_Run();
103 
104  objects::CFlatFileConfig m_Config;
106 
107  vector<CFlatFileSeq> m_Seqs;
108 
109  // for job results/status
112 
114  {
115  };
116 
117  class CFlatFileSeqBuilder : public objects::CFlatItemOStream
118  {
119  public:
120  CFlatFileSeqBuilder(vector<CFlatFileSeq>& seqs, ICanceled& canceled)
121  : m_Seqs(seqs), m_Canceled(canceled) {}
123 
124  private:
125  virtual void AddItem(CConstRef<objects::IFlatItem> item);
126 
127  vector<CFlatFileSeq>& m_Seqs;
129  };
130 };
131 
133 
134 #endif // GUI_WIDGETS_SEQ___FLATFILE_SEQUENCE_LIST_JOB__HPP
CFlatFileSeqBuilder(vector< CFlatFileSeq > &seqs, ICanceled &canceled)
virtual void AddItem(CConstRef< objects::IFlatItem > item)
virtual EJobState Run()
Function that does all the useful work, called by the Engine.
CFlatFileSequenceListJob(objects::CSeq_entry_Handle &h, const objects::CSubmit_block *submitBlock, const objects::CSeq_loc *seq_loc, objects::CFlatFileConfig::EStyle style)
CRef< objects::CFlatFileContext > m_Context
virtual string GetDescr() const
Returns a human readable description of the Job (optional)
virtual CConstIRef< IAppJobError > GetError()
Returns IAppJobError object describing internal error that caused the Job to fail.
virtual CConstIRef< IAppJobProgress > GetProgress()
return progress object, the function shall be synchronized internally.
virtual CRef< CObject > GetResult()
Returns the Job Result.
CRef< CTextViewSequenceListResult > m_Result
Base class to build jobs with cancel functionality.
CObject –.
Definition: ncbiobj.hpp:180
CSubmit_block –.
CTextViewSequenceListResult(const vector< CFlatFileSeq > &sequenceList)
CTextViewSequenceListResult & operator=(const CTextViewSequenceListResult &)
CTextViewSequenceListResult(const CTextViewSequenceListResult &)
const vector< CFlatFileSeq > & GetData()
Interface for testing cancellation request in a long lasting operation.
Definition: icanceled.hpp:51
EJobState
Job states (describe FSM)
Definition: app_job.hpp:86
#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
Multi-threading – mutexes; rw-locks; semaphore.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Fri Sep 20 14:57:32 2024 by modify_doxy.py rev. 669887