codac 2.0.0
Loading...
Searching...
No Matches
codac2::ExprID Class Reference

A class representing a unique identifier for expressions. More...

#include <codac2_ExprBase.h>

Public Member Functions

 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.
 

Protected Attributes

const Index _id
 unique identifier, cannot be modified after initialization
 

Static Protected Attributes

static Index _id_counter
 static counter used to generate unique IDs for each ExprID object
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ 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
iThe 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
iThe 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: