diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2012-08-16 09:36:07 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2012-08-16 09:36:07 +0000 |
commit | f25c7a2aa1e464b424ba5add600f9a3e0edc9ee2 (patch) | |
tree | 176c473ff67ebacacb932706101f3a4f46d352a4 /ACE/ace/Monotonic_Time_Policy.h | |
parent | 22a406258b246f6f07610d38f749ba3a8c7cbd7e (diff) | |
download | ATCD-f25c7a2aa1e464b424ba5add600f9a3e0edc9ee2.tar.gz |
ChangeLogTag: Thu Aug 16 09:22:31 UTC 2012 Martin Corino <mcorino@remedy.nl>
Diffstat (limited to 'ACE/ace/Monotonic_Time_Policy.h')
-rw-r--r-- | ACE/ace/Monotonic_Time_Policy.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/ACE/ace/Monotonic_Time_Policy.h b/ACE/ace/Monotonic_Time_Policy.h new file mode 100644 index 00000000000..6e7dbd3cbf7 --- /dev/null +++ b/ACE/ace/Monotonic_Time_Policy.h @@ -0,0 +1,50 @@ +#ifndef ACE_MONOTONIC_TIME_POLICY_H +#define ACE_MONOTONIC_TIME_POLICY_H +// -*- C++ -*- +/** + * @file Monotonic_Time_Policy.h + * + * $Id$ + * + * @author Martin Corino <mcorino@remedy.nl> + */ +#include /**/ "ace/pre.h" + +#include /**/ "ace/config-all.h" + +#include /**/ "ace/Time_Value_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class ACE_Monotonic_Time_Policy + * + * @brief Implement a monotonic time policy for ACE. + * + * This class implements support for returning monotonic time values + * on platforms that support that. + * If a platform does not support monotonic time the policy returns + * ACE_Time_Value::zero. + */ +class ACE_Export ACE_Monotonic_Time_Policy +{ +public: + /// Return the current time according to this policy + ACE_Time_Value_T<ACE_Monotonic_Time_Policy> operator() () const; + + /// Noop. Just here to satisfy backwards compatibility demands. + void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void)); +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#if defined (__ACE_INLINE__) +#include "ace/Monotonic_Time_Policy.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* ACE_MONOTONIC_TIME_POLICY_H */ |