Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
CodeGenVisitor Class Reference

Detailed Description

Visitor class for code generation.

#include <drake/common/symbolic/codegen.h>

Public Types

using IdToIndexMap

Public Member Functions

 CodeGenVisitor (const std::vector< Variable > &parameters)
 Constructs an instance of this visitor class using the vector of variables, parameters.
std::string CodeGen (const Expression &e) const
 Generates C expression for the expression e.
Does not allow copy, move, or assignment
 CodeGenVisitor (const CodeGenVisitor &)=delete
CodeGenVisitoroperator= (const CodeGenVisitor &)=delete
 CodeGenVisitor (CodeGenVisitor &&)=delete
CodeGenVisitoroperator= (CodeGenVisitor &&)=delete

Friends

std::string VisitExpression (const CodeGenVisitor *, const Expression &)

Member Typedef Documentation

◆ IdToIndexMap

using IdToIndexMap
Initial value:
std::unordered_map<Variable::Id, std::vector<Variable>::size_type>

Constructor & Destructor Documentation

◆ CodeGenVisitor() [1/3]

CodeGenVisitor ( const CodeGenVisitor & )
delete

◆ CodeGenVisitor() [2/3]

◆ CodeGenVisitor() [3/3]

CodeGenVisitor ( const std::vector< Variable > & parameters)
explicit

Constructs an instance of this visitor class using the vector of variables, parameters.

This visitor will map a symbolic variable var into p[n] where n is the index of the variable var in the given parameters.

Member Function Documentation

◆ CodeGen()

std::string CodeGen ( const Expression & e) const
nodiscard

Generates C expression for the expression e.

◆ operator=() [1/2]

CodeGenVisitor & operator= ( CodeGenVisitor && )
delete

◆ operator=() [2/2]

CodeGenVisitor & operator= ( const CodeGenVisitor & )
delete

◆ VisitExpression

std::string VisitExpression ( const CodeGenVisitor * ,
const Expression &  )
friend

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