libabigail
snake Class Reference

The abstraction of the Snake concept, from the paper. More...

`#include <abg-diff-utils.h>`

## Public Member Functions

snake ()
Default constructor for snake. More...

snake (const point &b, const point &i, const point &d, const point &e)
Constructor from the beginning, intermediate and end points. More...

snake (const point &b, const point &i, const point &e)
Constructor from the beginning, intermediate and end points. More...

void add (int x_offset, int y_offset)
Add an offset to the abscissas of the points of the snake, and add another offset to the ordinates of these same points. More...

const pointbegin () const
Getter for the starting point of the non-diagonal edge of the snake. More...

void begin (const point &p)
Getter for the starting point of the non-diagonal edge of the snake, aka begin point. More...

const pointdiagonal_start () const
Getter for the end point of the first diagonal edge, aka diagonal start point. Note that if the snake has no diagonal edge, this point is empty. More...

void diagonal_start (const point &p)
Setter for the end point of the first diagonal edge, aka diagonal start point. More...

const pointend () const
Getter for the end point of the last diagonal edge, aka snake end point. Note that if the snake has no diagonal edge, this point is equal to the intermediate point. More...

void end (const point &p)
Setter for the end point of the last diagonal edge, aka snake end point. Note that if the snake has no diagonal edge, this point is equal to the intermediate point. More...

bool has_diagonal_edge () const

bool has_horizontal_edge () const

bool has_vertical_edge () const

const pointintermediate () const
Getter for the end point of the non-diagonal edge of the snake. More...

void intermediate (const point &p)
Setter for the end point of the non-diagonal edge of the snake, aka intermediate point. More...

bool is_empty () const

bool is_forward () const

void set (const point &b, const point &i, const point &d, const point &e)
Setter for the begin, intermediate, diagonal start and end points of the snake. More...

void set (const point &b, const point &i, const point &e)
Setter for the begin, intermediate and end points of the snake. More...

void set_forward (bool f)
Set to true if the snake is a forward snake; that is, if it was built while walking the edit graph going forward (from the top left corner to the right bottom corner. Set to false otherwise. More...

## Detailed Description

The abstraction of the Snake concept, from the paper.

In a given path from the edit graph, a snake is a non-diagonal edge followed by zero or more diagonal edges.

The starting poing of the non-diagonal edge is the beginning of the snake. This is given by the snake::begin() method. This point is not explicitely referenced in the paper, but we need it for some grunt implementation details of the algorithm.

The end point of the non-diagonal edge is the intermediate point of the snake; it's given by the snake::intermediate() method. This point is what is referred to as "the begining of the snake" in the paper.

The end point of the first diagonal edge is given by the snake::diagonal_start() method.

The end point of the last diagonal edge is given by the snake::end() method. Note that when the snake contains no diagonal edge, snake::intermediate(), and snake::end() return the same point; snake::diagonal_start() contains an empty point (i.e, a point for which point::is_empty() returns true).

Definition at line 243 of file abg-diff-utils.h.

## ◆ snake() [1/3]

 snake ( )
inline

Default constructor for snake.

Definition at line 251 of file abg-diff-utils.h.

## ◆ snake() [2/3]

 snake ( const point & b, const point & i, const point & e )
inline

Constructor from the beginning, intermediate and end points.

Parameters
 b the beginning point of the snake. That is, the starting point of the non-diagonal edge. i the intermediate point of the snake. That is, the end point of the non-diagonal edge. e the end point of the snake. That is the end point of the last diagonal edge.

Definition at line 265 of file abg-diff-utils.h.

## ◆ snake() [3/3]

 snake ( const point & b, const point & i, const point & d, const point & e )
inline

Constructor from the beginning, intermediate and end points.

Parameters
 b the beginning point of the snake. That is, the starting point of the non-diagonal edge. i the intermediate point of the snake. That is, the end point of the non-diagonal edge. d the beginning of the diagonal edge. That is the end of the first diagonal edge of the snake. e the end point of the snake. That is the end point of the last diagonal edge.

Definition at line 285 of file abg-diff-utils.h.

## Member Function Documentation

 void add ( int x_offset, int y_offset )
inline

Add an offset to the abscissas of the points of the snake, and add another offset to the ordinates of these same points.

Parameters
 x_offset the offset to add to the abscissas of all the points of the snake. y_offset the offset to add to the ordinates of all the points of the snake.

Definition at line 417 of file abg-diff-utils.h.

## ◆ begin() [1/2]

 const point& begin ( ) const
inline

Getter for the starting point of the non-diagonal edge of the snake.

Returns
the starting point of the non-diagonal edge of the snake

Definition at line 299 of file abg-diff-utils.h.

## ◆ begin() [2/2]

 void begin ( const point & p )
inline

Getter for the starting point of the non-diagonal edge of the snake, aka begin point.

Parameters
 p the new begin point.

Definition at line 307 of file abg-diff-utils.h.

## ◆ diagonal_start() [1/2]

 const point& diagonal_start ( ) const
inline

Getter for the end point of the first diagonal edge, aka diagonal start point. Note that if the snake has no diagonal edge, this point is empty.

Returns
the end point of the first diagonal edge.

Definition at line 331 of file abg-diff-utils.h.

## ◆ diagonal_start() [2/2]

 void diagonal_start ( const point & p )
inline

Setter for the end point of the first diagonal edge, aka diagonal start point.

Parameters
 p the new diagonal start.d

Definition at line 339 of file abg-diff-utils.h.

## ◆ end() [1/2]

 const point& end ( ) const
inline

Getter for the end point of the last diagonal edge, aka snake end point. Note that if the snake has no diagonal edge, this point is equal to the intermediate point.

Returns
the end point of the last diagonal edge

Definition at line 348 of file abg-diff-utils.h.

## ◆ end() [2/2]

 void end ( const point & p )
inline

Setter for the end point of the last diagonal edge, aka snake end point. Note that if the snake has no diagonal edge, this point is equal to the intermediate point.

Definition at line 355 of file abg-diff-utils.h.

## ◆ has_diagonal_edge()

 bool has_diagonal_edge ( ) const
inline
Returns
true iff the snake has at least one diagonal edge.

Definition at line 431 of file abg-diff-utils.h.

## ◆ has_horizontal_edge()

 bool has_horizontal_edge ( ) const
inline
Returns
true iff the non-diagonal edge is horizontal.

Definition at line 436 of file abg-diff-utils.h.

## ◆ has_vertical_edge()

 bool has_vertical_edge ( ) const
inline
Returns
true iff the non-diagonal edge is vertical.

Definition at line 441 of file abg-diff-utils.h.

## ◆ intermediate() [1/2]

 const point& intermediate ( ) const
inline

Getter for the end point of the non-diagonal edge of the snake.

Returns
the end point of the non-diagonal edge of the snake

Definition at line 314 of file abg-diff-utils.h.

## ◆ intermediate() [2/2]

 void intermediate ( const point & p )
inline

Setter for the end point of the non-diagonal edge of the snake, aka intermediate point.

Parameters
 p the new intermediate point.

Definition at line 322 of file abg-diff-utils.h.

## ◆ is_empty()

 bool is_empty ( ) const
inline
Returns
true iff the snake is empty, that is, if all the points it contains are empty.

Definition at line 446 of file abg-diff-utils.h.

## ◆ is_forward()

 bool is_forward ( ) const
inline
Returns
true iff the snake is a forward snake. That is, if it was built while walking the edit graph going forward (from the top left corner to the right bottom corner.

Definition at line 396 of file abg-diff-utils.h.

## ◆ set() [1/2]

 void set ( const point & b, const point & i, const point & d, const point & e )
inline

Setter for the begin, intermediate, diagonal start and end points of the snake.

Parameters
 b the new snake begin point i the new snake intermediate point d the new diagonal start point e the new snake end point

Definition at line 384 of file abg-diff-utils.h.

## ◆ set() [2/2]

 void set ( const point & b, const point & i, const point & e )
inline

Setter for the begin, intermediate and end points of the snake.

Parameters
 b the new snake begin point i the new snake intermediate point e the new snake end point

Definition at line 366 of file abg-diff-utils.h.

## ◆ set_forward()

 void set_forward ( bool f )
inline

Set to true if the snake is a forward snake; that is, if it was built while walking the edit graph going forward (from the top left corner to the right bottom corner. Set to false otherwise.

Parameters
 f whether the snake is a forward snake or not.

Definition at line 405 of file abg-diff-utils.h.

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