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

A map int_pair_set -> point_set, where each entry represents the mapping from a source position to the set of points at that source position. More...

Public Member Functions

 int_pairs_to_points_map (sfileinst sfi)
 Constructor: create a new int_pairs_to_points_map representing the source location -> point set mapping for the specified source file instance. More...
 
std::string as_repr () const
 Get a representation of a int_pairs_to_points_map object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a int_pairs_to_points_map object. More...
 
bool contains (int_pair i) const
 Check: does an int_pairs_to_points_map include a nonempty mapping for a specified range of source locations? More...
 
cs_hash_t hash () const
 Hash function for int_pairs_to_points_map. More...
 
point_set operator[] (int_pair i) const
 Find a point_set for a specified range of source locations, relative to an int_pairs_to_points_map. More...
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const int_pairs_to_points_map &a, const int_pairs_to_points_map &b)
 Inquality operator for int_pairs_to_points_map. More...
 
std::ostream & operator<< (std::ostream &out, const int_pairs_to_points_map &a)
 Print a representation of an int_pairs_to_points_map object to the specified stream. More...
 
bool operator== (const int_pairs_to_points_map &a, const int_pairs_to_points_map &b)
 Equality operator for int_pairs_to_points_map. More...
 

Detailed Description

A map int_pair_set -> point_set, where each entry represents the mapping from a source position to the set of points at that source position.

Constructor & Destructor Documentation

◆ int_pairs_to_points_map()

cs::int_pairs_to_points_map::int_pairs_to_points_map ( sfileinst  sfi)
inline

Constructor: create a new int_pairs_to_points_map representing the source location -> point set mapping for the specified source file instance.

Parameters
[in]sfiThe source file instance (sfileinst) of interest.
Exceptions
result::NO_POSITIONif the source file instance does not have any position information, for example because it was generated by the back end.

Member Function Documentation

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a int_pairs_to_points_map object.

Returns
The string representation.

◆ contains()

bool cs::int_pairs_to_points_map::contains ( int_pair  i) const
inline

Check: does an int_pairs_to_points_map include a nonempty mapping for a specified range of source locations?

Parameters
[in]iAn int_pair representing the range of source locations: i.first denotes the start of the range; i.second denotes the size of the range (follows the convention that this size is one less than the actual length of the range).
Returns
true if the int_pairs_to_points_map has at least one point associated with the source text between offset i.first and offset i.first + i.second, inclusive, false otherwise.

◆ hash()

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

Hash function for int_pairs_to_points_map.

Returns
A hash of the int_pairs_to_points_map.

◆ operator[]()

point_set cs::int_pairs_to_points_map::operator[] ( int_pair  i) const
inline

Find a point_set for a specified range of source locations, relative to an int_pairs_to_points_map.

Parameters
[in]iAn int_pair representing the range of source locations: i.first denotes the start of the range; i.second denotes the size of the range (follows the convention that this size is one less than the actual length of the range).
Returns
A point_set containing every vertex associated with the source text between offset i.first and offset i.first + i.second, inclusive.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const int_pairs_to_points_map a,
const int_pairs_to_points_map b 
)
related

Inquality operator for int_pairs_to_points_map.

Parameters
[in]aThe int_pairs_to_points_map object to compare.
[in]bThe int_pairs_to_points_map object to compare against.
Returns
false if a and b refer to the same underlying map instance; true otherwise.

◆ operator<<()

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

Print a representation of an int_pairs_to_points_map object to the specified stream.

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

◆ operator==()

bool operator== ( const int_pairs_to_points_map a,
const int_pairs_to_points_map b 
)
related

Equality operator for int_pairs_to_points_map.

Parameters
[in]aThe int_pairs_to_points_map object to compare.
[in]bThe int_pairs_to_points_map object to compare against.
Returns
true if a and b refer to the same underlying map instance; false otherwise.

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