Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JFIT::JEvent Struct Reference

Auxiliary class for historical event. More...

#include <JHistory.hh>

Public Member Functions

 JEvent ()
 Default constructor.
 
 JEvent (const int type)
 Constructor.
 
virtual ~JEvent ()
 Virtual destructor.
 
const JEventoperator() ()
 Make this event unique.
 
 ClassDef (JEvent, 2)
 

Public Attributes

int type
 application type
 
JUUID uuid
 UUID.
 
std::string git
 GIT revision.
 
std::string date
 date
 
uint32_t counter = 0
 internal counter
 

Friends

std::ostream & operator<< (std::ostream &out, const JEvent &event)
 Write event to output stream.
 

Detailed Description

Auxiliary class for historical event.

Definition at line 36 of file JHistory.hh.

Constructor & Destructor Documentation

◆ JEvent() [1/2]

JFIT::JEvent::JEvent ( )
inline

Default constructor.

Definition at line 40 of file JHistory.hh.

40 :
41 type(-1),
42 uuid()
43 {}
int type
application type
Definition JHistory.hh:117
JUUID uuid
UUID.
Definition JHistory.hh:118

◆ JEvent() [2/2]

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

Constructor.

Parameters
typeapplication type

Definition at line 51 of file JHistory.hh.

52 {
53 using namespace std;
54 using namespace JPP;
55
56 this->type = type;
57 this->git = getGITVersion();
58 this->date = getDateAndTime();
59
60 // UUID
61
62 random_device device;
63
64 uniform_int_distribution<uint32_t> generator(1, numeric_limits<uint32_t>::max());
65
66 uint32_t* value = reinterpret_cast<uint32_t*>(&(this->uuid.uuid));
67
68 for (int i = 0; i != 3; ++i) {
69 value[i] = generator(device);
70 }
71 }
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Description of Monte Carlo event generation applications.
Definition JHead.hh:469
std::string date
date
Definition JHistory.hh:120
std::string git
GIT revision.
Definition JHistory.hh:119
uuid_t uuid
Definition JUUID.hh:172

◆ ~JEvent()

virtual JFIT::JEvent::~JEvent ( )
inlinevirtual

Virtual destructor.

Definition at line 77 of file JHistory.hh.

78 {}

Member Function Documentation

◆ operator()()

const JEvent & JFIT::JEvent::operator() ( )
inline

Make this event unique.

Returns
event

Definition at line 86 of file JHistory.hh.

87 {
88 uint32_t* value = reinterpret_cast<uint32_t*>(&(this->uuid.uuid));
89
90 value[3] = ++counter;
91
92 return *this;
93 }
uint32_t counter
internal counter
Definition JHistory.hh:121

◆ ClassDef()

JFIT::JEvent::ClassDef ( JEvent ,
2  )

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JEvent & event )
friend

Write event to output stream.

Parameters
outoutput stream
eventevent
Returns
output stream

Definition at line 103 of file JHistory.hh.

104 {
105 using namespace std;
106
107 out << setw(3) << right << event.type << ' '
108 << setw(36) << left << event.uuid << ' '
109 << setw(20) << left << event.git << ' '
110 << setw(20) << left << event.date << right;
111
112 return out;
113 }

Member Data Documentation

◆ type

int JFIT::JEvent::type

application type

Definition at line 117 of file JHistory.hh.

◆ uuid

JUUID JFIT::JEvent::uuid

UUID.

Definition at line 118 of file JHistory.hh.

◆ git

std::string JFIT::JEvent::git

GIT revision.

Definition at line 119 of file JHistory.hh.

◆ date

std::string JFIT::JEvent::date

date

Definition at line 120 of file JHistory.hh.

◆ counter

uint32_t JFIT::JEvent::counter = 0

internal counter

Definition at line 121 of file JHistory.hh.


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