Time_Helper.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef OPENDDS_DCPS_TIME_HELPER_H
00009 #define OPENDDS_DCPS_TIME_HELPER_H
00010 
00011 #include "dds/DdsDcpsCoreC.h"
00012 #include "ace/OS_NS_sys_time.h"
00013 
00014 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00015 #pragma once
00016 #endif /* ACE_LACKS_PRAGMA_ONCE */
00017 
00018 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00019 
00020 namespace OpenDDS {
00021 namespace DCPS {
00022 
00023 ACE_INLINE OpenDDS_Dcps_Export
00024 ACE_Time_Value time_to_time_value(const DDS::Time_t& t);
00025 
00026 ACE_INLINE OpenDDS_Dcps_Export
00027 DDS::Time_t time_value_to_time(const ACE_Time_Value& tv);
00028 
00029 ACE_INLINE OpenDDS_Dcps_Export
00030 ACE_Time_Value duration_to_time_value(const DDS::Duration_t& t);
00031 
00032 ACE_INLINE OpenDDS_Dcps_Export
00033 ACE_Time_Value duration_to_absolute_time_value(const DDS::Duration_t& t,
00034                                                const ACE_Time_Value& now = ACE_OS::gettimeofday());
00035 
00036 ACE_INLINE OpenDDS_Dcps_Export
00037 DDS::Duration_t time_value_to_duration(const ACE_Time_Value& tv);
00038 
00039 ACE_INLINE OpenDDS_Dcps_Export
00040 DDS::Duration_t time_to_duration(const DDS::Time_t& t);
00041 
00042 /// Validate DDS::Duration_t value (infinite or positive and
00043 /// non-zero).
00044 ACE_INLINE OpenDDS_Dcps_Export
00045 bool valid_duration(DDS::Duration_t const & t);
00046 
00047 /// Check if given duration is either infinite or greater than or
00048 /// equal to zero.
00049 ACE_INLINE OpenDDS_Dcps_Export
00050 bool non_negative_duration(const DDS::Duration_t& t);
00051 
00052 #ifndef OPENDDS_SAFETY_PROFILE
00053 ACE_INLINE OpenDDS_Dcps_Export
00054 bool operator==(const DDS::Duration_t& t1, const DDS::Duration_t& t2);
00055 
00056 ACE_INLINE OpenDDS_Dcps_Export
00057 bool operator!=(const DDS::Duration_t& t1, const DDS::Duration_t& t2);
00058 #endif
00059 
00060 ACE_INLINE OpenDDS_Dcps_Export
00061 bool operator<(const DDS::Duration_t& t1, const DDS::Duration_t& t2);
00062 
00063 ACE_INLINE OpenDDS_Dcps_Export
00064 bool operator<=(const DDS::Duration_t& t1, const DDS::Duration_t& t2);
00065 
00066 ACE_INLINE OpenDDS_Dcps_Export
00067 bool operator>(const DDS::Duration_t& t1, const DDS::Duration_t& t2);
00068 
00069 ACE_INLINE OpenDDS_Dcps_Export
00070 bool operator>=(const DDS::Duration_t& t1, const DDS::Duration_t& t2);
00071 
00072 ACE_INLINE OpenDDS_Dcps_Export
00073 bool operator!(const DDS::Time_t& t);
00074 
00075 #ifndef OPENDDS_SAFETY_PROFILE
00076 ACE_INLINE OpenDDS_Dcps_Export
00077 bool operator==(const DDS::Time_t& t1, const DDS::Time_t& t2);
00078 
00079 ACE_INLINE OpenDDS_Dcps_Export
00080 bool operator!=(const DDS::Time_t& t1, const DDS::Time_t& t2);
00081 #endif
00082 
00083 ACE_INLINE OpenDDS_Dcps_Export
00084 bool operator<(const DDS::Time_t& t1, const DDS::Time_t& t2);
00085 
00086 ACE_INLINE OpenDDS_Dcps_Export
00087 bool operator<=(const DDS::Time_t& t1, const DDS::Time_t& t2);
00088 
00089 ACE_INLINE OpenDDS_Dcps_Export
00090 bool operator>(const DDS::Time_t& t1, const DDS::Time_t& t2);
00091 
00092 ACE_INLINE OpenDDS_Dcps_Export
00093 bool operator>=(const DDS::Time_t& t1, const DDS::Time_t& t2);
00094 
00095 ACE_INLINE OpenDDS_Dcps_Export
00096 DDS::Time_t operator-(const DDS::Time_t& t1, const DDS::Time_t& t2);
00097 
00098 } // namespace DCPS
00099 } // namespace OpenDDS
00100 
00101 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00102 
00103 #if defined(__ACE_INLINE__)
00104 #include "Time_Helper.inl"
00105 #endif /* __ACE_INLINE__ */
00106 
00107 #endif /* OPENDDS_DCPS_TIME_HELPER_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1