NCBI C++ ToolKit
|
Search Toolkit Book for CDataMiningService
#include <gui/core/data_mining_service.hpp>
Public Types | |
typedef vector< IDataMiningContext * > | TContexts |
typedef vector< ISelectionClient * > | TClients |
typedef map< string, CIRef< IDMSearchTool > > | TNameToToolMap |
typedef vector< IDMContextMenuContributor * > | TContributors |
Public Types inherited from CObject | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Public Types inherited from CEventHandler | |
enum | EDispatch { eDispatch_SelfOnly , eDispatch_AllHandlers , eDispatch_FirstHandler , eDispatch_Default = eDispatch_AllHandlers } |
enum controlling dispatching strategies More... | |
enum | EPoolName { ePool_Default = 0 , ePool_Parent , ePool_Child , ePool_Sibling , ePool_NextAvailable } |
Identifiers for standard pools. More... | |
typedef vector< CEventHandler * > | TListeners |
typedef map< int, TListeners > | TPools |
typedef list< AutoPtr< SPostRequest > > | TPostRequests |
typedef std::map< CEventHandler *, int > | THandlerToCount |
typedef void(* | FOnPostCallback) () |
Public Member Functions | |
CDataMiningService () | |
virtual | ~CDataMiningService () |
void | AddContributor (IDMContextMenuContributor *contributor) |
the service does NOT assume ownership of the contributor More... | |
void | RemoveContributor (IDMContextMenuContributor *contributor) |
TContributors & | GetContributors () |
IService implementation | |
virtual void | InitService () |
virtual void | ShutDownService () |
IServiceLocatorConsumer implementation | |
virtual void | SetServiceLocator (IServiceLocator *locator) |
Data Mining Service API | |
assumes ownwership of the tool instance, manager by CIRef<IDMSearchTool> | |
virtual bool | RegisterTool (IDMSearchTool *tool) |
virtual string | GetDefaultToolName () const |
virtual void | GetToolNames (vector< string > &names) const |
virtual CIRef< IDMSearchTool > | GetToolByName (const string &name) |
virtual void | AttachContext (IDataMiningContext &context) |
virtual void | DetachContext (IDataMiningContext &context) |
virtual IDataMiningContext * | GetLastActiveContext () |
virtual void | OnActiveContextChanged (IDataMiningContext *active) |
this function is called by GUI components to notify server More... | |
virtual void | GetContexts (TContexts &contexts) |
IRegSettings implementation | |
virtual void | LoadSettings () |
virtual void | SaveSettings () const |
virtual void | SetRegistryPath (const string &path) |
Public Member Functions inherited from CObjectEx | |
CObjectEx (void) | |
virtual | ~CObjectEx (void) |
Public Member Functions inherited from CObject | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
Public Member Functions inherited from CDebugDumpable | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Public Member Functions inherited from CWeakObject | |
CWeakObject (void) | |
virtual | ~CWeakObject (void) |
CPtrToObjectProxy * | GetPtrProxy (void) const |
Get pointer to proxy object containing pointer to this object. More... | |
Public Member Functions inherited from IService | |
virtual | ~IService () |
Public Member Functions inherited from IServiceLocatorConsumer | |
virtual | ~IServiceLocatorConsumer () |
Public Member Functions inherited from CEventHandler | |
CEventHandler () | |
CEventHandler. More... | |
virtual | ~CEventHandler () |
virtual void | AddListener (CEventHandler *listener, int pool_name=ePool_Default) |
Add a listener. More... | |
virtual void | RemoveListener (CEventHandler *listener) |
Remove a listener. More... | |
virtual void | RemoveAllListeners (void) |
virtual bool | HasListener (CEventHandler *listener, int pool_name=ePool_Default) const |
returns "true" if the given listener belongs to the specified pool More... | |
virtual const TListeners * | GetListeners (int pool_name=ePool_Default) const |
returns a set of listeners fro the specified pool More... | |
virtual bool | OnEvent (CEvent *evt) |
Processes en event. Returns "true" if event has been processed. More... | |
virtual bool | Dispatch (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Dispatches an event to the listeners (but does not handle it). More... | |
virtual bool | Send (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Sends an event synchronously. More... | |
virtual bool | Send (CEvent *evt, int pool_name) |
void | Post (CRef< CEvent > evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Handles an event asynchronously (process and/or dispatch). More... | |
Public Member Functions inherited from IRegSettings | |
virtual | ~IRegSettings () |
Protected Member Functions | |
void | x_PostStateChanged () |
void | x_UnRegisterTools () |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Member Functions inherited from CWeakObject | |
void | CleanWeakRefs (void) const |
Method cleaning all CWeakRefs referencing at this moment to the object After calling to this method all existing CWeakRefs referencing to the object will return NULL, so it effectively will be equal to deleting the object. More... | |
Protected Member Functions inherited from CEventHandler | |
virtual const SEvtMap * | GetEventMap () const |
void | x_DeclareDead () |
Removes itself unavailable for async event delivery. More... | |
void | x_AddListenerToPool (CEventHandler *listener, int pool_name) |
Protected Attributes | |
IServiceLocator * | m_ServiceLocator |
IDataMiningContext * | m_LastActiveContext |
TContexts | m_Contexts |
TNameToToolMap | m_NameToTool |
string | m_RegPath |
TContributors | m_Contributors |
Protected Attributes inherited from CEventHandler | |
TPools | m_Pools |
Additional Inherited Members | |
Static Public Member Functions inherited from CObject | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (const type_info &type) |
static EAllocFillMode | GetAllocFillMode (void) |
static void | SetAllocFillMode (EAllocFillMode mode) |
static void | SetAllocFillMode (const string &value) |
Set mode from configuration parameter value. More... | |
Static Public Member Functions inherited from CDebugDumpable | |
static void | EnableDebugDump (bool on) |
Static Public Member Functions inherited from CEventHandler | |
static bool | HandlePostRequest () |
static void | ClearPostQueue () |
erases all events from the queue More... | |
static void | DestroyPostQueue () |
Static Public Attributes inherited from CObject | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
Static Protected Attributes inherited from CEventHandler | |
static const SEvtMap | sm_EvtMap |
Definition at line 72 of file data_mining_service.hpp.
typedef vector<ISelectionClient*> CDataMiningService::TClients |
Definition at line 81 of file data_mining_service.hpp.
typedef vector<IDataMiningContext*> CDataMiningService::TContexts |
Definition at line 80 of file data_mining_service.hpp.
typedef vector<IDMContextMenuContributor*> CDataMiningService::TContributors |
Definition at line 83 of file data_mining_service.hpp.
typedef map<string, CIRef<IDMSearchTool> > CDataMiningService::TNameToToolMap |
Definition at line 82 of file data_mining_service.hpp.
CDataMiningService::CDataMiningService | ( | ) |
Definition at line 100 of file data_mining_service.cpp.
|
virtual |
Definition at line 107 of file data_mining_service.cpp.
void CDataMiningService::AddContributor | ( | IDMContextMenuContributor * | contributor | ) |
the service does NOT assume ownership of the contributor
Definition at line 288 of file data_mining_service.cpp.
References _ASSERT, ERR_POST, m_Contributors, and NULL.
|
virtual |
Definition at line 225 of file data_mining_service.cpp.
References context, ERR_POST, m_Contexts, and x_PostStateChanged().
|
virtual |
Definition at line 237 of file data_mining_service.cpp.
References context, ERR_POST, m_Contexts, m_LastActiveContext, NULL, and x_PostStateChanged().
|
virtual |
Definition at line 267 of file data_mining_service.cpp.
References m_Contexts.
Referenced by CSearchFormBase::UpdateContexts().
|
inline |
Definition at line 92 of file data_mining_service.hpp.
References m_Contributors.
Referenced by CDataMiningPanel::OnMenuEvent().
|
virtual |
Definition at line 202 of file data_mining_service.cpp.
References map_checker< Container >::begin(), m_NameToTool, and map_checker< Container >::size().
|
virtual |
Definition at line 252 of file data_mining_service.cpp.
References m_LastActiveContext.
Referenced by CSearchFormBase::UpdateContexts().
|
virtual |
Definition at line 217 of file data_mining_service.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), m_NameToTool, and NULL.
Referenced by CDataMiningPanel::HandleTool(), CDataMiningPanel::OnUpdateCreateFeature(), CDataMiningPanel::x_CancelSearch(), CDataMiningPanel::x_CreateFeature(), CDataMiningPanel::x_ExecuteSearch(), CDataMiningPanel::x_UpdateWidget(), and CDataMiningPanel::x_UpdateWidgetAndTool().
|
virtual |
Definition at line 209 of file data_mining_service.cpp.
References ITERATE, m_NameToTool, and names.
Referenced by CDataMiningPanel::OnAutorun(), CDataMiningPanel::SelectToolByName(), and CDataMiningPanel::SetService().
|
virtual |
Implements IService.
Definition at line 116 of file data_mining_service.cpp.
References GetExtensionAsInterface(), i, Info(), LoadSettings(), LOG_POST, and RegisterTool().
|
virtual |
Implements IRegSettings.
Definition at line 278 of file data_mining_service.cpp.
Referenced by InitService().
|
virtual |
this function is called by GUI components to notify server
Definition at line 258 of file data_mining_service.cpp.
References m_LastActiveContext, and x_PostStateChanged().
|
virtual |
Definition at line 157 of file data_mining_service.cpp.
References map_checker< Container >::end(), ERR_POST, map_checker< Container >::find(), IDMSearchTool::GetName(), Info(), LOG_POST, m_NameToTool, m_ServiceLocator, REG_ERR_PREFIX, and IServiceLocatorConsumer::SetServiceLocator().
Referenced by InitService().
void CDataMiningService::RemoveContributor | ( | IDMContextMenuContributor * | contributor | ) |
Definition at line 307 of file data_mining_service.cpp.
References _ASSERT, ERR_POST, m_Contributors, and NULL.
|
virtual |
Implements IRegSettings.
Definition at line 273 of file data_mining_service.cpp.
Referenced by ShutDownService().
Implements IRegSettings.
Definition at line 282 of file data_mining_service.cpp.
References m_RegPath.
|
virtual |
Implements IServiceLocatorConsumer.
Definition at line 149 of file data_mining_service.cpp.
References m_ServiceLocator.
|
virtual |
Implements IService.
Definition at line 135 of file data_mining_service.cpp.
References Info(), LOG_POST, m_Contributors, SaveSettings(), and x_UnRegisterTools().
|
protected |
Definition at line 111 of file data_mining_service.cpp.
References CEventHandler::Post().
Referenced by AttachContext(), DetachContext(), and OnActiveContextChanged().
|
protected |
Definition at line 186 of file data_mining_service.cpp.
References map_checker< Container >::clear(), m_NameToTool, NON_CONST_ITERATE, NULL, and IServiceLocatorConsumer::SetServiceLocator().
Referenced by ShutDownService().
|
protected |
Definition at line 141 of file data_mining_service.hpp.
Referenced by AttachContext(), DetachContext(), and GetContexts().
|
protected |
Definition at line 146 of file data_mining_service.hpp.
Referenced by AddContributor(), GetContributors(), RemoveContributor(), and ShutDownService().
|
protected |
Definition at line 140 of file data_mining_service.hpp.
Referenced by DetachContext(), GetLastActiveContext(), and OnActiveContextChanged().
|
protected |
Definition at line 143 of file data_mining_service.hpp.
Referenced by GetDefaultToolName(), GetToolByName(), GetToolNames(), RegisterTool(), and x_UnRegisterTools().
|
protected |
Definition at line 144 of file data_mining_service.hpp.
Referenced by SetRegistryPath().
|
protected |
Definition at line 137 of file data_mining_service.hpp.
Referenced by RegisterTool(), and SetServiceLocator().