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

class to handle translation from D_TYPE to column position for flat data structures. More...

#include <data_map.h>

+ Collaboration diagram for utilities::Data_map:

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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_.

utilities::Data_map::~Data_map ( )
inline

Destructor.

Member Function Documentation

int utilities::Data_map::operator() ( utilities::D_TYPE  in) const
inline

looks up the position of the D_TYPE in

References utilities::D_SENTRY, and data_layout_.

int utilities::Data_map::operator() ( int  in) const
inline

Returns the value data_layout at index in.

Todo:
uncomment this

References data_layout_.

void Data_map::set_lookup ( D_TYPE  dt,
int  loc 
)

Member Data Documentation

int utilities::Data_map::data_layout_[D_SENTRY]
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().


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