Particle Identification and Tracking
Public Member Functions | Private Member Functions | Private Attributes | List of all members
utilities::Wrapper_i_generic Class Reference

Wrapper class for eating data from arbitrary sources. More...

#include <wrapper_i_generic.h>

+ Inheritance diagram for utilities::Wrapper_i_generic:
+ Collaboration diagram for utilities::Wrapper_i_generic:

Public Member Functions

int get_value (int &out, int ind, D_TYPE type, int frame) const
 Returns the value of the type specified from the particle selected. More...
 
float get_value (float &out, int ind, D_TYPE type, int frame) const
 Returns the value of the type specified from the particle selected. More...
 
std::complex< float > get_value (std::complex< float > &out, int ind, D_TYPE type, int frame) const
 Returns the value of the type specified from the particle selected. More...
 
Tuplef get_dims () const
 Returns the dimension of each 'frame' of the data in the wrapper. More...
 
std::set< D_TYPEget_data_types () const
 Returns a set of the data types. More...
 
int get_num_entries (unsigned int frame) const
 Return the number of entries the specified frame. More...
 
int get_num_entries () const
 Return the total number of entries in the wrapper. More...
 
int get_num_frames () const
 Return the number of frames. More...
 
bool contains_type (D_TYPE type) const
 Returns if the wrapper contains the specified data type. More...
 
 ~Wrapper_i_generic ()
 
 Wrapper_i_generic ()
 Constructor. More...
 
bool open_wrapper ()
 open wrapper to accept data, nukes everything currently in the wrapper More...
 
bool setup (const std::set< D_TYPE > &, int N, const Tuplef &)
 Sets the number of frames to expect. More...
 
bool open_frame (unsigned int frame, int N, float z)
 Opens a frame to add data to it. More...
 
bool set_data_type (D_TYPE dtype)
 Configures the object to take data of the given type. More...
 
bool clear_data_type ()
 Clears the current data type, no questions asked. More...
 
bool add_int_data (int *data, int N)
 adds data, must have an active data type set More...
 
bool add_float_data (float *data, int N)
 adds data, must have an active data type set More...
 
bool set_meta_data (const Md_store &md_store)
 Sets frame meta-data for the frame. More...
 
bool close_frame ()
 Closes frame. More...
 
bool finalize_wrapper ()
 Closes wrapper from taking any new data. More...
 
Meta data handling functions
const Md_storeget_Md_store (unsigned int j) const
 Returns a pointer to plane j's meta data store. More...
 
Md_storeget_Md_store (unsigned int j)
 Returns a pointer to plane j's meta data store. More...
 
void set_Md_store (unsigned int j, Md_store *in)
 Sets the Md_store for plane j. More...
 
void set_Md_store_size (unsigned int j)
 Sets the size of the md_stores_ vector. More...
 
unsigned int get_Md_store_size ()
 Gets the size of the md_stores_ vector. More...
 
void clear_Md_store (unsigned int j)
 Deletes plane j's Md_store. More...
 

Private Member Functions

void clean_data ()
 Deletes all allocated data. More...
 
bool set_dims (const Tuplef &dim)
 Sets the dimensions. More...
 

Private Attributes

std::set< utilities::D_TYPEdata_types_set_
 Set of data types in the wrapper. More...
 
Data_map d_mapi_
 Data map for integer data. More...
 
Data_map d_mapf_
 Data map for float data. More...
 
Data_map d_mapc_
 Data map for complex<float> data. More...
 
std::vector< std::vector< int * > > data_i_
 Data structure for integer data. More...
 
std::vector< std::vector
< float * > > 
data_f_
 Data structure for float data. More...
 
std::vector< std::vector
< std::complex< float > * > > 
data_c_
 Data structure for complex<float> data. More...
 
std::vector< int > frame_c_
 the number of particles in each frame More...
 
unsigned int frame_count_
 The number of frames. More...
 
unsigned int total_part_count_
 The total number of particles in all frames. More...
 
std::vector< float > frame_zdata_
 A vector of the z-position of each frame. More...
 
bool locked_
 if the parameters are locked More...
 
std::set< utilities::D_TYPE > * frame_added_datatypes_
 set of added data types More...
 
bool frame_open_
 if there is a frame open to add data too More...
 
D_TYPE cur_dtype_
 Current data_type. More...
 
bool two_d_data_
 2D data flag More...
 
int cur_frame_size_
 current frame size More...
 
int cur_frame_number_
 current frame number More...
 
Tuplef dims_
 dimensions of data More...
 

Detailed Description

Wrapper class for eating data from arbitrary sources.

Primarily written for the interface with python.

life cycle:

open_wrapper() setup(data_type,num_frames) { open_frame { set_data_type set_data } close_frame } finalize_wrapper

Constructor & Destructor Documentation

Wrapper_i_generic::~Wrapper_i_generic ( )

References clean_data().

Wrapper_i_generic::Wrapper_i_generic ( )

Constructor.

Member Function Documentation

void Wrapper_i_generic::clean_data ( )
private

Deletes all allocated data.

References data_c_, data_f_, data_i_, and locked_.

Referenced by open_wrapper(), and ~Wrapper_i_generic().

void Wrapper_in::clear_Md_store ( unsigned int  j)
inherited

Deletes plane j's Md_store.

References utilities::Wrapper_in::md_stores_.

bool Wrapper_i_generic::contains_type ( D_TYPE  type) const
virtual

Returns if the wrapper contains the specified data type.

Implements utilities::Wrapper_in.

References data_types_set_.

Referenced by utilities::Wrapper_i_jb_binary::contains_type(), and get_value().

std::set< D_TYPE > Wrapper_i_generic::get_data_types ( ) const
virtual

Returns a set of the data types.

Use the other version

Implements utilities::Wrapper_in.

References data_types_set_.

Referenced by utilities::Wrapper_i_jb_binary::get_data_types().

Tuplef Wrapper_i_generic::get_dims ( ) const
virtual

Returns the dimension of each 'frame' of the data in the wrapper.

Implements utilities::Wrapper_in.

References dims_.

Referenced by utilities::Wrapper_i_jb_binary::get_dims().

const Md_store * Wrapper_in::get_Md_store ( unsigned int  j) const
inherited

Returns a pointer to plane j's meta data store.

Const version

References utilities::Wrapper_in::md_stores_.

Referenced by tracking::Master_box::get_Md_store(), and tracking::hash_case::init().

Md_store * Wrapper_in::get_Md_store ( unsigned int  j)
inherited

Returns a pointer to plane j's meta data store.

Const version

References utilities::Wrapper_in::md_stores_.

unsigned int Wrapper_in::get_Md_store_size ( )
inherited

Gets the size of the md_stores_ vector.

References utilities::Wrapper_in::md_stores_.

int Wrapper_i_generic::get_num_entries ( unsigned int  frame) const
virtual

Return the number of entries the specified frame.

Implements utilities::Wrapper_in.

References frame_c_.

Referenced by utilities::Wrapper_i_jb_binary::get_num_entries().

int Wrapper_i_generic::get_num_entries ( ) const
virtual

Return the total number of entries in the wrapper.

Implements utilities::Wrapper_in.

References total_part_count_.

int Wrapper_i_generic::get_num_frames ( ) const
virtual

Return the number of frames.

Implements utilities::Wrapper_in.

References frame_count_.

Referenced by utilities::Wrapper_i_jb_binary::get_num_frames().

int Wrapper_i_generic::get_value ( int &  out,
int  ind,
D_TYPE  type,
int  frame 
) const
virtual

Returns the value of the type specified from the particle selected.

Parameters
out[out] the value
ind[in] the index of the particle
type[in] the D_TYPE
frame[in] the frame the particle is in
Returns
the value

Implements utilities::Wrapper_in.

References contains_type(), d_mapi_, data_i_, utilities::DT2str_s(), utilities::V_INT, and utilities::v_type().

Referenced by utilities::Wrapper_i_jb_binary::get_value().

float Wrapper_i_generic::get_value ( float &  out,
int  ind,
D_TYPE  type,
int  frame 
) const
virtual

Returns the value of the type specified from the particle selected.

Parameters
out[out] the value
ind[in] the index of the particle
type[in] the D_TYPE
frame[in] the frame the particle is in
Returns
the value

Implements utilities::Wrapper_in.

References contains_type(), d_mapf_, utilities::D_ZPOS, data_f_, utilities::DT2str_s(), frame_zdata_, two_d_data_, utilities::V_FLOAT, and utilities::v_type().

std::complex< float > Wrapper_i_generic::get_value ( std::complex< float > &  out,
int  ind,
D_TYPE  type,
int  frame 
) const
virtual

Returns the value of the type specified from the particle selected.

Parameters
out[out] the value
ind[in] the index of the particle
type[in] the D_TYPE
frame[in] the frame the particle is in
Returns
the value

Implements utilities::Wrapper_in.

References contains_type(), d_mapc_, data_c_, utilities::DT2str_s(), utilities::V_COMPLEX, and utilities::v_type().

bool Wrapper_i_generic::set_dims ( const Tuplef dim)
private

Sets the dimensions.

References dims_.

Referenced by setup().

void Wrapper_in::set_Md_store ( unsigned int  j,
Md_store in 
)
inherited

Sets the Md_store for plane j.

When the pointer is assigned the wrapper takes ownership of the pointer and will clean it up.

References utilities::Wrapper_in::md_stores_.

Referenced by iden::Iden::fill_wrapper(), iden::Iden::fill_wrapper_avg(), main(), utilities::Wrapper_i_hdf::priv_init(), and iden::Iden::process_frame().

void Wrapper_in::set_Md_store_size ( unsigned int  j)
inherited

Member Data Documentation

D_TYPE utilities::Wrapper_i_generic::cur_dtype_
private

Current data_type.

Referenced by add_float_data(), add_int_data(), clear_data_type(), and set_data_type().

int utilities::Wrapper_i_generic::cur_frame_number_
private

current frame number

Referenced by add_float_data(), add_int_data(), and open_frame().

int utilities::Wrapper_i_generic::cur_frame_size_
private

current frame size

Referenced by add_float_data(), add_int_data(), close_frame(), and open_frame().

Data_map utilities::Wrapper_i_generic::d_mapc_
private

Data map for complex<float> data.

Referenced by get_value(), and setup().

Data_map utilities::Wrapper_i_generic::d_mapf_
private

Data map for float data.

Referenced by add_float_data(), get_value(), open_frame(), and setup().

Data_map utilities::Wrapper_i_generic::d_mapi_
private

Data map for integer data.

Referenced by add_int_data(), get_value(), open_frame(), and setup().

std::vector<std::vector<std::complex<float>*> > utilities::Wrapper_i_generic::data_c_
private

Data structure for complex<float> data.

First dimension is data type, second is frame, third in particle index

Referenced by clean_data(), get_value(), and setup().

std::vector<std::vector<float*> > utilities::Wrapper_i_generic::data_f_
private

Data structure for float data.

First dimension is data type, second is frame, third in particle index

Referenced by add_float_data(), clean_data(), get_value(), open_frame(), and setup().

std::vector<std::vector<int*> > utilities::Wrapper_i_generic::data_i_
private

Data structure for integer data.

First dimension is data type, second is frame, third in particle index

Referenced by add_int_data(), clean_data(), get_value(), open_frame(), and setup().

std::set<utilities::D_TYPE> utilities::Wrapper_i_generic::data_types_set_
private

Set of data types in the wrapper.

This is mostly redundant, but useful.

Referenced by contains_type(), get_data_types(), open_frame(), and setup().

Tuplef utilities::Wrapper_i_generic::dims_
private

dimensions of data

Referenced by get_dims(), and set_dims().

std::set<utilities::D_TYPE>* utilities::Wrapper_i_generic::frame_added_datatypes_
private

set of added data types

Referenced by close_frame(), open_frame(), and set_data_type().

std::vector<int> utilities::Wrapper_i_generic::frame_c_
private

the number of particles in each frame

Referenced by get_num_entries(), open_frame(), and setup().

unsigned int utilities::Wrapper_i_generic::frame_count_
private

The number of frames.

Referenced by get_num_frames(), open_frame(), and setup().

bool utilities::Wrapper_i_generic::frame_open_
private

if there is a frame open to add data too

Referenced by close_frame(), open_frame(), and set_data_type().

std::vector<float> utilities::Wrapper_i_generic::frame_zdata_
private

A vector of the z-position of each frame.

For 2D data this is the center of the plane, for 3D this provides if we have any drift.

Referenced by get_value(), open_frame(), and setup().

bool utilities::Wrapper_i_generic::locked_
private

if the parameters are locked

Referenced by clean_data(), and setup().

unsigned int utilities::Wrapper_i_generic::total_part_count_
private

The total number of particles in all frames.

Referenced by get_num_entries(), and open_frame().

bool utilities::Wrapper_i_generic::two_d_data_
private

2D data flag

Referenced by get_value().


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