Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Friends | List of all members
JFIT::JHistory Struct Reference

Container for historical events. More...

#include <JHistory.hh>

Inheritance diagram for JFIT::JHistory:
std::vector< JEvent > JFIT::JFit

Classes

struct  is_event
 Auxiliary class to test history. More...
 
struct  is_not_event
 Auxiliary class to test history. More...
 

Public Member Functions

 JHistory ()
 Default constructor. More...
 
 JHistory (const int type)
 Constructor. More...
 
 JHistory (const JHistory &history, const int type)
 Constructor. More...
 
virtual ~JHistory ()
 Virtual destructor. More...
 
const JHistory & getHistory () const
 Get history. More...
 
JHistory & getHistory ()
 Get history. More...
 
bool has (const int type) const
 Has event in history. More...
 
bool getStatus (const std::vector< int > &types) const
 Get status. More...
 
JHistory & add (const int type)
 Add event to history. More...
 
bool hasParentUUID () const
 Has parent UUID. More...
 
const JUUID & getUUID () const
 Get UUID. More...
 
const JUUID & getParentUUID () const
 Get parent UUID. More...
 
 ClassDef (JHistory, 2)
 

Friends

std::ostream & operator<< (std::ostream &out, const JHistory &history)
 Write history to output stream. More...
 

Detailed Description

Container for historical events.

Definition at line 99 of file JHistory.hh.

Constructor & Destructor Documentation

JFIT::JHistory::JHistory ( )
inline

Default constructor.

Definition at line 186 of file JHistory.hh.

186  :
188  {}
JFIT::JHistory::JHistory ( const int  type)
inline

Constructor.

Parameters
typeapplication type

Definition at line 196 of file JHistory.hh.

196  :
198  {
199  add(type);
200  }
JHistory & add(const int type)
Add event to history.
Definition: JHistory.hh:295
JFIT::JHistory::JHistory ( const JHistory &  history,
const int  type 
)
inline

Constructor.

Parameters
historyhistory
typeapplication type

Definition at line 209 of file JHistory.hh.

210  :
211  std::vector<JEvent>(history)
212  {
213  add(type);
214  }
JHistory & add(const int type)
Add event to history.
Definition: JHistory.hh:295
virtual JFIT::JHistory::~JHistory ( )
inlinevirtual

Virtual destructor.

Definition at line 220 of file JHistory.hh.

221  {}

Member Function Documentation

const JHistory& JFIT::JHistory::getHistory ( ) const
inline

Get history.

Returns
histtory

Definition at line 229 of file JHistory.hh.

230  {
231  return static_cast<const JHistory&>(*this);
232  }
Container for historical events.
Definition: JHistory.hh:99
JHistory& JFIT::JHistory::getHistory ( )
inline

Get history.

Returns
histtory

Definition at line 240 of file JHistory.hh.

241  {
242  return static_cast<JHistory&>(*this);
243  }
Container for historical events.
Definition: JHistory.hh:99
bool JFIT::JHistory::has ( const int  type) const
inline

Has event in history.

Parameters
typeapplication type
Returns
true if given event in history; else false

Definition at line 252 of file JHistory.hh.

253  {
254  for (const_iterator i = this->begin(); i != this->end(); ++i) {
255  if (i->type == type) {
256  return true;
257  }
258  }
259 
260  return false;
261  }
bool JFIT::JHistory::getStatus ( const std::vector< int > &  types) const
inline

Get status.

Parameters
typesapplication types
Returns
true if history matches appplication types; else false

Definition at line 270 of file JHistory.hh.

271  {
272  if (this->size() == types.size()) {
273 
274  for (size_t i = 0; i != this->size(); ++i) {
275  if ((*this)[i].type != types[i]) {
276  return false;
277  }
278  }
279 
280  return true;
281 
282  } else {
283 
284  return false;
285  }
286  }
JHistory& JFIT::JHistory::add ( const int  type)
inline

Add event to history.

Parameters
typeapplication type
Returns
this history

Definition at line 295 of file JHistory.hh.

296  {
297  push_back(JEvent(type));
298 
299  return *this;
300  }
JFIT::JEvent JEvent
Definition: JHistory.hh:353
bool JFIT::JHistory::hasParentUUID ( ) const
inline

Has parent UUID.

Definition at line 306 of file JHistory.hh.

307  {
308  return this->size() >= 2u;
309  }
double u[N+1]
Definition: JPolint.hh:865
const JUUID& JFIT::JHistory::getUUID ( ) const
inline

Get UUID.

Definition at line 315 of file JHistory.hh.

316  {
317  return this->at(this->size() - 1).uuid;
318  }
const JUUID& JFIT::JHistory::getParentUUID ( ) const
inline

Get parent UUID.

Definition at line 324 of file JHistory.hh.

325  {
326  return this->at(this->size() - 2).uuid;
327  }
JFIT::JHistory::ClassDef ( JHistory  ,
2   
)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const JHistory &  history 
)
friend

Write history to output stream.

Parameters
outoutput stream
historyhistory
Returns
output stream

Definition at line 337 of file JHistory.hh.

338  {
339  using namespace std;
340 
341  for (const_iterator i = history.begin(); i != history.end(); ++i) {
342  out << *i << endl;
343  }
344 
345  return out;
346  }

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