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

Search Toolkit Book for CObjectManagerEngine

CAppJobDispatcher. More...

#include <gui/objutils/object_manager_engine.hpp>

+ Inheritance diagram for CObjectManagerEngine:
+ Collaboration diagram for CObjectManagerEngine:

Public Member Functions

 CObjectManagerEngine (unsigned max_threads=3)
 CObjectManagerEngine. More...
 
 ~CObjectManagerEngine ()
 
virtual bool IsActive ()
 Returns true if Engine supports "active" model i.e. More...
 
virtual void SetListener (IAppJobEngineListener *listener)
 For "active" mode set a Listener that will be notified when the state of a Job changes. More...
 
virtual void StartJob (IAppJob &job, IEngineParams *params=NULL)
 If Engine cannot start the Job and exception shall be thrown. More...
 
virtual void CancelJob (IAppJob &job)
 Cancel job in the engine If job is not running yet - just remove from the pending queue otherwise uses IInterruptible to notify the job about cancel request. More...
 
virtual void SuspendJob (IAppJob &job)
 
virtual void ResumeJob (IAppJob &job)
 
virtual TJobState GetJobState (IAppJob &job) const
 
virtual void ShutDown ()
 stop any background threads and free resources associated with the Engine More...
 
virtual void RequestCancel ()
 asyncronous request all jobs to Cancel More...
 
- 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 IAppJobEngine
virtual ~IAppJobEngine ()
 

Protected Types

typedef map< IAppJob *, CRef< objects::CPrefetchRequest > > TJobHandles
 

Protected Member Functions

void PrefetchNotify (CRef< objects::CPrefetchRequest > token, EEvent event)
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Protected Attributes

CMutex m_Mutex
 
objects::CPrefetchManager m_PrefetchManager
 
IAppJobEngineListenerm_Listener
 
TJobHandles m_Jobs
 

Private Member Functions

 CObjectManagerEngine (const CObjectManagerEngine &)
 
void operator= (const CObjectManagerEngine &)
 

Additional Inherited Members

- 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 IAppJobEngine
typedef CAppJobDispatcher TDisp
 
typedef IAppJob::EJobState TJobState
 
- 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 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...
 

Detailed Description

CAppJobDispatcher.

Definition at line 47 of file object_manager_engine.hpp.

Member Typedef Documentation

◆ TJobHandles

typedef map<IAppJob*, CRef<objects::CPrefetchRequest> > CObjectManagerEngine::TJobHandles
protected

Definition at line 77 of file object_manager_engine.hpp.

Constructor & Destructor Documentation

◆ CObjectManagerEngine() [1/2]

CObjectManagerEngine::CObjectManagerEngine ( unsigned  max_threads = 3)

CObjectManagerEngine.

Definition at line 74 of file object_manager_engine.cpp.

◆ ~CObjectManagerEngine()

CObjectManagerEngine::~CObjectManagerEngine ( )

Definition at line 80 of file object_manager_engine.cpp.

◆ CObjectManagerEngine() [2/2]

CObjectManagerEngine::CObjectManagerEngine ( const CObjectManagerEngine )
private

Member Function Documentation

◆ CancelJob()

void CObjectManagerEngine::CancelJob ( IAppJob job)
virtual

Cancel job in the engine If job is not running yet - just remove from the pending queue otherwise uses IInterruptible to notify the job about cancel request.

Implements IAppJobEngine.

Definition at line 116 of file object_manager_engine.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), m_Jobs, m_Mutex, NCBI_THROW, and IAppJob::RequestCancel().

◆ GetJobState()

IAppJobEngine::TJobState CObjectManagerEngine::GetJobState ( IAppJob job) const
virtual

◆ IsActive()

bool CObjectManagerEngine::IsActive ( )
virtual

Returns true if Engine supports "active" model i.e.

will send notifications to Dispatcher when a Job running on this Engine changes its state.

Implements IAppJobEngine.

Definition at line 96 of file object_manager_engine.cpp.

◆ operator=()

void CObjectManagerEngine::operator= ( const CObjectManagerEngine )
private

◆ PrefetchNotify()

void CObjectManagerEngine::PrefetchNotify ( CRef< objects::CPrefetchRequest >  token,
EEvent  event 
)
protected

◆ RequestCancel()

void CObjectManagerEngine::RequestCancel ( )
virtual

asyncronous request all jobs to Cancel

Implements IAppJobEngine.

Definition at line 91 of file object_manager_engine.cpp.

References m_PrefetchManager.

◆ ResumeJob()

void CObjectManagerEngine::ResumeJob ( IAppJob job)
virtual

Implements IAppJobEngine.

Definition at line 134 of file object_manager_engine.cpp.

References eUnknown, and NCBI_THROW.

◆ SetListener()

void CObjectManagerEngine::SetListener ( IAppJobEngineListener listener)
virtual

For "active" mode set a Listener that will be notified when the state of a Job changes.

Implements IAppJobEngine.

Definition at line 102 of file object_manager_engine.cpp.

References m_Listener, and m_Mutex.

Referenced by ShutDown().

◆ ShutDown()

void CObjectManagerEngine::ShutDown ( )
virtual

stop any background threads and free resources associated with the Engine

Implements IAppJobEngine.

Definition at line 84 of file object_manager_engine.cpp.

References m_PrefetchManager, NULL, and SetListener().

◆ StartJob()

void CObjectManagerEngine::StartJob ( IAppJob job,
IEngineParams *  params = NULL 
)
virtual

If Engine cannot start the Job and exception shall be thrown.

Implements IAppJobEngine.

Definition at line 109 of file object_manager_engine.cpp.

References m_Jobs, m_Mutex, and m_PrefetchManager.

◆ SuspendJob()

void CObjectManagerEngine::SuspendJob ( IAppJob job)
virtual

Implements IAppJobEngine.

Definition at line 128 of file object_manager_engine.cpp.

References eUnknown, and NCBI_THROW.

Member Data Documentation

◆ m_Jobs

TJobHandles CObjectManagerEngine::m_Jobs
protected

Definition at line 78 of file object_manager_engine.hpp.

Referenced by CancelJob(), GetJobState(), PrefetchNotify(), and StartJob().

◆ m_Listener

IAppJobEngineListener* CObjectManagerEngine::m_Listener
protected

Definition at line 76 of file object_manager_engine.hpp.

Referenced by PrefetchNotify(), and SetListener().

◆ m_Mutex

CMutex CObjectManagerEngine::m_Mutex
mutableprotected

◆ m_PrefetchManager

objects::CPrefetchManager CObjectManagerEngine::m_PrefetchManager
protected

Definition at line 75 of file object_manager_engine.hpp.

Referenced by RequestCancel(), ShutDown(), and StartJob().


The documentation for this class was generated from the following files:
Modified on Mon May 27 04:37:57 2024 by modify_doxy.py rev. 669887