ddc
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
ConcIndexatorInvoker Class Reference

CConcIndexatorInvoker is a class for invoking an index process. More...

#include <ConcIndexatorInvoker.h>

Inheritance diagram for ConcIndexatorInvoker:
Inheritance graph
[legend]
Collaboration diagram for ConcIndexatorInvoker:
Collaboration graph
[legend]

Public Member Functions

 ConcIndexatorInvoker ()
 
void SetCurrMessage (string Message) const
 outputs a message to stdout or to GUI More...
 
bool BuildIndex (string ProjectFile)
 builds index files for project ProjectFile More...
 

Public Attributes

bool m_bStoppedByUser
 if true, CConcIndexatorInvoker tries to stop indexing More...
 
bool m_bOnlyReindexMorphology
 if true, then BuildIndex should only rebuild MorphPattern index More...
 
bool m_bSkipInitialFileChecking
 if true, then there is no initial checking whether the source files exist More...
 
string m_CurrMessage
 the last message from indexing process More...
 
bool m_bStdout
 should DDC send all messages to stdout More...
 
int m_CurrentSourceFileNo
 the index of the currently processing source file More...
 
int m_SourceFilesNumber
 the number of files to index More...
 
string m_CurrentSourceFileName
 the name of file More...
 
CMyTimeSpanHolder m_Profiler
 a slot to gather profiling information for loading stage More...
 

Private Member Functions

string GetTimeStatisticsFileName (string Path) const
 
string GetErrorLogFileName (string Path) const
 
void WriteTimeStatistics (const CConcIndexator &Indexator, DWORD MaxTokenCountInOnePeriod) const
 
void FinalizeIndex (CConcIndexator &Indexator, DWORD MaxTokenCountInOnePeriod) const
 
void BuildOnlyMorphIndex (string ProjectFile) const
 
void BuildIndexStart (string ProjectFile, CConcIndexator &indexator)
 
void PrintProgress (DWORD saveCorpusEndTokenNo)
 
void IndexFiles (CConcIndexator &Indexator)
 
void SaveLoadIndexToDisk (CConcIndexator &Indexator)
 
DWORD IndexFile (CConcIndexator &Indexator, CIndexDocument *document)
 
void AddInputLoadIndexToMemoryLoadIndexWrapper (CConcIndexator &Indexator)
 
void ProcessTarOrSingleFile (CConcIndexator &Indexator, size_t &InputLoadIndexSize, size_t &MemoryLoadIndexSize)
 

Private Attributes

time_t m_StartTime
 
DWORD m_CorpusEndTokenNo
 
vector< string > m_ErrorCorpusFiles
 

Detailed Description

CConcIndexatorInvoker is a class for invoking an index process.

This class was established to start, to stop and to monitor an indexing process. To start it a user should call function CConcIndexatorInvoker::BuildIndex. To stop the process a user should set CConcIndexatorInvoker::m_bStoppedByUser to true.

Constructor & Destructor Documentation

◆ ConcIndexatorInvoker()

ConcIndexatorInvoker::ConcIndexatorInvoker ( )

Member Function Documentation

◆ GetTimeStatisticsFileName()

string ConcIndexatorInvoker::GetTimeStatisticsFileName ( string  Path) const
private

References MakeFName().

Referenced by WriteTimeStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetErrorLogFileName()

string ConcIndexatorInvoker::GetErrorLogFileName ( string  Path) const
private

References MakeFName().

Referenced by FinalizeIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteTimeStatistics()

void ConcIndexatorInvoker::WriteTimeStatistics ( const CConcIndexator Indexator,
DWORD  MaxTokenCountInOnePeriod 
) const
private

◆ FinalizeIndex()

void ConcIndexatorInvoker::FinalizeIndex ( CConcIndexator Indexator,
DWORD  MaxTokenCountInOnePeriod 
) const
private

◆ BuildOnlyMorphIndex()

void ConcIndexatorInvoker::BuildOnlyMorphIndex ( string  ProjectFile) const
private

References CConcIndexator::CreateMorphIndexWrapper(), CConcordance::LoadProject(), and SetCurrMessage().

Referenced by BuildIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildIndexStart()

void ConcIndexatorInvoker::BuildIndexStart ( string  ProjectFile,
CConcIndexator indexator 
)
private

◆ PrintProgress()

void ConcIndexatorInvoker::PrintProgress ( DWORD  saveCorpusEndTokenNo)
private

References Format(), m_CurrentSourceFileName, m_CurrentSourceFileNo, m_SourceFilesNumber, m_StartTime, and SetCurrMessage().

Referenced by AddInputLoadIndexToMemoryLoadIndexWrapper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IndexFiles()

void ConcIndexatorInvoker::IndexFiles ( CConcIndexator Indexator)
private

◆ SaveLoadIndexToDisk()

void ConcIndexatorInvoker::SaveLoadIndexToDisk ( CConcIndexator Indexator)
private

◆ IndexFile()

DWORD ConcIndexatorInvoker::IndexFile ( CConcIndexator Indexator,
CIndexDocument document 
)
private

◆ AddInputLoadIndexToMemoryLoadIndexWrapper()

void ConcIndexatorInvoker::AddInputLoadIndexToMemoryLoadIndexWrapper ( CConcIndexator Indexator)
private

◆ ProcessTarOrSingleFile()

void ConcIndexatorInvoker::ProcessTarOrSingleFile ( CConcIndexator Indexator,
size_t &  InputLoadIndexSize,
size_t &  MemoryLoadIndexSize 
)
private

◆ SetCurrMessage()

void ConcIndexatorInvoker::SetCurrMessage ( string  Message) const

outputs a message to stdout or to GUI

References m_bStdout, and m_CurrMessage.

Referenced by BuildIndex(), BuildIndexStart(), BuildOnlyMorphIndex(), FinalizeIndex(), IndexFile(), PrintProgress(), SaveLoadIndexToDisk(), and WriteTimeStatistics().

Here is the caller graph for this function:

◆ BuildIndex()

bool ConcIndexatorInvoker::BuildIndex ( string  ProjectFile)

Member Data Documentation

◆ m_StartTime

time_t ConcIndexatorInvoker::m_StartTime
private

Referenced by BuildIndexStart(), and PrintProgress().

◆ m_CorpusEndTokenNo

DWORD ConcIndexatorInvoker::m_CorpusEndTokenNo
private

◆ m_ErrorCorpusFiles

vector<string> ConcIndexatorInvoker::m_ErrorCorpusFiles
private

◆ m_bStoppedByUser

bool ConcIndexatorInvoker::m_bStoppedByUser

if true, CConcIndexatorInvoker tries to stop indexing

Referenced by BuildIndex(), ConcIndexatorInvoker(), IndexFiles(), and ProcessTarOrSingleFile().

◆ m_bOnlyReindexMorphology

bool ConcIndexatorInvoker::m_bOnlyReindexMorphology

if true, then BuildIndex should only rebuild MorphPattern index

Referenced by BuildIndex(), and ConcIndexatorInvoker().

◆ m_bSkipInitialFileChecking

bool ConcIndexatorInvoker::m_bSkipInitialFileChecking

if true, then there is no initial checking whether the source files exist

Referenced by BuildIndexStart(), and ConcIndexatorInvoker().

◆ m_CurrMessage

string ConcIndexatorInvoker::m_CurrMessage
mutable

the last message from indexing process

Referenced by SetCurrMessage().

◆ m_bStdout

bool ConcIndexatorInvoker::m_bStdout

should DDC send all messages to stdout

Referenced by ConcIndexatorInvoker(), and SetCurrMessage().

◆ m_CurrentSourceFileNo

int ConcIndexatorInvoker::m_CurrentSourceFileNo

the index of the currently processing source file

Referenced by ConcIndexatorInvoker(), IndexFiles(), and PrintProgress().

◆ m_SourceFilesNumber

int ConcIndexatorInvoker::m_SourceFilesNumber

the number of files to index

Referenced by BuildIndexStart(), ConcIndexatorInvoker(), IndexFiles(), and PrintProgress().

◆ m_CurrentSourceFileName

string ConcIndexatorInvoker::m_CurrentSourceFileName

◆ m_Profiler

CMyTimeSpanHolder ConcIndexatorInvoker::m_Profiler
mutable

The documentation for this class was generated from the following files: