Jpp
Public Member Functions | Public Attributes | List of all members
JFIT::JHistory::is_event Struct Reference

Auxiliary class to test history. More...

#include <JHistory.hh>

Public Member Functions

 is_event (int type)
 Constructor. More...
 
 is_event (const JHistory &history)
 Constructor. More...
 
bool operator() (const JHistory &history) const
 Test history. More...
 

Public Attributes

int type
 

Detailed Description

Auxiliary class to test history.

Definition at line 101 of file JHistory.hh.

Constructor & Destructor Documentation

◆ is_event() [1/2]

JFIT::JHistory::is_event::is_event ( int  type)
inline

Constructor.

Parameters
typeapplication type

Definition at line 107 of file JHistory.hh.

108  {
109  this->type = type;
110  }

◆ is_event() [2/2]

JFIT::JHistory::is_event::is_event ( const JHistory history)
inline

Constructor.

Parameters
historyhistory

Definition at line 118 of file JHistory.hh.

119  {
120  if (!history.empty())
121  this->type = history.rbegin()->type;
122  else
123  this->type = -1;
124  }

Member Function Documentation

◆ operator()()

bool JFIT::JHistory::is_event::operator() ( const JHistory history) const
inline

Test history.

Parameters
historyhistory
Returns
true if given history ends with specified event type; else false

Definition at line 133 of file JHistory.hh.

134  {
135  if (!history.empty()) {
136  return history.rbegin()->type == this->type;
137  }
138 
139  return false;
140  }

Member Data Documentation

◆ type

int JFIT::JHistory::is_event::type

Definition at line 142 of file JHistory.hh.


The documentation for this struct was generated from the following file:
JFIT::JHistory::is_event::type
int type
Definition: JHistory.hh:142