35 int id = rhs[0].toInt();
36 string method(rhs[1].toString());
39 if (method ==
"new") {
51 if (method ==
"delete") {
56 else if (method ==
"clear") {
60 else if (method ==
"load") {
61 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs==0);
63 bool loadFromString =
false;
64 for (
int i=3; i<nrhs; i+=2) {
65 string key(rhs[i].toString());
67 objname = rhs[i+1].toString();
68 else if (key ==
"FromString")
69 loadFromString = rhs[i+1].toBool();
72 "Unrecognized option %s", key.
c_str());
81 FileStorage fs(rhs[2].toString(), FileStorage::READ +
82 (loadFromString ? FileStorage::MEMORY : 0));
91 else if (method ==
"save") {
93 obj->
save(rhs[2].toString());
95 else if (method ==
"empty") {
99 else if (method ==
"getDefaultName") {
103 else if (method ==
"process") {
104 nargchk((nrhs==4 || nrhs==5) && nlhs<=1);
115 obj->
process(src, dst, times, response);
123 "Unrecognized operation %s", method.
c_str());
virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times, InputArray response)=0
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
Ptr< MergeRobertson > createMergeRobertson()
map< int, Ptr< MergeRobertson > > obj_
Object container.
virtual bool isOpened() const
struct mxArray_tag mxArray
Forward declaration for mxArray.
virtual void read(const FileNode &fn)
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
LIBMWMEX_API_EXTERN_C void mexUnlock(void)
Unlock a locked MEX-function so that it can be cleared from memory.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
FileNode getFirstTopLevelNode() const
virtual String getDefaultName() const
Global constant definitions.
virtual void save(const String &filename) const
virtual bool empty() const
int last_id
Last object id to allocate.