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

Representation of a Mathematica Rule. More...

#include <Rule.hpp>

Inherits Mathematica::FunctionBase.

Public Types

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

 Rule (const Mathematica::Symbol &name, const Mathematica::AutoExpression &value)
 Construct a new Rule expression. More...
 
 Rule (const rw::core::PropertyBase &property)
 Construct a Mathematica Rule based on RobWork property. More...
 
virtual ~Rule ()
 Destructor.
 
std::list< rw::core::Ptr< const Mathematica::Expression > > getArguments () const
 Get a list of arguments for this function. More...
 
Mathematica::Expression::Ptr clone () const
 Make a copy of the expression. More...
 
std::string getId () const
 Get the symbol name of the rule. More...
 
void setValue (const Mathematica::Expression &value)
 Set the value of the rule. 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 std::list< Rule::PtrtoRules (const rw::core::PropertyMap &options)
 Convert a PropertyMap to a list of Mathematica rules. More...
 
static rw::core::Ptr< rw::core::PropertyMaptoPropertyMap (const std::list< rw::core::Ptr< const Mathematica::Expression >> &rules)
 Construct PropertyMap from existing expression. More...
 
static rw::core::Ptr< rw::core::PropertyBasetoProperty (const Mathematica::Expression &rule)
 Convert a Mathematica rule expression to a Property. 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 a Mathematica Rule.

Constructor & Destructor Documentation

◆ Rule() [1/2]

Rule ( const Mathematica::Symbol name,
const Mathematica::AutoExpression value 
)

Construct a new Rule expression.

Parameters
name[in] the name of the rule.
value[in] the value of the rule.

◆ Rule() [2/2]

Rule ( const rw::core::PropertyBase property)

Construct a Mathematica Rule based on RobWork property.

Parameters
property[in] the property.

Member Function Documentation

◆ clone()

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

Make a copy of the expression.

Returns
a new copy.

Implements Mathematica::Expression.

◆ getArguments()

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.

◆ getId()

std::string getId ( ) const

Get the symbol name of the rule.

Returns
the name of the rule.

◆ setValue()

void setValue ( const Mathematica::Expression value)

Set the value of the rule.

Parameters
value[in] new value.

◆ toProperty()

static rw::core::Ptr<rw::core::PropertyBase> toProperty ( const Mathematica::Expression rule)
static

Convert a Mathematica rule expression to a Property.

Parameters
rule[in] the rule expression.
Returns
the property.

◆ toPropertyMap()

static rw::core::Ptr<rw::core::PropertyMap> toPropertyMap ( const std::list< rw::core::Ptr< const Mathematica::Expression >> &  rules)
static

Construct PropertyMap from existing expression.

Parameters
rules[in] the expressions to parse as Rules.
Returns
the PropertyMap.
Exceptions
rw::core::Exceptionif parsing fails.

◆ toRules()

static std::list<Rule::Ptr> toRules ( const rw::core::PropertyMap options)
static

Convert a PropertyMap to a list of Mathematica rules.

Parameters
options[in] the map with options.
Returns
a list of Rule expressions.
Exceptions
rw::core::Exceptionif a property not supported.

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