Drake
CodeGenVisitor Class Reference

Visitor class for code generation. More...

#include <drake/common/symbolic_codegen.h>

Public Types

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

Public Member Functions

 CodeGenVisitor (const std::vector< Variable > &parameters)
 Constructs an instance of this visitor class using the vector of variables, parameters. More...
 
std::string CodeGen (const Expression &e) const
 Generates C expression for the expression e. More...
 
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 &)
 

Detailed Description

Visitor class for code generation.

Member Typedef Documentation

◆ IdToIndexMap

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

Constructor & Destructor Documentation

◆ CodeGenVisitor() [1/3]

CodeGenVisitor ( const CodeGenVisitor )
delete

◆ CodeGenVisitor() [2/3]

CodeGenVisitor ( CodeGenVisitor &&  )
delete

◆ 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()

string CodeGen ( const Expression e) const

Generates C expression for the expression e.

◆ operator=() [1/2]

CodeGenVisitor& operator= ( const CodeGenVisitor )
delete

◆ operator=() [2/2]

CodeGenVisitor& operator= ( CodeGenVisitor &&  )
delete

Friends And Related Function Documentation

◆ VisitExpression

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

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