libqasm
library for handling cQASM files
Public Member Functions | List of all members
func_gen::Generator Class Reference

Generator class. More...

Public Member Functions

void generate_const_scalar_op (const std::string &name, const char return_type, const std::string &arg_types, const std::string &impl)
 Generates a basic constant scalar function, such as integer addition for instance. More...
 
 Generator (const std::string &header_filename, const std::string &source_filename)
 Constructs a generator for the function table. More...
 
 ~Generator ()
 Finishes writing the header & source file, then destroys the generator. More...
 

Detailed Description

Generator class.

Definition at line 138 of file func-gen.cpp.

Constructor & Destructor Documentation

◆ Generator()

func_gen::Generator::Generator ( const std::string &  header_filename,
const std::string &  source_filename 
)
inline

Constructs a generator for the function table.

Definition at line 286 of file func-gen.cpp.

◆ ~Generator()

func_gen::Generator::~Generator ( )
inline

Finishes writing the header & source file, then destroys the generator.

Definition at line 365 of file func-gen.cpp.

Member Function Documentation

◆ generate_const_scalar_op()

void func_gen::Generator::generate_const_scalar_op ( const std::string &  name,
const char  return_type,
const std::string &  arg_types,
const std::string &  impl 
)
inline

Generates a basic constant scalar function, such as integer addition for instance.

name must be the cQASM name for the function (either just the function name or operator+ etc), return_type must be the return type code, arg_types must be the argument type codes, and impl must be a C++ expression implementing the function, operating on variables a..z representing the arguments, and returning the primitive value associated with return_type.

Definition at line 273 of file func-gen.cpp.


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