Jpp  test_elongated_shower_pde
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
JLANG::JTimeval Class Reference

Auxiliary class for time values. More...

#include <JTimeval.hh>

Inheritance diagram for JLANG::JTimeval:
JLANG::JComparable< JTimeval > JNET::JControlHostObjectIterator< T >

Public Member Functions

 JTimeval ()
 Default constructor. More...
 
 JTimeval (const int tv_us)
 Constructor. More...
 
 JTimeval (const int tv_s, const int tv_us)
 Constructor. More...
 
const JTimevalgetTimeval () const
 Get time value. More...
 
JTimevalgetTimeval ()
 Get time value. More...
 
void setTimeval (const JTimeval &timeval)
 Set time value. More...
 
bool less (const JTimeval &value) const
 Less than method. More...
 
const timeval * get () const
 Get pointer to time value. More...
 
timeval * get ()
 Get pointer to time value. More...
 
const timeval * operator& () const
 Address of operator. More...
 
timeval * operator& ()
 Address of operator. More...
 

Static Public Member Functions

static JTimeval min ()
 Get minimal time value. More...
 
static JTimeval max ()
 Get maximal time value. More...
 

Friends

std::istream & operator>> (std::istream &in, JTimeval &time)
 Read time value from input. More...
 
std::ostream & operator<< (std::ostream &out, const JTimeval &time)
 Write time value to output. More...
 

Detailed Description

Auxiliary class for time values.

This class encapsulates the timeval data structure.

Definition at line 26 of file JTimeval.hh.

Constructor & Destructor Documentation

JLANG::JTimeval::JTimeval ( )
inline

Default constructor.

Definition at line 34 of file JTimeval.hh.

35  {
36  this->tv_sec = 0;
37  this->tv_usec = 0;
38  }
JLANG::JTimeval::JTimeval ( const int  tv_us)
inline

Constructor.

Parameters
tv_ustime [us]

Definition at line 46 of file JTimeval.hh.

47  {
48  this->tv_sec = 0;
49  this->tv_usec = tv_us;
50  }
JLANG::JTimeval::JTimeval ( const int  tv_s,
const int  tv_us 
)
inline

Constructor.

Parameters
tv_stime [s]
tv_ustime [us]

Definition at line 59 of file JTimeval.hh.

60  {
61  this->tv_sec = tv_s;
62  this->tv_usec = tv_us;
63  }

Member Function Documentation

const JTimeval& JLANG::JTimeval::getTimeval ( ) const
inline

Get time value.

Returns
time value

Definition at line 71 of file JTimeval.hh.

72  {
73  return static_cast<const JTimeval&>(*this);
74  }
Auxiliary class for time values.
Definition: JTimeval.hh:26
JTimeval& JLANG::JTimeval::getTimeval ( )
inline

Get time value.

Returns
time value

Definition at line 82 of file JTimeval.hh.

83  {
84  return static_cast<JTimeval&>(*this);
85  }
Auxiliary class for time values.
Definition: JTimeval.hh:26
void JLANG::JTimeval::setTimeval ( const JTimeval timeval)
inline

Set time value.

Parameters
timevaltime value

Definition at line 93 of file JTimeval.hh.

94  {
95  static_cast<JTimeval&>(*this) = timeval;
96  }
Auxiliary class for time values.
Definition: JTimeval.hh:26
bool JLANG::JTimeval::less ( const JTimeval value) const
inline

Less than method.

Parameters
valuetime value
Returns
true if this time value less than given time value; else false

Definition at line 105 of file JTimeval.hh.

106  {
107  if (this->tv_sec == value.tv_sec)
108  return this->tv_usec < value.tv_usec;
109  else
110  return this->tv_sec < value.tv_sec;
111  }
static JTimeval JLANG::JTimeval::min ( )
inlinestatic

Get minimal time value.

Returns
time value

Definition at line 119 of file JTimeval.hh.

120  {
121  return JTimeval(0, 0);
122  }
JTimeval()
Default constructor.
Definition: JTimeval.hh:34
static JTimeval JLANG::JTimeval::max ( )
inlinestatic

Get maximal time value.

Returns
time value

Definition at line 131 of file JTimeval.hh.

132  {
133  return JTimeval(std::numeric_limits<int>::max(), std::numeric_limits<int>::max());
134  }
JTimeval()
Default constructor.
Definition: JTimeval.hh:34
const timeval* JLANG::JTimeval::get ( ) const
inline

Get pointer to time value.

Returns
pointer to time value

Definition at line 143 of file JTimeval.hh.

144  {
145  return static_cast<const timeval*>(this);
146  }
timeval* JLANG::JTimeval::get ( )
inline

Get pointer to time value.

Returns
pointer to time value

Definition at line 154 of file JTimeval.hh.

155  {
156  return static_cast<timeval*>(this);
157  }
const timeval* JLANG::JTimeval::operator& ( ) const
inline

Address of operator.

Returns
pointer to time value

Definition at line 165 of file JTimeval.hh.

166  {
167  return get();
168  }
timeval* JLANG::JTimeval::operator& ( )
inline

Address of operator.

Returns
pointer to time value

Definition at line 176 of file JTimeval.hh.

177  {
178  return get();
179  }

Friends And Related Function Documentation

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

Read time value from input.

Parameters
ininput stream
timetime value
Returns
input stream

Definition at line 189 of file JTimeval.hh.

190  {
191  return in >> time.tv_sec >> time.tv_usec;
192  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
std::ostream& operator<< ( std::ostream &  out,
const JTimeval time 
)
friend

Write time value to output.

Parameters
outoutput stream
timetime value
Returns
output stream

Definition at line 202 of file JTimeval.hh.

203  {
204  return out << time.tv_sec << ' ' << time.tv_usec;
205  }

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