class int_pairs_to_points_map¶
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.
int_pairs_to_points_map Members¶
| Constructor | __init__() |
| Methods | __contains__(), __eq__(), __getitem__(), __hash__(), __ne__(), __repr__(), __str__(), get() |
int_pairs_to_points_map Details¶
-
class
cs.int_pairs_to_points_map¶ 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.-
__init__(sfi)¶ Constructor: create a new
int_pairs_to_points_maprepresenting the source location -> point set mapping for the specified source file instance.Parameters: sfi ( sfileinst) – The source file instance (sfileinst) of interest.Raises: result.NO_POSITIONif the source file instance does not have any position information, for example because it was generated by the back end.>>> sf = next(project.current().sfiles()) >>> int_pairs_to_points_map(sf.arbitrary_instance()) <cs.int_pairs_to_points_map ...>
-
__contains__(i)¶ Check: does an
int_pairs_to_points_mapinclude a nonempty mapping for a specified range of source locations?Parameters: i ((int, int)) – An (int, int) representing the range of source locations: i[0] denotes the start of the range;i[1] denotes the size of the range (follows the convention that this size is one less than the actual length of the range).Return type: bool Returns: Trueif theint_pairs_to_points_maphas at least onepointassociated with the source text between offseti[0] and offseti[0] +i[1], inclusive,Falseotherwise.Raises: OverflowError>>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> ippm = int_pairs_to_points_map(cu.get_sfileinst()) >>> (205, 12) in ippm True
-
__eq__(b)¶ Equality operator for
int_pairs_to_points_map.Parameters: b ( int_pairs_to_points_map) – Theint_pairs_to_points_mapobject to compare against.Return type: bool Returns: Trueifselfandbrefer to the same underlying map instance;Falseotherwise.>>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> ippm = int_pairs_to_points_map(cu.get_sfileinst()) >>> ippm == ippm True
-
__getitem__(i)¶ Find a
point_setfor a specified range of source locations, relative to anint_pairs_to_points_map.Parameters: i ((int, int)) – An (int, int) representing the range of source locations: i[0] denotes the start of the range;i[1] denotes the size of the range (follows the convention that this size is one less than the actual length of the range).Return type: point_setReturns: A point_setcontaining every vertex associated with the source text between offseti[0] and offseti[0] +i[1], inclusive.Raises: OverflowError>>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> ippm = int_pairs_to_points_map(cu.get_sfileinst()) >>> ippm[(205,12)] <cs.point_set {<cs.point [call-site] bar(int, void *, int)>, <cs.point [expression] x = _Z3bariPvi$result1>}>
-
__hash__()¶ Hash function for
int_pairs_to_points_map.Return type: int Returns: A hash of the int_pairs_to_points_map.>>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> ippm = int_pairs_to_points_map(cu.get_sfileinst()) >>> hash(ippm) 3233162384
-
__ne__(b)¶ Inquality operator for
int_pairs_to_points_map.Parameters: b ( int_pairs_to_points_map) – Theint_pairs_to_points_mapobject to compare against.Return type: bool Returns: Falseifselfandbrefer to the same underlying map instance;Trueotherwise.>>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> ippm = int_pairs_to_points_map(cu.get_sfileinst()) >>> ippm != ippm False
-
__repr__()¶ Get a representation of a
int_pairs_to_points_mapobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> ippm = int_pairs_to_points_map(cu.get_sfileinst()) >>> repr(ippm) '<cs.int_pairs_to_points_map ...>'
-
__str__()¶ Get a simple string representation of a
int_pairs_to_points_mapobject.Return type: str Returns: The string representation. >>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> ippm = int_pairs_to_points_map(cu.get_sfileinst()) >>> str(ippm) '<cs.int_pairs_to_points_map ...>'
-
get(i)¶ Find a
point_setfor a specified range of source locations, relative to anint_pairs_to_points_map.Parameters: i ((int, int)) – An (int, int) representing the range of source locations: i[0] denotes the start of the range;i[1] denotes the size of the range (follows the convention that this size is one less than the actual length of the range).Return type: point_setRaises: OverflowError>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> ippm = int_pairs_to_points_map(cu.get_sfileinst()) >>> ippm.get((205,12)) <cs.point_set {<cs.point [call-site] bar(int, void *, int)>, <cs.point [expression] x = _Z3bariPvi$result1>}>
-