Cppcheck
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Executor Class Referenceabstract

This class will take a list of filenames and settings and check then all files using threads. More...

#include <executor.h>

Inheritance diagram for Executor:
ProcessExecutor SingleExecutor ThreadExecutor

Public Member Functions

 Executor (const std::list< FileWithDetails > &files, const std::list< FileSettings > &fileSettings, const Settings &settings, SuppressionList &suppressions, ErrorLogger &errorLogger)
 
virtual ~Executor ()=default
 
 Executor (const Executor &)=delete
 
Executoroperator= (const Executor &)=delete
 
virtual unsigned int check ()=0
 
void reportStatus (std::size_t fileindex, std::size_t filecount, std::size_t sizedone, std::size_t sizetotal)
 Information about how many files have been checked. More...
 

Protected Member Functions

bool hasToLog (const ErrorMessage &msg)
 Check if message is being suppressed and unique. More...
 

Protected Attributes

const std::list< FileWithDetails > & mFiles
 
const std::list< FileSettings > & mFileSettings
 
const SettingsmSettings
 
SuppressionListmSuppressions
 
ErrorLoggermErrorLogger
 

Private Attributes

std::mutex mErrorListSync
 
std::unordered_set< std::string > mErrorList
 

Detailed Description

This class will take a list of filenames and settings and check then all files using threads.

Definition at line 43 of file executor.h.

Constructor & Destructor Documentation

◆ Executor() [1/2]

Executor::Executor ( const std::list< FileWithDetails > &  files,
const std::list< FileSettings > &  fileSettings,
const Settings settings,
SuppressionList suppressions,
ErrorLogger errorLogger 
)

Definition at line 33 of file executor.cpp.

◆ ~Executor()

virtual Executor::~Executor ( )
virtualdefault

◆ Executor() [2/2]

Executor::Executor ( const Executor )
delete

Member Function Documentation

◆ check()

virtual unsigned int Executor::check ( )
pure virtual

◆ hasToLog()

bool Executor::hasToLog ( const ErrorMessage msg)
protected

Check if message is being suppressed and unique.

Parameters
msgthe message to check
Returns
true if message is not suppressed and unique

Definition at line 41 of file executor.cpp.

References ErrorMessage::file0, SuppressionList::isSuppressed(), Settings::library, mErrorList, mErrorListSync, mSettings, mSuppressions, Library::reportErrors(), ErrorMessage::toString(), and Settings::verbose.

Referenced by ProcessExecutor::handleRead(), and SyncLogForwarder::reportErr().

◆ operator=()

Executor& Executor::operator= ( const Executor )
delete

◆ reportStatus()

void Executor::reportStatus ( std::size_t  fileindex,
std::size_t  filecount,
std::size_t  sizedone,
std::size_t  sizetotal 
)

Information about how many files have been checked.

Parameters
fileindexThis many files have been checked.
filecountThis many files there are in total.
sizedoneThe sum of sizes of the files checked.
sizetotalThe total sizes of the files.

Definition at line 61 of file executor.cpp.

References FgBlue, mErrorLogger, and ErrorLogger::reportOut().

Referenced by ProcessExecutor::check(), SingleExecutor::check(), and SyncLogForwarder::reportStatus().

Member Data Documentation

◆ mErrorList

std::unordered_set<std::string> Executor::mErrorList
private

Definition at line 80 of file executor.h.

Referenced by hasToLog().

◆ mErrorListSync

std::mutex Executor::mErrorListSync
private

Definition at line 78 of file executor.h.

Referenced by hasToLog().

◆ mErrorLogger

ErrorLogger& Executor::mErrorLogger
protected

◆ mFiles

const std::list<FileWithDetails>& Executor::mFiles
protected

Definition at line 71 of file executor.h.

Referenced by ProcessExecutor::check(), SingleExecutor::check(), and ThreadExecutor::check().

◆ mFileSettings

const std::list<FileSettings>& Executor::mFileSettings
protected

Definition at line 72 of file executor.h.

Referenced by ProcessExecutor::check(), SingleExecutor::check(), and ThreadExecutor::check().

◆ mSettings

const Settings& Executor::mSettings
protected

◆ mSuppressions

SuppressionList& Executor::mSuppressions
protected

Definition at line 74 of file executor.h.

Referenced by hasToLog(), and ProcessExecutor::reportInternalChildErr().


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