Particle Identification and Tracking
|
class to handle translation from D_TYPE to column position for flat data structures. More...
#include <data_map.h>
Public Member Functions | |
Data_map (const std::map< utilities::D_TYPE, int > &in) | |
Constructor. More... | |
Data_map () | |
Default constructor. More... | |
~Data_map () | |
Destructor. More... | |
int | operator() (utilities::D_TYPE in) const |
looks up the position of the D_TYPE in More... | |
int | operator() (int in) const |
Returns the value data_layout at index in. More... | |
void | set_lookup (D_TYPE dt, int loc) |
Set the look up column of the D_TYPE dt to loc. More... | |
Private Attributes | |
int | data_layout_ [D_SENTRY] |
An array that serves as a look up table. More... | |
class to handle translation from D_TYPE to column position for flat data structures.
When the particle data is stored in a Nxm array, with N particles and m D_TYPES, this class provides a map between the column number and what data is in the column.
Data_map::Data_map | ( | const std::map< utilities::D_TYPE, int > & | in) |
Constructor.
References utilities::D_SENTRY, and data_layout_.
Data_map::Data_map | ( | ) |
Default constructor.
References utilities::D_SENTRY, and data_layout_.
|
inline |
Destructor.
|
inline |
looks up the position of the D_TYPE in
References utilities::D_SENTRY, and data_layout_.
|
inline |
void Data_map::set_lookup | ( | D_TYPE | dt, |
int | loc | ||
) |
Set the look up column of the D_TYPE dt to loc.
References data_layout_.
Referenced by utilities::Wrapper_i_hdf::priv_init(), utilities::Wrapper_i_generic::setup(), iden::Wrapper_i_plu::Wrapper_i_plu(), and utilities::Wrapper_o_hdf_group::Wrapper_o_hdf_group().
|
private |
An array that serves as a look up table.
This takes advantage of the fact that enums resolve to integers, each entry is the location of the D_TYPE that resolves to that elements index. D_TYPES that aren't include are set to -1
Referenced by Data_map(), operator()(), and set_lookup().