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

Go to the SVN repository for this file.

1 #ifndef GUI_SERVICES___DATA_MINING_SERVICE_HPP
2 #define GUI_SERVICES___DATA_MINING_SERVICE_HPP
3 
4 /* $Id: data_mining_service.hpp 31795 2014-11-14 20:56:52Z 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/ncbistd.hpp>
37 #include <gui/framework/view.hpp>
43 
44 
46 
47 class CDMSearchResult;
48 
49 ///////////////////////////////////////////////////////////////////////////////
50 /// IDMContextMenuContributor - contributes menu to Data Mining Service.
52 {
53 public:
54  /// returns a menu (must be deleted by the caller)
55  virtual wxMenu* GetContextMenu() = 0;
56 
58 };
59 
60 class CCDataMiningEvent : public CEvent
61 {
62 public:
63  enum EEventId {
65  };
66 
68 };
69 
70 ///////////////////////////////////////////////////////////////////////////////
71 /// CDataMiningService
73  public CObjectEx,
74  public IService,
76  public CEventHandler,
77  public IRegSettings
78 {
79 public:
80  typedef vector<IDataMiningContext*> TContexts;
81  typedef vector<ISelectionClient*> TClients;
83  typedef vector<IDMContextMenuContributor*> TContributors;
84 
85 
87  virtual ~CDataMiningService();
88 
89  /// the service does NOT assume ownership of the contributor
90  void AddContributor(IDMContextMenuContributor* contributor);
91  void RemoveContributor(IDMContextMenuContributor* contributor);
92  TContributors & GetContributors() {return m_Contributors;}
93 
94  /// @name IService implementation
95  /// @{
96  virtual void InitService();
97  virtual void ShutDownService();
98  /// @}
99 
100  /// @name IServiceLocatorConsumer implementation
101  /// @{
102  virtual void SetServiceLocator(IServiceLocator* locator);
103  /// @}
104 
105  /// @name Data Mining Service API
106  /// assumes ownwership of the tool instance, manager by CIRef<IDMSearchTool>
107  virtual bool RegisterTool(IDMSearchTool* tool);
108 
109  virtual string GetDefaultToolName() const;
110  virtual void GetToolNames(vector<string>& names) const;
111 
112  virtual CIRef<IDMSearchTool> GetToolByName(const string& name);
113 
114  virtual void AttachContext(IDataMiningContext& context);
115  virtual void DetachContext(IDataMiningContext& context);
116  virtual IDataMiningContext* GetLastActiveContext();
117 
118  /// this function is called by GUI components to notify server
119  virtual void OnActiveContextChanged(IDataMiningContext* active);
120 
121  virtual void GetContexts(TContexts& contexts);
122  /// @}
123 
124  /// @name IRegSettings implementation
125  /// @{
126  virtual void LoadSettings();
127  virtual void SaveSettings() const;
128  virtual void SetRegistryPath(const string& path);
129  /// @}
130 
131 protected:
132  void x_PostStateChanged();
133 
134  void x_UnRegisterTools();
135 
136 protected:
138 
139 
142 
144  string m_RegPath;
145 
147 };
148 
149 
151 
152 
153 #endif // GUI_SERVICES___DATA_MINING_SERVICE_HPP
CDMSearchResult - result object delivered using job progress object.
CDataMiningService.
vector< IDMContextMenuContributor * > TContributors
vector< ISelectionClient * > TClients
IDataMiningContext * m_LastActiveContext
map< string, CIRef< IDMSearchTool > > TNameToToolMap
IServiceLocator * m_ServiceLocator
vector< IDataMiningContext * > TContexts
TContributors & GetContributors()
CEventHandler.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
CObjectEx –.
Definition: ncbiobj.hpp:2531
IDMContextMenuContributor - contributes menu to Data Mining Service.
virtual wxMenu * GetContextMenu()=0
returns a menu (must be deleted by the caller)
IDMSearchTool interface representing a single search tool in Data Mining Service.
IDataMiningContext IDataMiningContext represents an abstract context for a Search.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
virtual void SaveSettings() const =0
virtual void LoadSettings()=0
virtual void SetRegistryPath(const string &path)=0
IServiceLocatorConsumer - classes that need IServiceLocator should implement this interface.
Definition: service.hpp:103
IServiceLocator - an abstract mechanism for locating services.
Definition: service.hpp:71
IService an abstraction that represents an application component providing specific functional capa...
Definition: service.hpp:56
Definition: map.hpp:338
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const struct name_t names[]
virtual void SetServiceLocator(IServiceLocator *locator)=0
virtual void InitService()=0
virtual void ShutDownService()=0
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUICORE_EXPORT
Definition: gui_export.h:508
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Mon Apr 22 04:06:56 2024 by modify_doxy.py rev. 669887