CodeSonar C++ API
[For improved navigation, enable JavaScript.]
Public Types | Public Member Functions | Related Functions | List of all members
cs::step_path Class Reference

Used by the warningclass report() and report_return_warnings() methods that report a warning with a step path, and by step visitors (step_state), as added with analysis::add_step_bottom_up_visitor(). More...

Public Types

typedef cs_step_path_t ctype
 

Public Member Functions

 step_path (const step_path &other)
 Copy constructor. More...
 
 ~step_path ()
 Destructor. More...
 
std::string as_repr () const
 Get a representation of a step_path object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a step_path object. More...
 
cs_hash_t hash () const
 Get a hash value for a step_path. More...
 
std::vector< cs::cfg_path_nodeto_cfg_node_vector () const
 Get the list of cfg_path_node nodes corresponding to a step_path. More...
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &out, const step_path &a)
 Print a representation of a step_path object to the specified stream. More...
 

Detailed Description

Used by the warningclass report() and report_return_warnings() methods that report a warning with a step path, and by step visitors (step_state), as added with analysis::add_step_bottom_up_visitor().

The standard use case is as follows.

  1. A user decides to implement a new check that requires a step visitor. They create subclass S of step_state to implement the visitor, and a new warningclass W for the warnings issued by the check.
  2. They define S.transition() to perform the appropriate checks on its arguments. These arguments include a step_path object path, which may be examined as part of the checks.
  3. If these checks indicate a warning should be issued, S.transition() calls W.report(path,...) or W.report_return_warning(path,...) to report the warning.

Constructor & Destructor Documentation

◆ step_path()

cs::step_path::step_path ( const step_path other)
inline

Copy constructor.

◆ ~step_path()

cs::step_path::~step_path ( )
inline

Destructor.

Member Function Documentation

◆ as_repr()

std::string cs::step_path::as_repr ( ) const
inline

Get a representation of a step_path object that includes information useful for debugging.

Returns
The string representation.

◆ as_string()

std::string cs::step_path::as_string ( ) const
inline

Get a simple string representation of a step_path object.

Returns
The string representation.

◆ hash()

cs_hash_t cs::step_path::hash ( ) const
inline

Get a hash value for a step_path.

◆ to_cfg_node_vector()

std::vector<cs::cfg_path_node> cs::step_path::to_cfg_node_vector ( ) const
inline

Get the list of cfg_path_node nodes corresponding to a step_path.

Returns
The list of cfg_path_node nodes corresponding to the step path.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const step_path a 
)
related

Print a representation of a step_path object to the specified stream.

Parameters
[in]outThe stream to print to.
[in]aThe step_path object to print.
Returns
void

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