Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
Variable::Id Class Reference

Detailed Description

Identifier for a symbolic variable.

Variable equality is defined by whether their Ids are equal (i.e., ignoring Variable names). Ids are akin to UUIDs because Ids contain a large number of random bits so are unique not only within a single process, but also across multiple runs of programs over time. On the other hand, we also guarantee that all Ids created within a single process have consistent behavior in their comparison (operator<) and hashing operators, so that any single program is still run-to-run consistent.

#include <drake/common/symbolic/expression/variable.h>

Public Member Functions

 Id ()=default
 Constructs a "dummy" id, not associated with any variable.
auto operator<=> (const Id &) const =default
 Default comparison operators.
std::string to_string () const
 Returns a string representation of this Id.
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Id (const Id &)=default
Idoperator= (const Id &)=default
 Id (Id &&)=default
Idoperator= (Id &&)=default

Friends

class Variable
class VariableIdPythonAttorney
template<class HashAlgorithm>
void hash_append (HashAlgorithm &hasher, const Id &item) noexcept
 Implements the hash_append generic hashing concept.

Constructor & Destructor Documentation

◆ Id() [1/3]

Id ( const Id & )
default

◆ Id() [2/3]

Id ( Id && )
default

◆ Id() [3/3]

Id ( )
default

Constructs a "dummy" id, not associated with any variable.

Member Function Documentation

◆ operator<=>()

auto operator<=> ( const Id & ) const
default

Default comparison operators.

◆ operator=() [1/2]

Id & operator= ( const Id & )
default

◆ operator=() [2/2]

Id & operator= ( Id && )
default

◆ to_string()

std::string to_string ( ) const

Returns a string representation of this Id.

◆ hash_append

template<class HashAlgorithm>
void hash_append ( HashAlgorithm & hasher,
const Id & item )
friend

Implements the hash_append generic hashing concept.

◆ Variable

friend class Variable
friend

◆ VariableIdPythonAttorney

friend class VariableIdPythonAttorney
friend

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