RobWorkProject  23.9.11-
Public Types | Public Member Functions | Protected Attributes | List of all members
Mathematica::FunctionBase Class Referenceabstract

A base interface for function expressions. More...

#include <Mathematica.hpp>

Inherits Mathematica::Expression.

Inherited by FactorInteger, Image, List, ListPlot, Mathematica::Function, Mathematica::Packet, Rule, and ToExpression.

Public Types

typedef rw::core::Ptr< FunctionBasePtr
 Smart pointer type.
 
- Public Types inherited from Mathematica::Expression
enum  Type {
  String , Integer , Real , Symbol ,
  Function , Array
}
 Type of expression. More...
 
typedef rw::core::Ptr< ExpressionPtr
 Smart pointer type.
 
typedef enum rwlibs::mathematica::Mathematica::Expression::Type Type
 Type of expression.
 

Public Member Functions

 FunctionBase (const std::string &name)
 Construct new function. More...
 
std::string getName () const
 Get the name of the function. More...
 
Type getType () const
 Get the type of expression. More...
 
virtual void out (std::ostream &stream) const
 Print to output stream. More...
 
virtual std::list< rw::core::Ptr< const Expression > > getArguments () const =0
 Get a list of arguments for this function. More...
 
virtual void out (std::ostream &stream, std::size_t indent) const
 Print function by using indentations. More...
 
- Public Member Functions inherited from Mathematica::Expression
virtual Expression::Ptr clone () const =0
 Make a copy of the expression. More...
 

Protected Attributes

std::string _name
 Name of the function.
 

Additional Inherited Members

- Static Protected Member Functions inherited from Mathematica::Expression
template<typename Type >
static void toList (std::list< rw::core::Ptr< Type >> &)
 Helper function for extracting a list of arguments when given as a variable number of arguments. More...
 
template<typename Type , typename Exp , typename... T>
static void toList (std::list< rw::core::Ptr< Type >> &list, const Exp &r, T... t)
 Helper function for extracting a list of arguments when given as a variable number of arguments. More...
 

Detailed Description

A base interface for function expressions.

Constructor & Destructor Documentation

◆ FunctionBase()

FunctionBase ( const std::string &  name)

Construct new function.

Parameters
name[in] the name of the function.

Member Function Documentation

◆ getArguments()

virtual std::list<rw::core::Ptr<const Expression> > getArguments ( ) const
pure virtual

◆ getName()

std::string getName ( ) const

Get the name of the function.

Returns
the name of the function.

◆ getType()

Type getType ( ) const
virtual

Get the type of expression.

Returns
the type.

Implements Mathematica::Expression.

◆ out() [1/2]

virtual void out ( std::ostream &  stream) const
virtual

Print to output stream.

Parameters
stream[in/out] the stream to print to.

Implements Mathematica::Expression.

◆ out() [2/2]

virtual void out ( std::ostream &  stream,
std::size_t  indent 
) const
virtual

Print function by using indentations.

Parameters
stream[in/out] the output stream.
indent[in] the amount of indentation.

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