Code::Blocks  SVN r11506
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HeaderDirTraverser Class Reference
Inheritance diagram for HeaderDirTraverser:
Collaboration diagram for HeaderDirTraverser:

Public Member Functions

 HeaderDirTraverser (wxThread *thread, wxCriticalSection *critSect, SystemHeadersMap &headersMap, const wxString &searchDir)
 
 ~HeaderDirTraverser () override
 
wxDirTraverseResult OnFile (const wxString &filename) override
 call back function when we meet a file More...
 
wxDirTraverseResult OnDir (const wxString &dirname) override
 call back function when we meet a dir More...
 
- Public Member Functions inherited from wxDirTraverser
virtual wxDirTraverseResult OnOpenError (const wxString &openerrorname)
 

Private Member Functions

void AddLock (bool is_file)
 this function will be called every time we meet a file or a dir, and we count the file and dir, we temporary leave the critical section to give other thread a change to access the file maps. More...
 
wxDirTraverseResult GetStatus (const wxString &path)
 

Private Attributes

wxThreadm_Thread
 
wxCriticalSectionm_SystemHeadersThreadCS
 
const SystemHeadersMapm_SystemHeadersMap
 
const wxStringm_SearchDir
 
StringSetm_Headers
 
bool m_Locked
 indicates whether the critical section is entered or not, used in AddLock() function More...
 
size_t m_Dirs
 
size_t m_Files
 

Detailed Description

Definition at line 59 of file systemheadersthread.cpp.

Constructor & Destructor Documentation

◆ HeaderDirTraverser()

HeaderDirTraverser::HeaderDirTraverser ( wxThread thread,
wxCriticalSection critSect,
SystemHeadersMap headersMap,
const wxString searchDir 
)

Definition at line 239 of file systemheadersthread.cpp.

◆ ~HeaderDirTraverser()

HeaderDirTraverser::~HeaderDirTraverser ( )
override

Member Function Documentation

◆ AddLock()

void HeaderDirTraverser::AddLock ( bool  is_file)
private

this function will be called every time we meet a file or a dir, and we count the file and dir, we temporary leave the critical section to give other thread a change to access the file maps.

As the traversing may take a long time, in the same time, the UI may need to show the code completion prompt for header files, so a critical section is used here.

Definition at line 319 of file systemheadersthread.cpp.

References _T, wxCriticalSection::Enter(), wxCriticalSection::Leave(), m_Dirs, m_Files, m_Locked, m_SystemHeadersThreadCS, and TRACE.

Referenced by OnDir(), and OnFile().

◆ GetStatus()

wxDirTraverseResult HeaderDirTraverser::GetStatus ( const wxString path)
private

Definition at line 341 of file systemheadersthread.cpp.

References m_SystemHeadersMap, wxDIR_CONTINUE, and wxDIR_IGNORE.

Referenced by OnDir().

◆ OnDir()

wxDirTraverseResult HeaderDirTraverser::OnDir ( const wxString dirname)
overridevirtual

◆ OnFile()

wxDirTraverseResult HeaderDirTraverser::OnFile ( const wxString filename)
overridevirtual

Member Data Documentation

◆ m_Dirs

size_t HeaderDirTraverser::m_Dirs
private

Definition at line 127 of file systemheadersthread.cpp.

Referenced by AddLock().

◆ m_Files

size_t HeaderDirTraverser::m_Files
private

Definition at line 130 of file systemheadersthread.cpp.

Referenced by AddLock().

◆ m_Headers

StringSet& HeaderDirTraverser::m_Headers
private

Definition at line 121 of file systemheadersthread.cpp.

Referenced by OnFile().

◆ m_Locked

bool HeaderDirTraverser::m_Locked
private

indicates whether the critical section is entered or not, used in AddLock() function

Definition at line 124 of file systemheadersthread.cpp.

Referenced by AddLock(), and ~HeaderDirTraverser().

◆ m_SearchDir

const wxString& HeaderDirTraverser::m_SearchDir
private

Definition at line 116 of file systemheadersthread.cpp.

Referenced by OnFile().

◆ m_SystemHeadersMap

const SystemHeadersMap& HeaderDirTraverser::m_SystemHeadersMap
private

Definition at line 93 of file systemheadersthread.cpp.

Referenced by GetStatus().

◆ m_SystemHeadersThreadCS

wxCriticalSection* HeaderDirTraverser::m_SystemHeadersThreadCS
private

Definition at line 86 of file systemheadersthread.cpp.

Referenced by AddLock(), and ~HeaderDirTraverser().

◆ m_Thread

wxThread* HeaderDirTraverser::m_Thread
private

Definition at line 83 of file systemheadersthread.cpp.

Referenced by OnDir(), and OnFile().


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