Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
JACOUSTICS::JEmitterID Class Reference

Auxiliary class for emitter identification. More...

#include <JEmitterID.hh>

Inheritance diagram for JACOUSTICS::JEmitterID:
std::map< int, int > JLANG::JSingleton< T >

Public Types

typedef T data_type
 

Public Member Functions

int operator() (const int id) const
 Get emitter identifier for given waveform identifier. More...
 

Static Public Member Functions

static void configure (const int id)
 Configure emitter identification for given detector. More...
 
static data_typegetInstance ()
 Get unique instance of template class. More...
 

Detailed Description

Auxiliary class for emitter identification.

This class can be used to map the identfier of a waveform (JDATABASE::JToAshort::EMITTERID / column "TMITTERID" the database table "toashort") to the identifier of the corresponding emitter (c.q. tripod).

Definition at line 31 of file JEmitterID.hh.

Member Typedef Documentation

template<class T>
typedef T JLANG::JSingleton< T >::data_type
inherited

Definition at line 20 of file JSingleton.hh.

Member Function Documentation

int JACOUSTICS::JEmitterID::operator() ( const int  id) const
inline

Get emitter identifier for given waveform identifier.

Parameters
idwaveform identifier
Returns
emitter identifier

Definition at line 42 of file JEmitterID.hh.

43  {
44  const_iterator p = this->find(id);
45 
46  if (p != this->end())
47  return p->second;
48  else
49  THROW(JValueOutOfRange, "Invalid waveform identifier " << id);
50  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
static void JACOUSTICS::JEmitterID::configure ( const int  id)
inlinestatic

Configure emitter identification for given detector.

Parameters
iddetector identifier

Definition at line 58 of file JEmitterID.hh.

59  {
60  getInstance().clear();
61 
62  switch (id) {
63 
64  case 49:
65  getInstance()[ 12] = 1;
66  getInstance()[-13] = 1;
67  getInstance()[ 14] = 2;
68  getInstance()[-15] = 2;
69  getInstance()[ 16] = 3;
70  getInstance()[-17] = 3;
71  break;
72 
73  case 42:
74  getInstance()[ 12] = 1;
75  getInstance()[ 14] = 2;
76  getInstance()[ 16] = 3;
77  break;
78 
79  default:
80  THROW(JValueOutOfRange, "Invalid detector identifier " << id);
81  break;
82  }
83  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
static data_type & getInstance()
Get unique instance of template class.
Definition: JSingleton.hh:27
template<class T>
static data_type& JLANG::JSingleton< T >::getInstance ( )
inlinestaticinherited

Get unique instance of template class.

Returns
object

Definition at line 27 of file JSingleton.hh.

28  {
29  static data_type value;
30 
31  return value;
32  }

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