Jpp 19.3.0-rc.1
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::JTrack3D JGEOMETRY3D::JVertex3D JSIRENE::JPoint JGEOMETRY3D::JTrack3E JACOUSTICS::event_type JACOUSTICS::vertex_type JFIT::JLine1Z JFIT::JPoint4D JSIRENE::JVertex JGEOMETRY3D::JTrack3EY JFIT::JLine3Z JFIT::JModel< JLine1Z > JFIT::JEstimator< JPoint4D > JFIT::JModel< JPoint4D > JFIT::JPoint4E JFIT::JShower3Z JFIT::JLine3EZ JFIT::JShower3EZ JFIT::JShowerEH

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 27 of file JGeometry3D/JTime.hh.

Constructor & Destructor Documentation

◆ JTime() [1/2]

JGEOMETRY3D::JTime::JTime ( )
inline

Default constructor.

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

33 :
34 __t(0.0)
35 {}

◆ JTime() [2/2]

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

Constructor.

Parameters
ttime

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

43 :
44 __t(t)
45 {}

Member Function Documentation

◆ negate()

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

Prefix unary minus.

Returns
time

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

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

◆ add()

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

Addition operator.

Parameters
valuetime
Returns
time

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

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

◆ sub()

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

Subtraction operator.

Parameters
valuetime
Returns
time

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

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

◆ mul()

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

Multiplication operator.

Parameters
valuemultiplication factor
Returns
time

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

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

◆ div()

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

Division operator.

Parameters
valuemultiplication factor
Returns
time

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

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

◆ setT()

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

Set time.

Parameters
time

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

123 {
124 __t = time;
125 }

◆ getT()

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

Get time.

Returns
time

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

134 {
135 return __t;
136 }

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 146 of file JGeometry3D/JTime.hh.

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

◆ 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 161 of file JGeometry3D/JTime.hh.

162 {
163 const JFormat format(out, getFormat<JTime>(JFormat_t(9, 3, std::ios::fixed | std::ios::showpos)));
164
165 out << time.__t;
166
167 return out;
168 }
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 178 of file JGeometry3D/JTime.hh.

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

◆ operator<< [2/2]

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

Write time to output.

Parameters
outwriter
timetime
Returns
writer

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

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

Member Data Documentation

◆ __t

double JGEOMETRY3D::JTime::__t
protected

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


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