MocoExtendProblem: Interface Between OpenSim and MATLAB for Rapidly Developing Direct Collocation Goals in Moco 1.1.0
add custom Moco goals to existing matlab scripts
OutputArguments Class Reference

Output arguments wrapper. More...

#include <arguments.h>

Public Member Functions

 OutputArguments (int nlhs, mxArray **plhs, int maximum_size=1, int mandatory_size=0)
 Construct output argument wrapper.
 
void set (size_t index, mxArray *value)
 Safely assign mxArray to the output.
 
template<typename T >
void set (size_t index, const T &value)
 Safely assign T to the output.
 
size_t size () const
 Size of the output.
 
mxArray *const & operator[] (size_t index) const
 Const square bracket operator.
 
mxArray *& operator[] (size_t index)
 Mutable square bracket operator.
 

Private Attributes

size_t nlhs_
 Number of output arguments.
 
mxArray ** plhs_
 Output argument array.
 

Detailed Description

Output arguments wrapper.

Example:

OutputArguments output(nlhs, plhs, 3);
MxArray cell = MxArray::Cell(1, 3);
cell.set(0, 0);
cell.set(1, 1);
cell.set(2, "value");
output.set(0, 1);
output.set(1, "foo");
output.set(2, cell.release());

Constructor & Destructor Documentation

◆ OutputArguments()

OutputArguments ( int nlhs,
mxArray ** plhs,
int maximum_size = 1,
int mandatory_size = 0 )
inline

Construct output argument wrapper.

Member Function Documentation

◆ operator[]() [1/2]

mxArray *& operator[] ( size_t index)
inline

Mutable square bracket operator.

◆ operator[]() [2/2]

mxArray *const & operator[] ( size_t index) const
inline

Const square bracket operator.

◆ set() [1/2]

template<typename T >
void set ( size_t index,
const T & value )
inline

Safely assign T to the output.

Here is the call graph for this function:

◆ set() [2/2]

void set ( size_t index,
mxArray * value )
inline

Safely assign mxArray to the output.

Here is the caller graph for this function:

◆ size()

size_t size ( ) const
inline

Size of the output.

Member Data Documentation

◆ nlhs_

size_t nlhs_
private

Number of output arguments.

◆ plhs_

mxArray** plhs_
private

Output argument array.


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