RobWorkProject  23.9.11-
Public Types | Public Member Functions | Static Public Member Functions | List of all members

Representation of the Mathematica List function. More...

#include <List.hpp>

Inherits Mathematica::FunctionBase.

Public Types

typedef rw::core::Ptr< ListPtr
 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

 List ()
 Construct empty list.
 
 List (const std::vector< Mathematica::Expression::Ptr > &args)
 Construct list from a vector of arguments. More...
 
 List (const std::list< rw::core::Ptr< const Mathematica::Expression >> &args)
 Construct list from a list of arguments. More...
 
template<typename... Exp>
 List (const Exp &... expressions)
 Construct new list from variable number of arguments. More...
 
virtual ~List ()
 Destructor.
 
virtual std::list< rw::core::Ptr< const Mathematica::Expression > > getArguments () const
 Get a list of arguments for this function. More...
 
virtual Mathematica::Expression::Ptr clone () const
 Make a copy of the expression. More...
 
Mathematica::Expression::Ptr operator[] (std::size_t i)
 Get expression at some location in the list. More...
 
rw::core::Ptr< const Mathematica::Expressionoperator[] (std::size_t i) const
 Get expression at some location in the list. More...
 
Listadd (Mathematica::Expression::Ptr expression)
 Add an expression to list. More...
 
Listadd (const Mathematica::AutoExpression &expression)
 Add an expression to list. More...
 
void set (std::size_t i, Mathematica::Expression::Ptr expression)
 Overwrite a specific expression in list. 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...
 

Static Public Member Functions

static List::Ptr fromExpression (const Mathematica::Expression &exp)
 Parse a list from a generic expression. More...
 
template<typename T >
static List::Ptr toList (const T &vector)
 Convert a RobWork vector to a Mathematica list. 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

Representation of the Mathematica List function.

Constructor & Destructor Documentation

◆ List() [1/3]

List ( const std::vector< Mathematica::Expression::Ptr > &  args)

Construct list from a vector of arguments.

Parameters
args[in] the vector of arguments

◆ List() [2/3]

List ( const std::list< rw::core::Ptr< const Mathematica::Expression >> &  args)

Construct list from a list of arguments.

Parameters
args[in] the list of arguments

◆ List() [3/3]

List ( const Exp &...  expressions)
inline

Construct new list from variable number of arguments.

Parameters
expressions[in] the expressions.
Note
Only available for C++11

Member Function Documentation

◆ add() [1/2]

List& add ( const Mathematica::AutoExpression expression)

Add an expression to list.

Parameters
expression[in] the expression to add.
Returns
a reference to the list for chaining.

◆ add() [2/2]

List& add ( Mathematica::Expression::Ptr  expression)

Add an expression to list.

Parameters
expression[in] the expression to add.
Returns
a reference to the list for chaining.

◆ clone()

virtual Mathematica::Expression::Ptr clone ( ) const
virtual

Make a copy of the expression.

Returns
a new copy.

Implements Mathematica::Expression.

◆ fromExpression()

static List::Ptr fromExpression ( const Mathematica::Expression exp)
static

Parse a list from a generic expression.

Parameters
exp[in] the expression to parse.
Returns
a new list.

◆ getArguments()

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

Get a list of arguments for this function.

Returns
list of arguments.

Implements Mathematica::FunctionBase.

◆ operator[]() [1/2]

Mathematica::Expression::Ptr operator[] ( std::size_t  i)

Get expression at some location in the list.

Parameters
i[in] the index.
Returns
the expression.

◆ operator[]() [2/2]

rw::core::Ptr<const Mathematica::Expression> operator[] ( std::size_t  i) const

Get expression at some location in the list.

Parameters
i[in] the index.
Returns
the expression.

◆ set()

void set ( std::size_t  i,
Mathematica::Expression::Ptr  expression 
)

Overwrite a specific expression in list.

Parameters
i[in] the index.
expression[in] the expression.

◆ toList()

static List::Ptr toList ( const T &  vector)
inlinestatic

Convert a RobWork vector to a Mathematica list.

Parameters
vector[in] the vector.
Returns
the list expression.

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