Jpp  17.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAcoustics/JTriggerOutput.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JTRIGGEROUTPUT__
2 #define __JACOUSTICS__JTRIGGEROUTPUT__
3 
4 #include <vector>
5 
6 #include "JAcoustics/JEvent.hh"
7 
8 
9 /**
10  * \author mdejong
11  */
12 
13 namespace JACOUSTICS {}
14 namespace JPP { using namespace JACOUSTICS; }
15 
16 namespace JACOUSTICS {
17 
18 
19  /**
20  * Set of acoustics events.
21  */
23  public std::vector<JEvent>
24  {
25  public:
26  /**
27  * Default constructor.
28  */
30  std::vector<JEvent>()
31  {}
32 
33 
34  /**
35  * Merge events.
36  *
37  * \param match match criterion
38  */
39  template<class JMatch_t>
40  inline void merge(const JMatch_t& match)
41  {
42  std::sort(this->begin(), this->end());
43 
44  iterator out = this->begin();
45 
46  for (iterator i = this->begin(); i != this->end(); ++out) {
47 
48  if (out != i) {
49  *out = *i; // copy event
50  }
51 
52  while (++i != this->end() && match(*out,*i)) {
53  out->merge(*i); // merge event
54  }
55  }
56 
57  this->erase(out, this->end());
58  }
59  };
60 }
61 
62 #endif
Acoustic event.
void merge(const JMatch_t &match)
Merge events.
Acoustic event.
JTriggerOutput()
Default constructor.