1#ifndef __JRECONSTRUCTION__JHISTORY__
2#define __JRECONSTRUCTION__JHISTORY__
61 this->
git = getGITVersion();
62 this->
date = getDateAndTime();
68 uniform_int_distribution<uint32_t>
generator(1, numeric_limits<uint32_t>::max());
70 uint32_t* value =
reinterpret_cast<uint32_t*
>(&(this->
uuid.
uuid));
72 for (
int i = 0; i != 3; ++i) {
94 this->uuid == event.
uuid &&
95 this->git == event.
git &&
96 this->date == event.
date);
107 uint32_t* value =
reinterpret_cast<uint32_t*
>(&(this->
uuid.
uuid));
126 out << setw(3) << right <<
event.type <<
' '
127 << setw(36) << left <<
event.uuid <<
' '
128 << setw(20) << left <<
event.git <<
' '
129 << setw(20) << left <<
event.date << right;
165 for (JHistory::const_iterator i = history.begin(); i != history.end(); ++i) {
166 this->push_back(i->type);
207 return !history.empty() && history.rbegin()->type == this->
type;
240 return count_if(history.begin(), history.end(), make_predicate(&
JEvent::type, this->
type)) == 0;
303 return static_cast<const JHistory&
>(*this);
314 return static_cast<JHistory&
>(*this);
324 bool has(
const int type)
const
326 for (const_iterator i = this->begin(); i != this->end(); ++i) {
327 if (i->type == type) {
344 if (!history.empty()) {
346 const_iterator i = history.begin();
347 const_iterator p = this->begin();
349 while (p != this->end() && *p != *i) {
353 while (i != history.end() && p != this->end() && *i == *p) {
358 return (i == history.end());
373 if (this->size() == types.size()) {
375 for (
size_t i = 0; i != this->size(); ++i) {
376 if ((*
this)[i].type != types[i]) {
409 return this->size() >= 2u;
418 return this->at(this->size() - 1).
uuid;
427 return this->at(this->size() - 2).
uuid;
442 for (const_iterator i = history.begin(); i != history.end(); ++i) {
Jpp environment information.
Auxiliary classes and methods for linear and iterative data regression.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Description of Monte Carlo event generation applications.
Auxiliary class for historical event.
virtual ~JEvent()
Virtual destructor.
JEvent(const int type)
Constructor.
uint32_t counter
internal counter
JEvent()
Default constructor.
friend std::ostream & operator<<(std::ostream &out, const JEvent &event)
Write event to output stream.
const JEvent & operator()()
Make this event unique.
bool equals(const JEvent &event) const
Check equality.
std::string git
GIT revision.
Auxiliary class to test history.
is_application(int type)
Constructor.
bool operator()(const JHistory &history) const
Test history.
Auxiliary class to test history.
bool operator()(const JHistory &history) const
Test history.
is_event(const JHistory &history)
Constructor.
Auxiliary class to test history.
bool operator()(const JHistory &history) const
Test history.
is_not_event(int type)
Constructor.
Container for historical events.
JHistory(const JEvent &event)
Constructor.
const JUUID & getUUID() const
Get UUID.
bool getStatus(const std::vector< int > &types) const
Get status.
bool hasParentUUID() const
Has parent UUID.
JHistory()
Default constructor.
const JUUID & getParentUUID() const
Get parent UUID.
const JHistory & getHistory() const
Get history.
JHistory & getHistory()
Get history.
JHistory(const int type)
Constructor.
JHistory(const JHistory &history, const JEvent &event)
Constructor.
virtual ~JHistory()
Virtual destructor.
bool match(const JHistory &history) const
Check if given history is part of this history.
friend std::ostream & operator<<(std::ostream &out, const JHistory &history)
Write history to output stream.
JHistory & add(const int type)
Add event to history.
bool has(const int type) const
Has event in history.
Template definition of auxiliary base class for comparison of data structures.