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 IdToIndexMap &id_to_idx_map)
 Constructs an instance of this visitor class from id_to_idx_map. 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 IdToIndexMap id_to_idx_map)
explicit

Constructs an instance of this visitor class from id_to_idx_map.

Note
This class keeps a constant reference of id_to_idx_map. So id_to_idx_map should outlive this visitor object.

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: