Wrapper class for dealing with output to matlab. More...
#include <wrapper_o_matlab.h>
Public Types | |
| enum | p_vals { D_INDEX = 0, D_XPOS, D_YPOS, D_FRAME, D_I, D_R2, D_E, D_NEXT, D_PREV, D_DX, D_DY, D_ORGX, D_ORGY, D_ZPOS, D_UNQID, D_TRACKID, D_S_ORDER_PARAMETER } |
enumeration for data types More... | |
Public Member Functions | |
| void | set_new_value (wrapper::p_vals type, double val) |
| sets the data for type to val for the currently activated particle in the data structure. | |
| void | end_new_particle () |
| 'closes' a partcile anc garuntees that the data is written to the underlying data structure. | |
| void | finalize_wrapper () |
| Preforms any clean up (not of data structures, that is taken care of by destructor) that needs to be done such as closing a file. | |
| void | initialize_wrapper () |
| preforms any initialization that needs to be done the logic for this is to not needlessly open and close files, or creat matlab arrays if they arn't going to be used. | |
| void | reset_wrapper (params *param) |
| changes where the wrapper is pointing (ie, write out to a different array or file or somethin | |
| void | start_new_particle () |
| sets up the wrapper to add new particle to the underlying data structure. | |
| wrapper_o_matlab (params_matlab *parms) | |
| ~wrapper_o_matlab () | |
| void | print () const |
| Prints out the currents contents of the wrapper in some sort of sensible way. | |
| int | num_entries () const |
| returns the number of particles stored | |
| virtual std::set< p_vals > | get_data_types () const |
| Returns a set of the types of data that the wrapper knows how to deal with. | |
| std::map< p_vals, int > * | get_map_ptr () |
| Returns a pointer to the map. | |
Protected Attributes | |
| int | part_count |
| Count of the number of particles that have been added. | |
| int | seq_count |
| to be removed, move this accounting to derived classes posistion in squence | |
| bool | part_open |
| if a particle is 'opened' | |
| bool | wrapper_open |
| if the wrapper is 'open' to get additional particles | |
| bool | clone |
| Boolean value to determine if this is a cloned wrapper or not. | |
| std::map< p_vals, int > | data_types_ |
| A map between the data types and a posistion in the data structure. | |
| int | data_layout_ [16] |
Private Attributes | |
| mxArray ** | data_array_ |
| Pointer to matlab array that holds the data. | |
| int | rows |
| The number of rows in the array. | |
| int | cols |
| The number of columns (and hence number of values in the array. | |
| double * | first |
| anchor to data with in array | |
| int | part_index |
| index of current open particle | |
Wrapper class for dealing with output to matlab.
enum tracking::wrapper::p_vals [inherited] |
| wrapper_o_matlab::wrapper_o_matlab | ( | params_matlab * | parms | ) |
| wrapper_o_matlab::~wrapper_o_matlab | ( | ) |
References finalize_wrapper(), and tracking::wrapper_o_base::wrapper_open.
| void wrapper_o_matlab::end_new_particle | ( | ) | [virtual] |
'closes' a partcile anc garuntees that the data is written to the underlying data structure.
Does nothing if a particle isn't open.
Implements tracking::wrapper_o_base.
References part_index, and tracking::wrapper_o_base::part_open.
| void wrapper_o_matlab::finalize_wrapper | ( | ) | [virtual] |
Preforms any clean up (not of data structures, that is taken care of by destructor) that needs to be done such as closing a file.
Implements tracking::wrapper_o_base.
References tracking::wrapper_o_base::wrapper_open.
Referenced by ~wrapper_o_matlab().
| std::set< wrapper::p_vals > wrapper::get_data_types | ( | ) | const [virtual, inherited] |
Returns a set of the types of data that the wrapper knows how to deal with.
References tracking::wrapper::data_types_.
Referenced by tracking::Wrapper_i_hdf5::fill_master_box(), and tracking::master_box_t< particle >::init().
| std::map<p_vals, int>* tracking::wrapper::get_map_ptr | ( | ) | [inline, inherited] |
Returns a pointer to the map.
References tracking::wrapper::data_types_.
| void wrapper_o_matlab::initialize_wrapper | ( | ) | [virtual] |
preforms any initialization that needs to be done the logic for this is to not needlessly open and close files, or creat matlab arrays if they arn't going to be used.
It also allows the wrapper object to be reused (ie, do all the processing, output one subset of data to one place, and another subset to another place
Implements tracking::wrapper_o_base.
References cols, data_array_, first, rows, and tracking::wrapper_o_base::wrapper_open.
| int tracking::wrapper_o_matlab::num_entries | ( | ) | const [inline, virtual] |
returns the number of particles stored
Implements tracking::wrapper_o_base.
| void wrapper_o_matlab::print | ( | ) | const [virtual] |
Prints out the currents contents of the wrapper in some sort of sensible way.
Implements tracking::wrapper.
| void wrapper_o_matlab::reset_wrapper | ( | params * | param | ) | [virtual] |
changes where the wrapper is pointing (ie, write out to a different array or file or somethin
Implements tracking::wrapper_o_base.
References data_array_, tracking::params_matlab::data_out, tracking::wrapper_o_base::part_count, tracking::wrapper_o_base::part_open, tracking::wrapper_o_base::seq_count, and tracking::wrapper_o_base::wrapper_open.
| void wrapper_o_matlab::set_new_value | ( | wrapper::p_vals | type, | |
| double | val | |||
| ) | [virtual] |
sets the data for type to val for the currently activated particle in the data structure.
If the wrapper doesn't know about the p_val type, then [[throw an exception|ignore]] )(have not decided yet)
| type | the parameter to be set | |
| val | the value to set the parameter to |
Implements tracking::wrapper_o_base.
References tracking::wrapper::data_layout_, first, part_index, tracking::wrapper_o_base::part_open, and rows.
| void wrapper_o_matlab::start_new_particle | ( | ) | [virtual] |
sets up the wrapper to add new particle to the underlying data structure.
Behavior of this function if a particle is alread 'open' is currently undefined(either close it and move on, or nuke the old data, or just keep appending to it)
This function can either write straight in to the underlyign data structure or work through a temporary buffer
Implements tracking::wrapper_o_base.
References part_index, tracking::wrapper_o_base::part_open, rows, tracking::wrapper_o_base::seq_count, and tracking::wrapper_o_base::wrapper_open.
bool tracking::wrapper::clone [protected, inherited] |
int tracking::wrapper_o_matlab::cols [private] |
The number of columns (and hence number of values in the array.
This isn't strictly needed, hoever it should make returning values faster by amoritizing the dereference cost, maybe
Referenced by initialize_wrapper(), and print().
mxArray** tracking::wrapper_o_matlab::data_array_ [private] |
Pointer to matlab array that holds the data.
Referenced by initialize_wrapper(), and reset_wrapper().
int tracking::wrapper::data_layout_[16] [protected, inherited] |
std::map<p_vals, int> tracking::wrapper::data_types_ [protected, inherited] |
A map between the data types and a posistion in the data structure.
This orginally had been burried down in the derived classes, but I couldn't think of a data structure for storing particle data where this sort of thing wasn't uesful. Thus, it has been dragged up to the top level.
Referenced by tracking::wrapper::get_data_types(), tracking::wrapper::get_map_ptr(), tracking::wrapper_i_ning::get_value(), tracking::wrapper_i_matlab::get_value(), tracking::wrapper_i_file::get_value(), tracking::wrapper_i_base::print(), and tracking::wrapper::wrapper().
double* tracking::wrapper_o_matlab::first [private] |
anchor to data with in array
Referenced by initialize_wrapper(), and set_new_value().
int tracking::wrapper_o_base::part_count [protected, inherited] |
Count of the number of particles that have been added.
Referenced by reset_wrapper().
int tracking::wrapper_o_matlab::part_index [private] |
index of current open particle
Referenced by end_new_particle(), set_new_value(), and start_new_particle().
bool tracking::wrapper_o_base::part_open [protected, inherited] |
if a particle is 'opened'
Referenced by end_new_particle(), tracking::wrapper_o_file::end_new_particle(), reset_wrapper(), set_new_value(), tracking::wrapper_o_file::set_new_value(), start_new_particle(), and tracking::wrapper_o_file::start_new_particle().
int tracking::wrapper_o_matlab::rows [private] |
The number of rows in the array.
This isn't strictly needed, hoever it should make returning values faster by amoritizing the dereference cost, maybe
Referenced by initialize_wrapper(), print(), set_new_value(), and start_new_particle().
int tracking::wrapper_o_base::seq_count [protected, inherited] |
to be removed, move this accounting to derived classes posistion in squence
Referenced by reset_wrapper(), and start_new_particle().
bool tracking::wrapper_o_base::wrapper_open [protected, inherited] |
if the wrapper is 'open' to get additional particles
Referenced by finalize_wrapper(), tracking::wrapper_o_file::finalize_wrapper(), initialize_wrapper(), tracking::wrapper_o_file::initialize_wrapper(), reset_wrapper(), start_new_particle(), and ~wrapper_o_matlab().
1.5.9-20090622