STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
chrono::duration< _Rep, _Period > Class Template Reference

Public Types

typedef duration< _Rep, _Period > _Myt
 
typedef _Rep rep
 
typedef _Period period
 

Public Member Functions

 duration ()
 
template<class _Rep2 , class = typename enable_if<is_convertible<_Rep2, _Rep>::value && (treat_as_floating_point<_Rep>::value || !treat_as_floating_point<_Rep2>::value), void>::type>
 duration (const _Rep2 &_Val)
 
template<class _Rep2 , class _Period2 , class = typename enable_if<treat_as_floating_point<_Rep>::value || (ratio_divide<_Period2, _Period>::den == 1 && !treat_as_floating_point<_Rep2>::value), void>::type>
 duration (const duration< _Rep2, _Period2 > &_Dur)
 
_Rep count () const
 
_Myt operator+ () const
 
_Myt operator- () const
 
_Mytoperator++ ()
 
_Myt operator++ (int)
 
_Mytoperator-- ()
 
_Myt operator-- (int)
 
_Mytoperator+= (const _Myt &_Right)
 
_Mytoperator-= (const _Myt &_Right)
 
_Mytoperator*= (const _Rep &_Right)
 
_Mytoperator/= (const _Rep &_Right)
 
_Mytoperator%= (const _Rep &_Right)
 
_Mytoperator%= (const _Myt &_Right)
 

Static Public Member Functions

static _Myt zero ()
 
static _Myt() min ()
 
static _Myt() max ()
 

Private Attributes

_Rep _MyRep
 

Member Typedef Documentation

template<class _Rep, class _Period>
typedef duration<_Rep, _Period> chrono::duration< _Rep, _Period >::_Myt
template<class _Rep, class _Period>
typedef _Period chrono::duration< _Rep, _Period >::period
template<class _Rep, class _Period>
typedef _Rep chrono::duration< _Rep, _Period >::rep

Constructor & Destructor Documentation

template<class _Rep, class _Period>
chrono::duration< _Rep, _Period >::duration ( )
inline
90  : _MyRep()
91  { // check asserts
92  static_assert(_Is_ratio<_Period>::value,
93  "period must be an instance of std::ratio");
94  static_assert(0 < _Period::num,
95  "duration negative or zero");
96  }
_Rep _MyRep
Definition: chrono:217
template<class _Rep, class _Period>
template<class _Rep2 , class = typename enable_if<is_convertible<_Rep2, _Rep>::value && (treat_as_floating_point<_Rep>::value || !treat_as_floating_point<_Rep2>::value), void>::type>
chrono::duration< _Rep, _Period >::duration ( const _Rep2 &  _Val)
inlineexplicit
104  : _MyRep(static_cast<_Rep>(_Val))
105  { // construct from representation
106  static_assert(_Is_ratio<_Period>::value,
107  "period not an instance of std::ratio");
108  static_assert(0 < _Period::num,
109  "duration negative or zero");
110  }
_Rep _MyRep
Definition: chrono:217
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Rep, class _Period>
template<class _Rep2 , class _Period2 , class = typename enable_if<treat_as_floating_point<_Rep>::value || (ratio_divide<_Period2, _Period>::den == 1 && !treat_as_floating_point<_Rep2>::value), void>::type>
chrono::duration< _Rep, _Period >::duration ( const duration< _Rep2, _Period2 > &  _Dur)
inline
119  : _MyRep(duration_cast<_Myt>(_Dur).count())
120  { // construct from a duration
121  typedef ratio_divide<_Period2, _Period> _Checked_type;
122 
123  static_assert(_Is_ratio<_Period>::value,
124  "period not an instance of std::ratio");
125  static_assert(0 < _Period::num,
126  "duration negative or zero");
127  }
_Rep _MyRep
Definition: chrono:217
typename _Ratio_divide< _R1, _R2 >::type ratio_divide
Definition: ratio:242
_Rep count() const
Definition: chrono:129

Member Function Documentation

template<class _Rep, class _Period>
_Rep chrono::duration< _Rep, _Period >::count ( ) const
inline
130  { // get stored rep
131  return (_MyRep);
132  }
_Rep _MyRep
Definition: chrono:217
template<class _Rep, class _Period>
static _Myt() chrono::duration< _Rep, _Period >::max ( )
inlinestatic
212  { // get maximum value
213  return (_Myt((duration_values<_Rep>::max)()));
214  }
#define max(a, b)
Definition: minmax.h:19
duration< _Rep, _Period > _Myt
Definition: chrono:85
template<class _Rep, class _Period>
static _Myt() chrono::duration< _Rep, _Period >::min ( )
inlinestatic
208  { // get minimum value
209  return (_Myt((duration_values<_Rep>::min)()));
210  }
#define min(a, b)
Definition: minmax.h:23
duration< _Rep, _Period > _Myt
Definition: chrono:85
template<class _Rep, class _Period>
_Myt& chrono::duration< _Rep, _Period >::operator%= ( const _Rep &  _Right)
inline
191  { // modulus rep by _Right
192  _MyRep %= _Right;
193  return (*this);
194  }
_Rep _MyRep
Definition: chrono:217
const _Ty & _Right
Definition: algorithm:4087
template<class _Rep, class _Period>
_Myt& chrono::duration< _Rep, _Period >::operator%= ( const _Myt _Right)
inline
197  { // modulus rep by _Right
198  _MyRep %= _Right.count();
199  return (*this);
200  }
_Rep _MyRep
Definition: chrono:217
const _Ty & _Right
Definition: algorithm:4087
template<class _Rep, class _Period>
_Myt& chrono::duration< _Rep, _Period >::operator*= ( const _Rep &  _Right)
inline
179  { // multiply rep by _Right
180  _MyRep *= _Right;
181  return (*this);
182  }
_Rep _MyRep
Definition: chrono:217
const _Ty & _Right
Definition: algorithm:4087
template<class _Rep, class _Period>
_Myt chrono::duration< _Rep, _Period >::operator+ ( ) const
inline
135  { // get value
136  return (*this);
137  }
template<class _Rep, class _Period>
_Myt& chrono::duration< _Rep, _Period >::operator++ ( )
inline
145  { // increment rep
146  ++_MyRep;
147  return (*this);
148  }
_Rep _MyRep
Definition: chrono:217
template<class _Rep, class _Period>
_Myt chrono::duration< _Rep, _Period >::operator++ ( int  )
inline
151  { // postincrement rep
152  return (_Myt(_MyRep++));
153  }
duration< _Rep, _Period > _Myt
Definition: chrono:85
_Rep _MyRep
Definition: chrono:217
template<class _Rep, class _Period>
_Myt& chrono::duration< _Rep, _Period >::operator+= ( const _Myt _Right)
inline
167  { // add _Right to rep
168  _MyRep += _Right._MyRep;
169  return (*this);
170  }
_Rep _MyRep
Definition: chrono:217
const _Ty & _Right
Definition: algorithm:4087
template<class _Rep, class _Period>
_Myt chrono::duration< _Rep, _Period >::operator- ( void  ) const
inline
140  { // get negated value
141  return (_Myt(0 - _MyRep));
142  }
duration< _Rep, _Period > _Myt
Definition: chrono:85
_Rep _MyRep
Definition: chrono:217
template<class _Rep, class _Period>
_Myt& chrono::duration< _Rep, _Period >::operator-- ( )
inline
156  { // decrement rep
157  --_MyRep;
158  return (*this);
159  }
_Rep _MyRep
Definition: chrono:217
template<class _Rep, class _Period>
_Myt chrono::duration< _Rep, _Period >::operator-- ( int  )
inline
162  { // postdecrement rep
163  return (_Myt(_MyRep--));
164  }
duration< _Rep, _Period > _Myt
Definition: chrono:85
_Rep _MyRep
Definition: chrono:217
template<class _Rep, class _Period>
_Myt& chrono::duration< _Rep, _Period >::operator-= ( const _Myt _Right)
inline
173  { // subtract _Right from rep
174  _MyRep -= _Right._MyRep;
175  return (*this);
176  }
_Rep _MyRep
Definition: chrono:217
const _Ty & _Right
Definition: algorithm:4087
template<class _Rep, class _Period>
_Myt& chrono::duration< _Rep, _Period >::operator/= ( const _Rep &  _Right)
inline
185  { // divide rep by _Right
186  _MyRep /= _Right;
187  return (*this);
188  }
_Rep _MyRep
Definition: chrono:217
const _Ty & _Right
Definition: algorithm:4087
template<class _Rep, class _Period>
static _Myt chrono::duration< _Rep, _Period >::zero ( )
inlinestatic
203  { // get zero value
204  return (_Myt(duration_values<_Rep>::zero()));
205  }
duration< _Rep, _Period > _Myt
Definition: chrono:85

Member Data Documentation

template<class _Rep, class _Period>
_Rep chrono::duration< _Rep, _Period >::_MyRep
private

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