Particle Identification and Tracking
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
utilities::wrapper_o_file Class Referenceabstract

wrapper_o class for dealing with writing data to a file. More...

#include <wrapper_o_file.h>

+ Inheritance diagram for utilities::wrapper_o_file:
+ Collaboration diagram for utilities::wrapper_o_file:

Public Member Functions

void print () const
 adds another particle to the data table and fills it with zero values. More...
 
void print (int ind)
 
 wrapper_o_file (params_file *params)
 default constructor More...
 
int num_entries () const
 
void set_new_value (utilities::D_TYPE type, double val)
 
void end_new_particle ()
 
void finalize_wrapper ()
 Performs any clean up. More...
 
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. More...
 
void reset_wrapper (params *param)
 
void start_new_particle ()
 
virtual void add_meta_store (const Md_store *md_in)=0
 Adds all the meta data in a Md_store object. More...
 
Output interface

New API for output wrappers, which is a bit more carefully thought about.

All derived classes must implement these and only these public functions (because of the way that pointers to this base class are used in the code, only these functions are available in the bulk of the code)

Typical life cycle:

-initialize wrapper -loop over frames (if wrapper knows about frames) –loop over particles —open particle —set values —close particle –close particles -close frames -finalize wrapper

virtual void open_group (int group=0, int p_count=0, int wrapper_size=-1)=0
 Opens a group to put particles into. More...
 
virtual void set_all_values (const tracking::particle *)=0
 sets all of the values that the wrapper knows about by asking the particle More...
 
virtual void set_all_values (const tracking::Track_box *, const utilities::Tuple< float, 3 > &)=0
 sets all of the values that the wrapper knows about by asking the particle. More...
 
virtual void close_group ()=0
 Closes the currently open group. More...
 
virtual const std::set< D_TYPE > & get_content_tpyes () const =0
 Returns a set containing the D_TYPES that the wrapper can cope with. More...
 
Group level metadata

adds meta data to a group that is specific the current computation

virtual void add_meta_data (const std::string &key, float val)=0
 Adds a float meta-data. More...
 
virtual void add_meta_data (const std::string &key, const Tuple< float, 3 > &val)=0
 Adds a Triple meta-data. More...
 
virtual void add_meta_data (const std::string &key, const Tuple< float, 2 > &val)=0
 Adds a Pair meta-data. More...
 
virtual void add_meta_data (const std::string &key, const std::string &val)=0
 Adds a string meta-data. More...
 
virtual void add_meta_data (const std::string &key, int val)=0
 Adds an integer meta-data. More...
 
virtual void add_meta_data_comp (const std::string &key, float val)=0
 Adds a float meta-data. More...
 
virtual void add_meta_data_comp (const std::string &key, const Tuple< float, 3 > &val)=0
 Adds a Triple meta-data. More...
 
virtual void add_meta_data_comp (const std::string &key, const Tuple< float, 2 > &val)=0
 Adds a Pair meta-data. More...
 
virtual void add_meta_data_comp (const std::string &key, const std::string &val)=0
 Adds a string meta-data. More...
 
virtual void add_meta_data_comp (const std::string &key, int val)=0
 Adds an integer meta-data. More...
 
virtual void add_meta_data (const std::string &key, float val, D_TYPE dset_type)=0
 Adds metadata for datasets. More...
 
virtual void add_meta_data (const std::string &key, const Tuple< float, 3 > &val, D_TYPE dset_type)=0
 Adds a Triple meta-data for a data set. More...
 
virtual void add_meta_data (const std::string &key, const Tuple< float, 2 > &val, D_TYPE dset_type)=0
 Adds a Pair meta-data for a data set. More...
 
virtual void add_meta_data (const std::string &key, const std::string &val, D_TYPE dset_type)=0
 Adds a string meta-data for a data set. More...
 
virtual void add_meta_data (const std::string &key, int val, D_TYPE dset_type)=0
 Adds an integer meta-data for a data set. More...
 
virtual void add_meta_data_list (const Read_config &, const std::set< D_TYPE > &)=0
 Adds all parameters from the Read_config object to the data sets in the set. More...
 
Root level

adds meta data to the root group

virtual void add_meta_data_root (const std::string &key, float val)=0
 Adds a float meta-data. More...
 
virtual void add_meta_data_root (const std::string &key, const Tuple< float, 3 > &val)=0
 Adds a Triple meta-data. More...
 
virtual void add_meta_data_root (const std::string &key, const Tuple< float, 2 > &val)=0
 Adds a Pair meta-data. More...
 
virtual void add_meta_data_root (const std::string &key, const std::string &val)=0
 Adds a string meta-data. More...
 
virtual void add_meta_data_root (const std::string &key, int val)=0
 Adds an integer meta-data. More...
 

Protected Member Functions

void initialize (params_file *param)
 initializes the wrapper_i class More...
 
void store_data (int index, int pos, double val)
 takes care of ensuring everything is in range for writing stuff into the data structure. More...
 

Protected Attributes

string fname
 File name to write data to. More...
 
vector< double > data
 Temperoray data structure for holding current. More...
 
ofstream f_out
 File stream to write data into. More...
 
int cols
 number of fields per particle More...
 
map< utilities::D_TYPE, int > contents
 Map that stores what values go where in what columns. More...
 

Detailed Description

wrapper_o class for dealing with writing data to a file.

The data is stored in a vector of vectors. The wrapper must be explicitly told to write the data to disk

Constructor & Destructor Documentation

wrapper_o_file::wrapper_o_file ( params_file *  params)

default constructor

Member Function Documentation

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
float  val 
)
pure virtualinherited

Adds a float meta-data.

Implemented in utilities::Wrapper_o_hdf.

Referenced by tracking::Track_box::output_to_wrapper().

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
const Tuple< float, 3 > &  val 
)
pure virtualinherited

Adds a Triple meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
const Tuple< float, 2 > &  val 
)
pure virtualinherited

Adds a Pair meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
const std::string &  val 
)
pure virtualinherited

Adds a string meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
int  val 
)
pure virtualinherited

Adds an integer meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
float  val,
D_TYPE  dset_type 
)
pure virtualinherited

Adds metadata for datasets.

Adds a float meta-data for a data set

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
const Tuple< float, 3 > &  val,
D_TYPE  dset_type 
)
pure virtualinherited

Adds a Triple meta-data for a data set.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
const Tuple< float, 2 > &  val,
D_TYPE  dset_type 
)
pure virtualinherited

Adds a Pair meta-data for a data set.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
const std::string &  val,
D_TYPE  dset_type 
)
pure virtualinherited

Adds a string meta-data for a data set.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data ( const std::string &  key,
int  val,
D_TYPE  dset_type 
)
pure virtualinherited

Adds an integer meta-data for a data set.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_comp ( const std::string &  key,
float  val 
)
pure virtualinherited

Adds a float meta-data.

Implemented in utilities::Wrapper_o_hdf.

Referenced by tracking::Hash_shelf::output_to_wrapper().

virtual void utilities::Wrapper_out::add_meta_data_comp ( const std::string &  key,
const Tuple< float, 3 > &  val 
)
pure virtualinherited

Adds a Triple meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_comp ( const std::string &  key,
const Tuple< float, 2 > &  val 
)
pure virtualinherited

Adds a Pair meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_comp ( const std::string &  key,
const std::string &  val 
)
pure virtualinherited

Adds a string meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_comp ( const std::string &  key,
int  val 
)
pure virtualinherited

Adds an integer meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_list ( const Read_config ,
const std::set< D_TYPE > &   
)
pure virtualinherited

Adds all parameters from the Read_config object to the data sets in the set.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_root ( const std::string &  key,
float  val 
)
pure virtualinherited
virtual void utilities::Wrapper_out::add_meta_data_root ( const std::string &  key,
const Tuple< float, 3 > &  val 
)
pure virtualinherited

Adds a Triple meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_root ( const std::string &  key,
const Tuple< float, 2 > &  val 
)
pure virtualinherited

Adds a Pair meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_root ( const std::string &  key,
const std::string &  val 
)
pure virtualinherited

Adds a string meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_data_root ( const std::string &  key,
int  val 
)
pure virtualinherited

Adds an integer meta-data.

Implemented in utilities::Wrapper_o_hdf.

virtual void utilities::Wrapper_out::add_meta_store ( const Md_store md_in)
pure virtualinherited

Adds all the meta data in a Md_store object.

Implemented in utilities::Wrapper_o_hdf.

Referenced by tracking::Hash_shelf::output_to_wrapper().

virtual void utilities::Wrapper_out::close_group ( )
pure virtualinherited

Closes the currently open group.

Throws an error if there is no open group.

Implemented in utilities::Wrapper_o_hdf.

Referenced by tracking::Track_shelf::output_link_to_wrapper(), tracking::Track_box::output_to_wrapper(), and tracking::Hash_shelf::output_to_wrapper().

void wrapper_o_file::end_new_particle ( )

References data, and f_out.

void wrapper_o_file::finalize_wrapper ( )
virtual

Performs any clean up.

that needs to be done such as closing a file

Implements utilities::Wrapper_out.

References f_out, and fname.

virtual const std::set<D_TYPE>& utilities::Wrapper_out::get_content_tpyes ( ) const
pure virtualinherited

Returns a set containing the D_TYPES that the wrapper can cope with.

Implemented in utilities::Wrapper_o_hdf.

void wrapper_o_file::initialize ( params_file *  param)
protected
void wrapper_o_file::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 utilities::Wrapper_out.

References f_out, and fname.

int utilities::wrapper_o_file::num_entries ( ) const
inline

References data.

virtual void utilities::Wrapper_out::open_group ( int  group = 0,
int  p_count = 0,
int  wrapper_size = -1 
)
pure virtualinherited

Opens a group to put particles into.

Parameters
groupthe index of the group to be opened
p_countthe number of particles to expect
wrapper_sizethe size of the group of the underlying wrapper, if <0, then set equal to p_count

Implemented in utilities::Wrapper_o_hdf.

Referenced by tracking::Track_shelf::output_link_to_wrapper(), tracking::Track_box::output_to_wrapper(), and tracking::Hash_shelf::output_to_wrapper().

void utilities::wrapper_o_file::print ( ) const

adds another particle to the data table and fills it with zero values.

Returns the index of the new particle print out a representation of the data

void wrapper_o_file::print ( int  ind)
void wrapper_o_file::reset_wrapper ( params *  param)
virtual void utilities::Wrapper_out::set_all_values ( const tracking::particle )
pure virtualinherited

sets all of the values that the wrapper knows about by asking the particle

Implemented in utilities::Wrapper_o_hdf.

Referenced by tracking::Track_shelf::output_link_to_wrapper(), tracking::Track_box::output_to_wrapper(), and tracking::hash_box::output_to_wrapper().

virtual void utilities::Wrapper_out::set_all_values ( const tracking::Track_box ,
const utilities::Tuple< float, 3 > &   
)
pure virtualinherited

sets all of the values that the wrapper knows about by asking the particle.

This function is for outputting the results of 3D linking

Implemented in utilities::Wrapper_o_hdf.

void wrapper_o_file::set_new_value ( utilities::D_TYPE  type,
double  val 
)

References data.

void wrapper_o_file::start_new_particle ( )

References cols, and data.

void utilities::wrapper_o_file::store_data ( int  index,
int  pos,
double  val 
)
protected

takes care of ensuring everything is in range for writing stuff into the data structure.

Member Data Documentation

int utilities::wrapper_o_file::cols
protected

number of fields per particle

Referenced by start_new_particle().

map<utilities::D_TYPE, int> utilities::wrapper_o_file::contents
protected

Map that stores what values go where in what columns.

vector<double > utilities::wrapper_o_file::data
protected

Temperoray data structure for holding current.

Referenced by end_new_particle(), num_entries(), set_new_value(), and start_new_particle().

ofstream utilities::wrapper_o_file::f_out
protected

File stream to write data into.

Referenced by end_new_particle(), finalize_wrapper(), and initialize_wrapper().

string utilities::wrapper_o_file::fname
protected

File name to write data to.

Referenced by finalize_wrapper(), and initialize_wrapper().


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