NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CDataMiningService Class Reference

Search Toolkit Book for CDataMiningService

CDataMiningService. More...

#include <gui/core/data_mining_service.hpp>

+ Inheritance diagram for CDataMiningService:
+ Collaboration diagram for CDataMiningService:

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< Uint8TCounter
 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, TListenersTPools
 
typedef list< AutoPtr< SPostRequest > > TPostRequests
 
typedef std::map< CEventHandler *, intTHandlerToCount
 
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)
 
TContributorsGetContributors ()
 
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< IDMSearchToolGetToolByName (const string &name)
 
virtual void AttachContext (IDataMiningContext &context)
 
virtual void DetachContext (IDataMiningContext &context)
 
virtual IDataMiningContextGetLastActiveContext ()
 
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...
 
CObjectoperator= (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)
 
CPtrToObjectProxyGetPtrProxy (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 TListenersGetListeners (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 SEvtMapGetEventMap () const
 
void x_DeclareDead ()
 Removes itself unavailable for async event delivery. More...
 
void x_AddListenerToPool (CEventHandler *listener, int pool_name)
 

Protected Attributes

IServiceLocatorm_ServiceLocator
 
IDataMiningContextm_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
 

Detailed Description

CDataMiningService.

Definition at line 72 of file data_mining_service.hpp.

Member Typedef Documentation

◆ TClients

Definition at line 81 of file data_mining_service.hpp.

◆ TContexts

Definition at line 80 of file data_mining_service.hpp.

◆ TContributors

Definition at line 83 of file data_mining_service.hpp.

◆ TNameToToolMap

Definition at line 82 of file data_mining_service.hpp.

Constructor & Destructor Documentation

◆ CDataMiningService()

CDataMiningService::CDataMiningService ( )

Definition at line 100 of file data_mining_service.cpp.

◆ ~CDataMiningService()

CDataMiningService::~CDataMiningService ( )
virtual

Definition at line 107 of file data_mining_service.cpp.

Member Function Documentation

◆ AddContributor()

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.

◆ AttachContext()

void CDataMiningService::AttachContext ( IDataMiningContext context)
virtual

Definition at line 225 of file data_mining_service.cpp.

References context, ERR_POST, m_Contexts, and x_PostStateChanged().

◆ DetachContext()

void CDataMiningService::DetachContext ( IDataMiningContext context)
virtual

◆ GetContexts()

void CDataMiningService::GetContexts ( CDataMiningService::TContexts contexts)
virtual

Definition at line 267 of file data_mining_service.cpp.

References m_Contexts.

Referenced by CSearchFormBase::UpdateContexts().

◆ GetContributors()

TContributors& CDataMiningService::GetContributors ( )
inline

Definition at line 92 of file data_mining_service.hpp.

References m_Contributors.

Referenced by CDataMiningPanel::OnMenuEvent().

◆ GetDefaultToolName()

string CDataMiningService::GetDefaultToolName ( ) const
virtual

◆ GetLastActiveContext()

IDataMiningContext * CDataMiningService::GetLastActiveContext ( )
virtual

Definition at line 252 of file data_mining_service.cpp.

References m_LastActiveContext.

Referenced by CSearchFormBase::UpdateContexts().

◆ GetToolByName()

CIRef< IDMSearchTool > CDataMiningService::GetToolByName ( const string name)
virtual

◆ GetToolNames()

void CDataMiningService::GetToolNames ( vector< string > &  names) const
virtual

◆ InitService()

void CDataMiningService::InitService ( )
virtual

Implements IService.

Definition at line 116 of file data_mining_service.cpp.

References GetExtensionAsInterface(), i, Info(), LoadSettings(), LOG_POST, and RegisterTool().

◆ LoadSettings()

void CDataMiningService::LoadSettings ( )
virtual

Implements IRegSettings.

Definition at line 278 of file data_mining_service.cpp.

Referenced by InitService().

◆ OnActiveContextChanged()

void CDataMiningService::OnActiveContextChanged ( IDataMiningContext active)
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().

◆ RegisterTool()

bool CDataMiningService::RegisterTool ( IDMSearchTool tool)
virtual

◆ RemoveContributor()

void CDataMiningService::RemoveContributor ( IDMContextMenuContributor contributor)

Definition at line 307 of file data_mining_service.cpp.

References _ASSERT, ERR_POST, m_Contributors, and NULL.

◆ SaveSettings()

void CDataMiningService::SaveSettings ( ) const
virtual

Implements IRegSettings.

Definition at line 273 of file data_mining_service.cpp.

Referenced by ShutDownService().

◆ SetRegistryPath()

void CDataMiningService::SetRegistryPath ( const string path)
virtual

Implements IRegSettings.

Definition at line 282 of file data_mining_service.cpp.

References m_RegPath.

◆ SetServiceLocator()

void CDataMiningService::SetServiceLocator ( IServiceLocator locator)
virtual

Implements IServiceLocatorConsumer.

Definition at line 149 of file data_mining_service.cpp.

References m_ServiceLocator.

◆ ShutDownService()

void CDataMiningService::ShutDownService ( )
virtual

Implements IService.

Definition at line 135 of file data_mining_service.cpp.

References Info(), LOG_POST, m_Contributors, SaveSettings(), and x_UnRegisterTools().

◆ x_PostStateChanged()

void CDataMiningService::x_PostStateChanged ( )
protected

Definition at line 111 of file data_mining_service.cpp.

References CEventHandler::Post().

Referenced by AttachContext(), DetachContext(), and OnActiveContextChanged().

◆ x_UnRegisterTools()

void CDataMiningService::x_UnRegisterTools ( )
protected

Member Data Documentation

◆ m_Contexts

TContexts CDataMiningService::m_Contexts
protected

Definition at line 141 of file data_mining_service.hpp.

Referenced by AttachContext(), DetachContext(), and GetContexts().

◆ m_Contributors

TContributors CDataMiningService::m_Contributors
protected

◆ m_LastActiveContext

IDataMiningContext* CDataMiningService::m_LastActiveContext
protected

◆ m_NameToTool

TNameToToolMap CDataMiningService::m_NameToTool
protected

◆ m_RegPath

string CDataMiningService::m_RegPath
protected

Definition at line 144 of file data_mining_service.hpp.

Referenced by SetRegistryPath().

◆ m_ServiceLocator

IServiceLocator* CDataMiningService::m_ServiceLocator
protected

Definition at line 137 of file data_mining_service.hpp.

Referenced by RegisterTool(), and SetServiceLocator().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:45 2024 by modify_doxy.py rev. 669887