// <chrono> -*- C++ -*-
-// Copyright (C) 2008 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
namespace std
{
+ /**
+ * @defgroup chrono Time
+ * @ingroup utilities
+ *
+ * Classes and functions for time.
+ * @{
+ */
+
+ /** @namespace std::chrono
+ * @brief ISO C++ 0x entities sub namespace for time and date.
+ */
namespace chrono
{
template<typename _Rep, typename _Period = ratio<1>>
namespace chrono
{
- // primary template for duration_cast impl.
+ // Primary template for duration_cast impl.
template<typename _ToDuration, typename _CF, typename _CR,
bool _NumIsOne = false, bool _DenIsOne = false>
struct __duration_cast_impl
}
};
+ /// duration_cast
template<typename _ToDuration, typename _Rep, typename _Period>
inline _ToDuration
duration_cast(const duration<_Rep, _Period>& __d)
__cf::num == 1, __cf::den == 1>::__cast(__d);
}
+ /// treat_as_floating_point
template<typename _Rep>
struct treat_as_floating_point
: is_floating_point<_Rep>
{ };
+ /// duration_values
template<typename _Rep>
struct duration_values
{
const duration<_Rep2, _Period2>& __rhs)
{ return !(__lhs < __rhs); }
+ /// nanoseconds
typedef duration<int64_t, nano> nanoseconds;
+
+ /// microseconds
typedef duration<int64_t, micro> microseconds;
+
+ /// milliseconds
typedef duration<int64_t, milli> milliseconds;
+
+ /// seconds
typedef duration<int64_t > seconds;
+
+ /// minutes
typedef duration<int, ratio< 60>> minutes;
+
+ /// hours
typedef duration<int, ratio<3600>> hours;
/// time_point
duration __d;
};
+ /// time_point_cast
template<typename _ToDuration, typename _Clock, typename _Duration>
inline time_point<_Clock, _ToDuration>
time_point_cast(const time_point<_Clock, _Duration>& __t)
};
#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+ /// monotonic_clock
struct monotonic_clock
{
typedef chrono::nanoseconds duration;
#endif
typedef system_clock high_resolution_clock;
- }
-}
+ } // namespace chrono
+
+ // @} group chrono
+} // namespace std
#endif //_GLIBCXX_USE_C99_STDINT_TR1