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

Go to the SVN repository for this file.

1 #ifndef PKG_ALIGNMENT___BLAST_SEARCH_TASK__HPP
2 #define PKG_ALIGNMENT___BLAST_SEARCH_TASK__HPP
3 
4 /* $Id: blast_search_task.hpp 30782 2014-07-23 19:31:13Z 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: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistl.hpp>
36 #include <corelib/ncbiobj.hpp>
37 
38 #include <gui/gui_export.h>
39 
41 
44 
45 
47 
48 /** @addtogroup GUI_PKG_ALIGNMENT
49  *
50  * @{
51  */
52 
53 class CProjectService;
54 
55 ///////////////////////////////////////////////////////////////////////////////
56 /// TODO
58 {
59 public:
60  typedef vector< CRef<CNetBlastJobDescriptor> > TDescriptors;
61 
62  CBlastSearchTask(IServiceLocator* srv_locator,
64  const string& tool_name);
65  virtual ~CBlastSearchTask();
66 
67  /// setup the task for submitting and monitoring BLAST jobs, and for
68  /// retrieving results
69  virtual void Init_SubmitSearch(const CBLASTParams& params);
70 
71  /// setup the task for monitoring BLAST jobs and for retrieving results
72  virtual void Init_Monitoring(TDescriptors& descriptors);
73 
74  /// setup the task for retrieving results
75  virtual void Init_RetrieveRID(const vector<string>& RIDs);
76 
77  /// define how the task results shall be handled
78  virtual void SetLoadingOptions(CSelectProjectOptions& options);
79 
80  /// overriding CAppTask::GetStatusText()
81  virtual string GetStatusText() const;
82 
83 protected:
84  enum ECommand {
85  eInvalid = -1,
86  eSubmit, /// submit request, monitor and retrieve results
87  eMonitor, /// monitor and retrieve resutlts
88  eRetrieve, /// only retrieve resutlts
89  eFinished
90  };
91 
92 protected:
93  void x_InitMonitoringStage(TDescriptors& descriptors);
94 
95  /// @name CCompositeAppTask overridables
96  /// @{
100  /// @}
101 
102  void x_ReportErrors(vector<string>& errors);
103 
104 protected:
107 
108  /// name of the tool that launched the task; used in UI
109  string m_ToolName;
110 
111  /// the command associated with the task
113 
117 
118  /// defines the current stage of the task
124 };
125 
126 
127 /* @} */
128 
130 
131 
132 #endif // PKG_ALIGNMENT___BLAST_SEARCH_TASK__HPP
133 
CBLASTParams - save user-specified parameters and preferences.
CCompositeAppTask - an application task that consists of subtasks.
CProjectService - a service providing API for operations with Workspaces and Projects.
CProjectSelectOptions - describes how new Project Items shall be added to a workspace.
IServiceLocator - an abstract mechanism for locating services.
Definition: service.hpp:71
ETaskState
List of task states defining the task management FSM.
Definition: app_task.hpp:87
virtual CIRef< IAppTask > x_NextSubTask()
prepares the next subtask (makes it current), this function is used for iterating subtasks.
ECommand m_Command
the command associated with the task
void x_ReportErrors(vector< string > &errors)
vector< CRef< CNetBlastJobDescriptor > > TDescriptors
virtual string GetStatusText() const
overriding CAppTask::GetStatusText()
virtual ETaskState x_RunCurrentSubTask()
runs the current subtask; one may override this function in order to perform special pre-execution or...
virtual void Init_Monitoring(TDescriptors &descriptors)
setup the task for monitoring BLAST jobs and for retrieving results
virtual CIRef< IAppTask > x_GetCurrentSubTask()
returns a references to the current subtask
CIRef< IAppTask > m_CurrTask
virtual void Init_RetrieveRID(const vector< string > &RIDs)
setup the task for retrieving results
virtual void SetLoadingOptions(CSelectProjectOptions &options)
define how the task results shall be handled
CSelectProjectOptions m_LoadingOptions
string m_ToolName
name of the tool that launched the task; used in UI
virtual void Init_SubmitSearch(const CBLASTParams &params)
setup the task for submitting and monitoring BLAST jobs, and for retrieving results
void x_InitMonitoringStage(TDescriptors &descriptors)
preapres App Job for monitoring stage of the task
ECommand m_Stage
defines the current stage of the task
CRef< objects::CGBProjectHandle > m_TargetProject
IServiceLocator * m_SrvLocator
CRef< CNetBlastLoadingJob > m_LoadingJob
CRef< CNetBlastSubmittingJob > m_SubmittingJob
CRef< CNetBLASTUIDataSource > m_NetBlastDS
CRef< CNetBlastMonitoringJob > m_MonitoringJob
CBlastSearchTask(IServiceLocator *srv_locator, CNetBLASTUIDataSource &ds, const string &tool_name)
CBlastSearchTask.
@ eFinished
only retrieve resutlts
@ eMonitor
submit request, monitor and retrieve results
@ eRetrieve
monitor and retrieve resutlts
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Defines to provide correct exporting from DLLs in Windows.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
The NCBI C++/STL use hints.
Modified on Wed Apr 24 14:18:33 2024 by modify_doxy.py rev. 669887