Jpp
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...
 
JHistoryadd (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 95 of file JHistory.hh.

Constructor & Destructor Documentation

◆ JHistory() [1/3]

JFIT::JHistory::JHistory ( )
inline

Default constructor.

Definition at line 182 of file JHistory.hh.

182  :
184  {}

◆ JHistory() [2/3]

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

Constructor.

Parameters
typeapplication type

Definition at line 192 of file JHistory.hh.

192  :
194  {
195  add(type);
196  }

◆ JHistory() [3/3]

JFIT::JHistory::JHistory ( const JHistory history,
const int  type 
)
inline

Constructor.

Parameters
historyhistory
typeapplication type

Definition at line 205 of file JHistory.hh.

206  :
207  std::vector<JEvent>(history)
208  {
209  add(type);
210  }

◆ ~JHistory()

virtual JFIT::JHistory::~JHistory ( )
inlinevirtual

Virtual destructor.

Definition at line 216 of file JHistory.hh.

217  {}

Member Function Documentation

◆ getHistory() [1/2]

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

Get history.

Returns
histtory

Definition at line 225 of file JHistory.hh.

226  {
227  return static_cast<const JHistory&>(*this);
228  }

◆ getHistory() [2/2]

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

Get history.

Returns
histtory

Definition at line 236 of file JHistory.hh.

237  {
238  return static_cast<JHistory&>(*this);
239  }

◆ add()

JHistory& JFIT::JHistory::add ( const int  type)
inline

Add event to history.

Parameters
typeapplication type
Returns
this history

Definition at line 248 of file JHistory.hh.

249  {
250  push_back(JEvent(type, this->size() + 1));
251 
252  return *this;
253  }

◆ ClassDef()

JFIT::JHistory::ClassDef ( JHistory  ,
 
)

Friends And Related Function Documentation

◆ operator<<

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

264  {
265  using namespace std;
266 
267  for (const_iterator i = history.begin(); i != history.end(); ++i) {
268  out << *i << endl;
269  }
270 
271  return out;
272  }

The documentation for this struct was generated from the following file:
std::vector< JEvent >
JFIT::JEvent
Auxiliary class for historical event.
Definition: JHistory.hh:32
std
Definition: jaanetDictionary.h:36
JFIT::JHistory::add
JHistory & add(const int type)
Add event to history.
Definition: JHistory.hh:248