diff options
Diffstat (limited to 'dep/acelite/ace/Time_Value.h')
-rw-r--r-- | dep/acelite/ace/Time_Value.h | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/dep/acelite/ace/Time_Value.h b/dep/acelite/ace/Time_Value.h index f92c8c7f7f5..522b1e0b0ae 100644 --- a/dep/acelite/ace/Time_Value.h +++ b/dep/acelite/ace/Time_Value.h @@ -4,7 +4,7 @@ /** * @file Time_Value.h * - * $Id: Time_Value.h 90683 2010-06-17 22:07:42Z shuston $ + * $Id: Time_Value.h 96061 2012-08-16 09:36:07Z mcorino $ * * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> */ @@ -35,17 +35,7 @@ suseconds_t const ACE_ONE_SECOND_IN_USECS = 1000000; // needed to determine if iostreams are present #include "ace/iosfwd.h" -// This forward declaration is needed by the set() and FILETIME() functions -#if defined (ACE_LACKS_LONGLONG_T) ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Export ACE_U_LongLong; -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_LACKS_LONGLONG_T */ - -// ------------------------------------------------------------------- - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - /** * @class ACE_Time_Value @@ -90,6 +80,9 @@ public: /// Construct the ACE_Time_Value object from a timespec_t. explicit ACE_Time_Value (const timespec_t &t); + /// Destructor + virtual ~ACE_Time_Value (); + # if defined (ACE_WIN32) /// Construct the ACE_Time_Value object from a Win32 FILETIME explicit ACE_Time_Value (const FILETIME &ft); @@ -250,7 +243,7 @@ public: /// Subtract @a tv to this. ACE_Time_Value &operator -= (const ACE_Time_Value &tv); - /// Substract @a tv to this. + /// Subtract @a tv to this. ACE_Time_Value &operator -= (time_t tv); /** @@ -330,6 +323,51 @@ public: double d); //@} + /// Get current time of day. + /** + * @return Time value representing current time of day. + * + * @note This method is overloaded in the time policy based template + * instantiations derived from this class. Allows for time policy + * aware time values. + */ + virtual ACE_Time_Value now () const; + + /// Converts absolute time value to time value relative to current time of day. + /** + * @return Relative time value. + * + * @note This method is overloaded in the time policy based template + * instantiations derived from this class. Allows for time policy + * aware time values. + * The developer is responsible for making sure this is an absolute + * time value compatible with the active time policy (which is system + * time for the base class). + */ + virtual ACE_Time_Value to_relative_time () const; + + /// Converts relative time value to absolute time value based on current time of day. + /** + * @return Absolute time value. + * + * @note This method is overloaded in the time policy based template + * instantiations derived from this class. Allows for time policy + * aware time values. + * The developer is responsible for making sure this is a relative + * time value. Current time of day is determined based on time policy + * (which is system time for the base class). + */ + virtual ACE_Time_Value to_absolute_time () const; + + /// Duplicates this time value (incl. time policy). + /** + * @return Dynamically allocated time value copy. + * + * @note The caller is responsible for freeing the copy when it's not needed + * anymore. + */ + virtual ACE_Time_Value * duplicate () const; + /// Dump is a no-op. /** * The dump() method is a no-op. It's here for backwards compatibility @@ -341,11 +379,7 @@ public: # if defined (ACE_WIN32) /// Const time difference between FILETIME and POSIX time. -# if defined (ACE_LACKS_LONGLONG_T) - static const ACE_U_LongLong FILETIME_to_timval_skew; -# else static const DWORDLONG FILETIME_to_timval_skew; -# endif // ACE_LACKS_LONGLONG_T # endif /* ACE_WIN32 */ private: |