00001 //Copyright 2008,2009 Thomas A Caswell 00002 //tcaswell@uchicago.edu 00003 //http://jfi.uchicago.edu/~tcaswell 00004 // 00005 //This program is free software; you can redistribute it and/or modify 00006 //it under the terms of the GNU General Public License as published by 00007 //the Free Software Foundation; either version 3 of the License, or (at 00008 //your option) any later version. 00009 // 00010 //This program is distributed in the hope that it will be useful, but 00011 //WITHOUT ANY WARRANTY; without even the implied warranty of 00012 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 //General Public License for more details. 00014 // 00015 //You should have received a copy of the GNU General Public License 00016 //along with this program; if not, see <http://www.gnu.org/licenses>. 00017 // 00018 //Additional permission under GNU GPL version 3 section 7 00019 // 00020 //If you modify this Program, or any covered work, by linking or 00021 //combining it with MATLAB (or a modified version of that library), 00022 //containing parts covered by the terms of MATLAB User License, the 00023 //licensors of this Program grant you additional permission to convey 00024 //the resulting work. 00025 #include <vector> 00026 00027 #include "params.h" 00028 #include "wrapper_i_matlab.h" 00029 #include "wrapper_o_matlab.h" 00030 00031 00032 #include "mex.h" 00033 00034 #ifndef PARAMS_MATLAB 00035 #define PARAMS_MATLAB 00036 00037 00038 namespace utilities{ 00039 00043 class params_matlab:public params{ 00044 00045 public: 00047 //using the extra level of dereference to make it work better with 00048 //output wrapper and matches the input/output format for the mex 00049 //function 00050 const mxArray** data_in; 00051 mxArray** data_out; 00052 00054 int rows; 00055 00057 int cols; 00058 00060 00061 00062 00064 params_matlab(const mxArray ** data_ptr, 00065 std::map<utilities::D_TYPE,int> contents ) 00066 :params(contents),data_in(data_ptr){ 00067 00068 } 00069 00070 params_matlab( mxArray ** data_ptr, 00071 std::map<utilities::D_TYPE,int> contents, int rows_in, int cols_in ) 00072 :params(contents),data_out(data_ptr),rows(rows_in),cols(cols_in){ 00073 00074 } 00075 00076 00077 Wrapper_in* make_wrapper_in(){ 00078 return new Wrapper_i_matlab(this); 00079 } 00080 00081 00082 Wrapper_out* make_wrapper_out(){ 00083 return new Wrapper_o_matlab(this); 00084 } 00085 00086 00087 }; 00088 } 00089 #endif
1.5.9-20090622