Jpp  17.0.0
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 JHistorygetHistory () const
 Get history. More...
 
JHistorygetHistory ()
 Get history. More...
 
bool has (const int type) const
 Has event in history. More...
 
JHistoryadd (const int type)
 Add event to history. More...
 
bool hasParentUUID () const
 Has parent UUID. More...
 
const JUUIDgetUUID () const
 Get UUID. More...
 
const JUUIDgetParentUUID () 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:270
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:270
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  }
JHistory& JFIT::JHistory::add ( const int  type)
inline

Add event to history.

Parameters
typeapplication type
Returns
this history

Definition at line 270 of file JHistory.hh.

271  {
272  push_back(JEvent(type));
273 
274  return *this;
275  }
JFIT::JEvent JEvent
Definition: JHistory.hh:328
bool JFIT::JHistory::hasParentUUID ( ) const
inline

Has parent UUID.

Definition at line 281 of file JHistory.hh.

282  {
283  return this->size() >= 2u;
284  }
double u[N+1]
Definition: JPolint.hh:755
const JUUID& JFIT::JHistory::getUUID ( ) const
inline

Get UUID.

Definition at line 290 of file JHistory.hh.

291  {
292  return this->at(this->size() - 1).uuid;
293  }
const JUUID& JFIT::JHistory::getParentUUID ( ) const
inline

Get parent UUID.

Definition at line 299 of file JHistory.hh.

300  {
301  return this->at(this->size() - 2).uuid;
302  }
JFIT::JHistory::ClassDef ( JHistory  ,
 
)

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 312 of file JHistory.hh.

313  {
314  using namespace std;
315 
316  for (const_iterator i = history.begin(); i != history.end(); ++i) {
317  out << *i << endl;
318  }
319 
320  return out;
321  }

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