Cppcheck
Public Member Functions | Private Member Functions | Static Private Member Functions
CheckMemoryLeakInClass Class Reference

Check class variables, variables that are allocated in the constructor should be deallocated in the destructor More...

#include <checkmemoryleak.h>

Inheritance diagram for CheckMemoryLeakInClass:
Check CheckMemoryLeak

List of all members.

Public Member Functions

 CheckMemoryLeakInClass ()
 CheckMemoryLeakInClass (const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog)
void runSimplifiedChecks (const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog)
 run checks, the token list is simplified
void check ()

Private Member Functions

void variable (const Scope *scope, const Token *tokVarname)
void checkPublicFunctions (const Scope *scope, const Token *classtok)
 Public functions: possible double-allocation.
void publicAllocationError (const Token *tok, const std::string &varname)
void unsafeClassError (const Token *tok, const std::string &classname, const std::string &varname)
void getErrorMessages (ErrorLogger *e, const Settings *settings) const
 get error messages
std::string classInfo () const
 get information about this class, used to generate documentation

Static Private Member Functions

static std::string myName ()

Detailed Description

Check class variables, variables that are allocated in the constructor should be deallocated in the destructor

Definition at line 351 of file checkmemoryleak.h.


Constructor & Destructor Documentation

Definition at line 353 of file checkmemoryleak.h.

CheckMemoryLeakInClass::CheckMemoryLeakInClass ( const Tokenizer tokenizr,
const Settings settings,
ErrorLogger errLog 
) [inline]

Definition at line 356 of file checkmemoryleak.h.


Member Function Documentation

void CheckMemoryLeakInClass::checkPublicFunctions ( const Scope scope,
const Token classtok 
) [private]
std::string CheckMemoryLeakInClass::classInfo ( ) const [inline, private, virtual]

get information about this class, used to generate documentation

Implements Check.

Definition at line 389 of file checkmemoryleak.h.

void CheckMemoryLeakInClass::getErrorMessages ( ErrorLogger errorLogger,
const Settings settings 
) const [inline, private, virtual]

get error messages

Implements Check.

Definition at line 379 of file checkmemoryleak.h.

References publicAllocationError(), and unsafeClassError().

static std::string CheckMemoryLeakInClass::myName ( ) [inline, static, private]

Definition at line 385 of file checkmemoryleak.h.

void CheckMemoryLeakInClass::publicAllocationError ( const Token tok,
const std::string &  varname 
) [private]

Definition at line 2531 of file checkmemoryleak.cpp.

References Check::reportError(), and Severity::warning.

Referenced by checkPublicFunctions(), and getErrorMessages().

void CheckMemoryLeakInClass::runSimplifiedChecks ( const Tokenizer tokenizer,
const Settings settings,
ErrorLogger errorLogger 
) [inline, virtual]

run checks, the token list is simplified

Implements Check.

Definition at line 360 of file checkmemoryleak.h.

References check(), and Tokenizer::isCPP().

void CheckMemoryLeakInClass::unsafeClassError ( const Token tok,
const std::string &  classname,
const std::string &  varname 
) [private]

Definition at line 2485 of file checkmemoryleak.cpp.

References Check::reportError(), and Severity::style.

Referenced by getErrorMessages(), and variable().

void CheckMemoryLeakInClass::variable ( const Scope scope,
const Token tokVarname 
) [private]

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