Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JGEOMETRY3D::JTime Class Reference

Time. More...

#include <JTime.hh>

Inheritance diagram for JGEOMETRY3D::JTime:
JGEOMETRY3D::JShower3D JGEOMETRY3D::JTrack3D JGEOMETRY3D::JVertex3D JSIRENE::JPoint JGEOMETRY3D::JShower3E JGEOMETRY3D::JTrack3E JACOUSTICS::event_type JACOUSTICS::vertex_type JFIT::JLine1Z JFIT::JPoint4D JSIRENE::JVertex JGEOMETRY3D::JShower3EY JGEOMETRY3D::JTrack3EY JFIT::JLine3Z JFIT::JModel< JLine1Z > JFIT::JEstimator< JPoint4D > JFIT::JModel< JPoint4D > JFIT::JPoint4E JFIT::JShower3Z

Public Member Functions

 JTime ()
 Default constructor.
 
 JTime (const double t)
 Constructor.
 
JTimenegate ()
 Prefix unary minus.
 
JTimeadd (const JTime &value)
 Addition operator.
 
JTimesub (const JTime &value)
 Subtraction operator.
 
JTimemul (const double value)
 Multiplication operator.
 
JTimediv (const double value)
 Division operator.
 
void setT (const double time)
 Set time.
 
double getT () const
 Get time.
 

Protected Attributes

double __t
 

Friends

std::istream & operator>> (std::istream &in, JTime &time)
 Read time from input.
 
std::ostream & operator<< (std::ostream &out, const JTime &time)
 Write time to output.
 
JReaderoperator>> (JReader &in, JTime &time)
 Read time from input.
 
JWriteroperator<< (JWriter &out, const JTime &time)
 Write time to output.
 

Detailed Description

Time.

Definition at line 28 of file JGeometry3D/JTime.hh.

Constructor & Destructor Documentation

◆ JTime() [1/2]

JGEOMETRY3D::JTime::JTime ( )
inline

Default constructor.

Definition at line 34 of file JGeometry3D/JTime.hh.

34 :
35 __t(0.0)
36 {}

◆ JTime() [2/2]

JGEOMETRY3D::JTime::JTime ( const double t)
inline

Constructor.

Parameters
ttime

Definition at line 44 of file JGeometry3D/JTime.hh.

44 :
45 __t(t)
46 {}

Member Function Documentation

◆ negate()

JTime & JGEOMETRY3D::JTime::negate ( )
inline

Prefix unary minus.

Returns
time

Definition at line 54 of file JGeometry3D/JTime.hh.

55 {
56 __t = -__t;
57
58 return *this;
59 }

◆ add()

JTime & JGEOMETRY3D::JTime::add ( const JTime & value)
inline

Addition operator.

Parameters
valuetime
Returns
time

Definition at line 68 of file JGeometry3D/JTime.hh.

69 {
70 __t += value.getT();
71
72 return *this;
73 }

◆ sub()

JTime & JGEOMETRY3D::JTime::sub ( const JTime & value)
inline

Subtraction operator.

Parameters
valuetime
Returns
time

Definition at line 82 of file JGeometry3D/JTime.hh.

83 {
84 __t -= value.getT();
85
86 return *this;
87 }

◆ mul()

JTime & JGEOMETRY3D::JTime::mul ( const double value)
inline

Multiplication operator.

Parameters
valuemultiplication factor
Returns
time

Definition at line 96 of file JGeometry3D/JTime.hh.

97 {
98 __t *= value;
99
100 return *this;
101 }

◆ div()

JTime & JGEOMETRY3D::JTime::div ( const double value)
inline

Division operator.

Parameters
valuemultiplication factor
Returns
time

Definition at line 110 of file JGeometry3D/JTime.hh.

111 {
112 __t /= value;
113
114 return *this;
115 }

◆ setT()

void JGEOMETRY3D::JTime::setT ( const double time)
inline

Set time.

Parameters
time

Definition at line 123 of file JGeometry3D/JTime.hh.

124 {
125 __t = time;
126 }

◆ getT()

double JGEOMETRY3D::JTime::getT ( ) const
inline

Get time.

Returns
time

Definition at line 134 of file JGeometry3D/JTime.hh.

135 {
136 return __t;
137 }

Friends And Related Symbol Documentation

◆ operator>> [1/2]

std::istream & operator>> ( std::istream & in,
JTime & time )
friend

Read time from input.

Parameters
ininput stream
timetime
Returns
input stream

Definition at line 147 of file JGeometry3D/JTime.hh.

148 {
149 in >> time.__t;
150
151 return in;
152 }

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & out,
const JTime & time )
friend

Write time to output.

Parameters
outoutput stream
timetime
Returns
output stream

Definition at line 162 of file JGeometry3D/JTime.hh.

163 {
164 const JFormat format(out, getFormat<JTime>(JFormat_t(12, 3, std::ios::fixed | std::ios::showpos)));
165
166 out << time.__t;
167
168 return out;
169 }
JFormat_t & getFormat()
Get format for given type.
Definition JManip.hh:682
Data structure for format specifications.
Definition JManip.hh:524
Auxiliary class to temporarily define format specifications.
Definition JManip.hh:636

◆ operator>> [2/2]

JReader & operator>> ( JReader & in,
JTime & time )
friend

Read time from input.

Parameters
inreader
timetime
Returns
reader

Definition at line 179 of file JGeometry3D/JTime.hh.

180 {
181 in >> time.__t;
182
183 return in;
184 }

◆ operator<< [2/2]

JWriter & operator<< ( JWriter & out,
const JTime & time )
friend

Write time to output.

Parameters
outwriter
timetime
Returns
writer

Definition at line 194 of file JGeometry3D/JTime.hh.

195 {
196 out << time.__t;
197
198 return out;
199 }

Member Data Documentation

◆ __t

double JGEOMETRY3D::JTime::__t
protected

Definition at line 203 of file JGeometry3D/JTime.hh.


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