Jpp  16.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 JHistory & getHistory () const
 Get history. More...
 
JHistory & getHistory ()
 Get history. More...
 
bool has (const int type) const
 Has event in history. More...
 
JHistory & add (const int type)
 Add event to history. More...
 
 ClassDef (JHistory, 1)
 

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

Constructor & Destructor Documentation

JFIT::JHistory::JHistory ( )
inline

Default constructor.

Definition at line 185 of file JHistory.hh.

185  :
187  {}
JFIT::JHistory::JHistory ( const int  type)
inline

Constructor.

Parameters
typeapplication type

Definition at line 195 of file JHistory.hh.

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

Constructor.

Parameters
historyhistory
typeapplication type

Definition at line 208 of file JHistory.hh.

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

Virtual destructor.

Definition at line 219 of file JHistory.hh.

220  {}

Member Function Documentation

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

Get history.

Returns
histtory

Definition at line 228 of file JHistory.hh.

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

Get history.

Returns
histtory

Definition at line 239 of file JHistory.hh.

240  {
241  return static_cast<JHistory&>(*this);
242  }
Container for historical events.
Definition: JHistory.hh:98
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 251 of file JHistory.hh.

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

Add event to history.

Parameters
typeapplication type
Returns
this history

Definition at line 269 of file JHistory.hh.

270  {
271  push_back(JEvent(type, this->size() + 1));
272 
273  return *this;
274  }
JFIT::JEvent JEvent
Definition: JHistory.hh:300
JFIT::JHistory::ClassDef ( JHistory  ,
1   
)

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

285  {
286  using namespace std;
287 
288  for (const_iterator i = history.begin(); i != history.end(); ++i) {
289  out << *i << endl;
290  }
291 
292  return out;
293  }

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