A class representing a unique identifier for expressions.
More...
#include <codac2_ExprBase.h>
|
| | ExprID () |
| | Default constructor.
|
| |
| Index | id () const |
| | Retrieves the unique identifier of the expression.
|
| |
| bool | operator== (const ExprID &i) const |
| | Equality operator.
|
| |
| bool | operator< (const ExprID &i) const |
| | Comparison operator.
|
| |
|
|
const Index | _id |
| | unique identifier, cannot be modified after initialization
|
| |
|
|
static Index | _id_counter |
| | static counter used to generate unique IDs for each ExprID object
|
| |
A class representing a unique identifier for expressions.
The ExprID class is used to assign and manage a unique identifier (Index type) for expressions. This identifier helps in distinguishing one expression from another, independently of its memory address. It is used for tracking and comparison of expressions within a larger system.
◆ ExprID()
| codac2::ExprID::ExprID |
( |
| ) |
|
Default constructor.
The default constructor generates a new unique ExprID by assigning it a new ID from a static counter. Each ExprID object created will have a unique identifier.
◆ id()
| Index codac2::ExprID::id |
( |
| ) |
const |
Retrieves the unique identifier of the expression.
- Returns
- The unique identifier.
◆ operator==()
| bool codac2::ExprID::operator== |
( |
const ExprID & | i | ) |
const |
Equality operator.
- Parameters
-
| i | The ExprID object to compare with. |
- Returns
true if the two ExprID objects have the same identifier, false otherwise.
◆ operator<()
| bool codac2::ExprID::operator< |
( |
const ExprID & | i | ) |
const |
Comparison operator.
This operator is used in sorting operations or other contexts requiring ordering.
- Parameters
-
| i | The ExprID object to compare with. |
- Returns
true if the unique identifier of the current object is less than that of i, false otherwise.
The documentation for this class was generated from the following file: