NCBI C++ ToolKit
Public Member Functions | Public Attributes | List of all members
CSrvTransConsumer Class Reference

Search Toolkit Book for CSrvTransConsumer

Consumer of notification about transition completeness in CSrvTransitionTask. More...

#include "srv_tasks.hpp"
(Private to src/app/netcache.)

+ Inheritance diagram for CSrvTransConsumer:
+ Collaboration diagram for CSrvTransConsumer:

Public Member Functions

 CSrvTransConsumer (void)
 
virtual ~CSrvTransConsumer (void)
 
bool IsTransFinished (void)
 Check if transition completeness was consumed. More...
 
- Public Member Functions inherited from CSrvTask
 CSrvTask (void)
 
void SetRunnable (bool boost=false)
 Set this task "runnable", i.e. More...
 
void RunAfter (Uint4 delay_sec)
 This call is basically equivalent to SetRunnable() but with guarantee that task will be scheduled for execution no earlier than delay_sec later (approximately, can be up to a second less if measured in absolute wall time). More...
 
virtual void Terminate (void)
 Stops task's execution and deletes it. More...
 
void SetPriority (Uint4 prty)
 Set and retrieve task's priority. More...
 
Uint4 GetPriority (void)
 
void CreateNewDiagCtx (void)
 Create new diagnostic context for this task to work in. More...
 
void SetDiagCtx (CRequestContext *ctx)
 Set diagnostic context for this task to work in. More...
 
CRequestContextGetDiagCtx (void)
 Get current diagnostic context for the task. More...
 
void ReleaseDiagCtx (void)
 Releases current diagnostic context of the task. More...
 
virtual void ExecuteSlice (TSrvThreadNum thr_num)=0
 This is the main method to do all work this task should do. More...
 
virtual ~CSrvTask (void)
 
virtual void InternalRunSlice (TSrvThreadNum thr_num)
 This is the real time slice execution method called from TaskServer. More...
 

Public Attributes

bool m_TransFinished
 Flag showing that transition was already consumed. More...
 
- Public Attributes inherited from CSrvTask
TSrvTaskListHook m_TaskListHook
 Hook to put this task into TSrvTaskList. More...
 
TSrvThreadNum m_LastThread
 Thread number where this task was executed last time. More...
 
TSrvTaskFlags m_TaskFlags
 Bit-OR of flags for this task. More...
 
int m_LastActive
 Time (in seconds) when the task was active last time, i.e. More...
 
Uint4 m_Priority
 Task's priority. More...
 
CRequestContextm_DiagCtx
 Current diagnostic context for this task. More...
 
CRequestContext ** m_DiagChain
 Nested diagnostic contexts of this task. More...
 
size_t m_DiagChainSize
 
STimerTicketm_Timer
 Timer ticket assigned to this task when it calls RunAfter(). More...
 
CSrvTaskTerminator m_Terminator
 Object that will delete this task after call to Terminate(). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CSrvTask
static void PrintState (CSrvSocketTask &task)
 

Detailed Description

Consumer of notification about transition completeness in CSrvTransitionTask.

Virtual inheritance from CSrvTask is used to allow derived classes to combine several task types together (such as CSrvSocketTask, CSrvStatesTask etc.) and still have one implementation of CSrvTask.

Definition at line 422 of file srv_tasks.hpp.

Constructor & Destructor Documentation

◆ CSrvTransConsumer()

CSrvTransConsumer::CSrvTransConsumer ( void  )

Definition at line 224 of file srv_tasks.cpp.

◆ ~CSrvTransConsumer()

CSrvTransConsumer::~CSrvTransConsumer ( void  )
virtual

Definition at line 232 of file srv_tasks.cpp.

Member Function Documentation

◆ IsTransFinished()

bool CSrvTransConsumer::IsTransFinished ( void  )
inline

Check if transition completeness was consumed.

Derived classes must use this method (instead of CSrvTransitionTask::IsTransStateFinal()) because it returns TRUE not only when transition has been finished but also when this consumer was notified about that. Otherwise it will be possible that other thread finished transition and this thread will try to request transition on another task but it will unable to put this task to m_Consumers list as it wasn't removed from m_Consumers list of first task yet.

Definition at line 486 of file srv_inlines.hpp.

References m_TransFinished.

Referenced by CNCBlobAccessor::ExecuteSlice(), and CSpaceShrinker::x_CheckCurVersion().

Member Data Documentation

◆ m_TransFinished

bool CSrvTransConsumer::m_TransFinished

Flag showing that transition was already consumed.

Definition at line 443 of file srv_tasks.hpp.

Referenced by CSrvTransitionTask::FinishTransition(), IsTransFinished(), CSrvTransitionTask::RequestTransition(), s_AllocWriteBackMem(), and s_NotifyConsumers().


The documentation for this class was generated from the following files:
Modified on Wed May 22 11:28:58 2024 by modify_doxy.py rev. 669887