Cppcheck
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
LifetimeStore Struct Reference

Public Member Functions

 LifetimeStore ()=default
 
 LifetimeStore (const Token *argtok, std::string message, ValueFlow::Value::LifetimeKind type=ValueFlow::Value::LifetimeKind::Object, bool inconclusive=false)
 
template<class Predicate >
bool byRef (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, Predicate pred, SourceLocation loc=SourceLocation::current())
 
bool byRef (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current())
 
template<class Predicate >
bool byVal (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, Predicate pred, SourceLocation loc=SourceLocation::current())
 
bool byVal (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current())
 
template<class Predicate >
bool byDerefCopy (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, Predicate pred, SourceLocation loc=SourceLocation::current()) const
 
bool byDerefCopy (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current()) const
 

Static Public Member Functions

template<class F >
static void forEach (const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, const std::vector< const Token * > &argtoks, const std::string &message, ValueFlow::Value::LifetimeKind type, F f)
 
static LifetimeStore fromFunctionArg (const Function *f, const Token *tok, const Variable *var, const TokenList &tokenlist, const Settings &settings, ErrorLogger &errorLogger)
 

Public Attributes

const Tokenargtok {}
 
std::string message
 
ValueFlow::Value::LifetimeKind type = ValueFlow::Value::LifetimeKind::Object
 
ErrorPath errorPath
 
bool inconclusive {}
 
bool forward = true
 

Private Member Functions

void forwardLifetime (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings)
 

Private Attributes

TokenforwardTok {}
 

Detailed Description

Definition at line 4103 of file valueflow.cpp.

Constructor & Destructor Documentation

◆ LifetimeStore() [1/2]

LifetimeStore::LifetimeStore ( )
default

◆ LifetimeStore() [2/2]

LifetimeStore::LifetimeStore ( const Token argtok,
std::string  message,
ValueFlow::Value::LifetimeKind  type = ValueFlow::Value::LifetimeKind::Object,
bool  inconclusive = false 
)
inline

Definition at line 4113 of file valueflow.cpp.

Member Function Documentation

◆ byDerefCopy() [1/2]

template<class Predicate >
bool LifetimeStore::byDerefCopy ( Token tok,
const TokenList tokenlist,
ErrorLogger errorLogger,
const Settings settings,
Predicate  pred,
SourceLocation  loc = SourceLocation::current() 
) const
inline

◆ byDerefCopy() [2/2]

bool LifetimeStore::byDerefCopy ( Token tok,
const TokenList tokenlist,
ErrorLogger errorLogger,
const Settings settings,
SourceLocation  loc = SourceLocation::current() 
) const
inline

Definition at line 4358 of file valueflow.cpp.

References byDerefCopy().

◆ byRef() [1/2]

template<class Predicate >
bool LifetimeStore::byRef ( Token tok,
const TokenList tokenlist,
ErrorLogger errorLogger,
const Settings settings,
Predicate  pred,
SourceLocation  loc = SourceLocation::current() 
)
inline

◆ byRef() [2/2]

bool LifetimeStore::byRef ( Token tok,
const TokenList tokenlist,
ErrorLogger errorLogger,
const Settings settings,
SourceLocation  loc = SourceLocation::current() 
)
inline

Definition at line 4209 of file valueflow.cpp.

References byRef().

◆ byVal() [1/2]

template<class Predicate >
bool LifetimeStore::byVal ( Token tok,
const TokenList tokenlist,
ErrorLogger errorLogger,
const Settings settings,
Predicate  pred,
SourceLocation  loc = SourceLocation::current() 
)
inline

◆ byVal() [2/2]

bool LifetimeStore::byVal ( Token tok,
const TokenList tokenlist,
ErrorLogger errorLogger,
const Settings settings,
SourceLocation  loc = SourceLocation::current() 
)
inline

Definition at line 4304 of file valueflow.cpp.

References byVal().

◆ forEach()

template<class F >
static void LifetimeStore::forEach ( const TokenList tokenlist,
ErrorLogger errorLogger,
const Settings settings,
const std::vector< const Token * > &  argtoks,
const std::string &  message,
ValueFlow::Value::LifetimeKind  type,
f 
)
inlinestatic

◆ forwardLifetime()

void LifetimeStore::forwardLifetime ( Token tok,
const TokenList tokenlist,
ErrorLogger errorLogger,
const Settings settings 
)
inlineprivate

Definition at line 4378 of file valueflow.cpp.

References forwardTok, and valueFlowForwardLifetime().

Referenced by byRef(), and byVal().

◆ fromFunctionArg()

static LifetimeStore LifetimeStore::fromFunctionArg ( const Function f,
const Token tok,
const Variable var,
const TokenList tokenlist,
const Settings settings,
ErrorLogger errorLogger 
)
inlinestatic

Member Data Documentation

◆ argtok

const Token* LifetimeStore::argtok {}

◆ errorPath

ErrorPath LifetimeStore::errorPath

Definition at line 4107 of file valueflow.cpp.

Referenced by byDerefCopy(), byRef(), byVal(), and valueFlowLifetimeFunction().

◆ forward

bool LifetimeStore::forward = true

Definition at line 4109 of file valueflow.cpp.

Referenced by byRef(), byVal(), and valueFlowLifetimeFunction().

◆ forwardTok

Token* LifetimeStore::forwardTok {}
private

Definition at line 4377 of file valueflow.cpp.

Referenced by forwardLifetime().

◆ inconclusive

bool LifetimeStore::inconclusive {}

◆ message

std::string LifetimeStore::message

Definition at line 4105 of file valueflow.cpp.

Referenced by byDerefCopy(), byRef(), byVal(), and forEach().

◆ type

Definition at line 4106 of file valueflow.cpp.

Referenced by byDerefCopy(), byRef(), byVal(), and forEach().


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