Container for historical events.
More...
#include <JHistory.hh>
|
std::ostream & | operator<< (std::ostream &out, const JHistory &history) |
| Write history to output stream.
|
|
Container for historical events.
Definition at line 149 of file JHistory.hh.
◆ JHistory() [1/4]
JFIT::JHistory::JHistory |
( |
| ) |
|
|
inline |
◆ JHistory() [2/4]
JFIT::JHistory::JHistory |
( |
const JEvent & | event | ) |
|
|
inline |
◆ JHistory() [3/4]
JFIT::JHistory::JHistory |
( |
const int | type | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 270 of file JHistory.hh.
270 :
272 {}
Data structure for start_event tag.
◆ JHistory() [4/4]
JFIT::JHistory::JHistory |
( |
const JHistory & | history, |
|
|
const JEvent & | event ) |
|
inline |
Constructor.
- Parameters
-
history | history |
event | event |
Definition at line 281 of file JHistory.hh.
282 :
284 {
285 push_back(event);
286 }
◆ ~JHistory()
virtual JFIT::JHistory::~JHistory |
( |
| ) |
|
|
inlinevirtual |
◆ getHistory() [1/2]
const JHistory & JFIT::JHistory::getHistory |
( |
| ) |
const |
|
inline |
Get history.
- Returns
- histtory
Definition at line 301 of file JHistory.hh.
302 {
303 return static_cast<const JHistory&
>(*this);
304 }
JHistory()
Default constructor.
◆ getHistory() [2/2]
JHistory & JFIT::JHistory::getHistory |
( |
| ) |
|
|
inline |
Get history.
- Returns
- histtory
Definition at line 312 of file JHistory.hh.
313 {
314 return static_cast<JHistory&
>(*this);
315 }
◆ has()
bool JFIT::JHistory::has |
( |
const int | type | ) |
const |
|
inline |
Has event in history.
- Parameters
-
- Returns
- true if given event in history; else false
Definition at line 324 of file JHistory.hh.
325 {
326 for (const_iterator i = this->begin(); i != this->end(); ++i) {
327 if (i->type == type) {
328 return true;
329 }
330 }
331
332 return false;
333 }
◆ match()
bool JFIT::JHistory::match |
( |
const JHistory & | history | ) |
const |
|
inline |
Check if given history is part of this history.
- Parameters
-
- Returns
- true if history matches; else false
Definition at line 342 of file JHistory.hh.
343 {
344 if (!history.empty()) {
345
346 const_iterator i = history.begin();
347 const_iterator p = this->begin();
348
349 while (p != this->end() && *p != *i) {
350 ++p;
351 }
352
353 while (i != history.end() && p != this->end() && *i == *p) {
354 ++i;
355 ++p;
356 }
357
358 return (i == history.end());
359 }
360
361 return false;
362 }
◆ getStatus()
bool JFIT::JHistory::getStatus |
( |
const std::vector< int > & | types | ) |
const |
|
inline |
Get status.
- Parameters
-
- Returns
- true if history matches appplication types; else false
Definition at line 371 of file JHistory.hh.
372 {
373 if (this->size() == types.size()) {
374
375 for (size_t i = 0; i != this->size(); ++i) {
376 if ((*this)[i].type != types[i]) {
377 return false;
378 }
379 }
380
381 return true;
382
383 } else {
384
385 return false;
386 }
387 }
◆ add()
JHistory & JFIT::JHistory::add |
( |
const int | type | ) |
|
|
inline |
Add event to history.
- Parameters
-
- Returns
- this history
Definition at line 396 of file JHistory.hh.
397 {
399
400 return *this;
401 }
◆ hasParentUUID()
bool JFIT::JHistory::hasParentUUID |
( |
| ) |
const |
|
inline |
Has parent UUID.
Definition at line 407 of file JHistory.hh.
408 {
409 return this->size() >= 2u;
410 }
◆ getUUID()
const JUUID & JFIT::JHistory::getUUID |
( |
| ) |
const |
|
inline |
Get UUID.
Definition at line 416 of file JHistory.hh.
417 {
418 return this->at(this->size() - 1).uuid;
419 }
◆ getParentUUID()
const JUUID & JFIT::JHistory::getParentUUID |
( |
| ) |
const |
|
inline |
Get parent UUID.
Definition at line 425 of file JHistory.hh.
426 {
427 return this->at(this->size() - 2).uuid;
428 }
◆ ClassDef()
JFIT::JHistory::ClassDef |
( |
JHistory | , |
|
|
2 | ) |
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | out, |
|
|
const JHistory & | history ) |
|
friend |
Write history to output stream.
- Parameters
-
out | output stream |
history | history |
- Returns
- output stream
Definition at line 438 of file JHistory.hh.
439 {
441
442 for (const_iterator i = history.begin(); i != history.end(); ++i) {
443 out << *i << endl;
444 }
445
446 return out;
447 }
The documentation for this struct was generated from the following file: