RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
Mathematica::Function Class Reference

A user definable function expression. More...

#include <Mathematica.hpp>

Inherits Mathematica::FunctionBase.

Public Types

typedef rw::core::Ptr< FunctionPtr
 Smart pointer type.
 
- Public Types inherited from Mathematica::FunctionBase
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

 Function (const std::string &name)
 Construct new function. More...
 
void setName (const std::string &name)
 Change the name of the function. More...
 
void addArgument (const AutoExpression &arg)
 Append argument. More...
 
void addArgument (const Expression::Ptr arg)
 Append argument. More...
 
void addArguments (const std::list< Expression::Ptr > &args)
 Append list of arguments. More...
 
void setArgument (std::size_t i, Expression::Ptr arg)
 Change argument. More...
 
virtual std::list< rw::core::Ptr< const Expression > > getArguments () const
 Get a list of arguments for this function. More...
 
virtual std::list< Expression::PtrgetArguments ()
 Get a list of arguments for this function. More...
 
virtual Expression::Ptr clone () const
 Make a copy of the expression. More...
 
- Public Member Functions inherited from Mathematica::FunctionBase
 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 void out (std::ostream &stream, std::size_t indent) const
 Print function by using indentations. More...
 

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...
 
- Protected Attributes inherited from Mathematica::FunctionBase
std::string _name
 Name of the function.
 

Detailed Description

A user definable function expression.

Constructor & Destructor Documentation

◆ Function()

Function ( const std::string &  name)

Construct new function.

Parameters
name[in] the name of the function.

Member Function Documentation

◆ addArgument() [1/2]

void addArgument ( const AutoExpression arg)

Append argument.

Parameters
arg[in] the argument.

◆ addArgument() [2/2]

void addArgument ( const Expression::Ptr  arg)

Append argument.

Parameters
arg[in] the argument.

◆ addArguments()

void addArguments ( const std::list< Expression::Ptr > &  args)

Append list of arguments.

Parameters
args[in] the list.

◆ clone()

virtual Expression::Ptr clone ( ) const
virtual

Make a copy of the expression.

Returns
a new copy.

Implements Mathematica::Expression.

◆ getArguments() [1/2]

virtual std::list<Expression::Ptr> getArguments ( )
virtual

Get a list of arguments for this function.

Returns
list of arguments.

◆ getArguments() [2/2]

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

Get a list of arguments for this function.

Returns
list of arguments.

Implements Mathematica::FunctionBase.

◆ setArgument()

void setArgument ( std::size_t  i,
Expression::Ptr  arg 
)

Change argument.

Parameters
i[in] index.
arg[in] new argument.

◆ setName()

void setName ( const std::string &  name)

Change the name of the function.

Parameters
name[in] the new name.

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