Jpp  16.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
JACOUSTICS::JEmitterID Struct Reference

Auxiliary class for emitter identification. More...

#include <JEmitterID.hh>

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

Public Member Functions

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

Public Attributes

JComment comment
 

Friends

std::istream & operator>> (std::istream &in, JEmitterID &object)
 Read emitter data from input. More...
 
std::ostream & operator<< (std::ostream &out, const JEmitterID &object)
 Write emitter data to output. More...
 

Detailed Description

Auxiliary class for emitter identification.

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

Definition at line 39 of file JEmitterID.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 48 of file JEmitterID.hh.

49  {
50  const_iterator p = this->find(id);
51 
52  if (p != this->end())
53  return p->second;
54  else
55  THROW(JValueOutOfRange, "Invalid waveform identifier " << id);
56  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JEmitterID object 
)
friend

Read emitter data from input.

Parameters
ininput stream
objectemitter data
Returns
input stream

Definition at line 66 of file JEmitterID.hh.

67  {
68  using namespace JPP;
69 
70  JStringStream is(in);
71 
72  if (getFileStatus(is.str().c_str())) {
73  is.load();
74  }
75 
76  object.clear();
77 
78  is >> object.comment;
79 
80  int waveform;
81  int emitter;
82 
83  while (is >> waveform >> emitter) {
84  object[waveform] = emitter;
85  }
86 
87  return in;
88  }
is
Definition: JDAQCHSM.chsm:167
static JStat getFileStatus
Function object for file status.
Definition: JStat.hh:173
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
std::ostream& operator<< ( std::ostream &  out,
const JEmitterID object 
)
friend

Write emitter data to output.

Parameters
outoutput stream
objectemitter data
Returns
output stream

Definition at line 98 of file JEmitterID.hh.

99  {
100  using namespace std;
101 
102  out << object.comment;
103 
104  for (JEmitterID::const_iterator i = object.begin(); i != object.end(); ++i) {
105  out << setw(3) << i->first << ' ' << setw(2) << i->second << endl;
106  }
107 
108  return out;
109  }

Member Data Documentation

JComment JACOUSTICS::JEmitterID::comment

Definition at line 112 of file JEmitterID.hh.


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