00001
00002
00003
00004
00005 #include "tao/orbconf.h"
00006 #include "ace/OS_NS_string.h"
00007
00008 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00009
00010 namespace TAO
00011 {
00012 namespace Portable_Server
00013 {
00014 ACE_INLINE CORBA::ULong
00015 Creation_Time::creation_time_length (void)
00016 {
00017 return 2 * sizeof (CORBA::ULong);
00018 }
00019
00020 ACE_INLINE
00021 Creation_Time::Creation_Time (const ACE_Time_Value &creation_time)
00022 {
00023 this->time_stamp_[Creation_Time::SEC_FIELD] = (CORBA::ULong) creation_time.sec ();
00024 this->time_stamp_[Creation_Time::USEC_FIELD] = (CORBA::ULong) creation_time.usec ();
00025 }
00026
00027 ACE_INLINE
00028 Creation_Time::Creation_Time (void)
00029 {
00030 this->time_stamp_[Creation_Time::SEC_FIELD] = 0;
00031 this->time_stamp_[Creation_Time::USEC_FIELD] = 0;
00032 }
00033
00034 ACE_INLINE void
00035 Creation_Time::creation_time (const void *creation_time)
00036 {
00037 ACE_OS::memcpy (&this->time_stamp_,
00038 creation_time,
00039 Creation_Time::creation_time_length ());
00040 }
00041
00042 ACE_INLINE const void *
00043 Creation_Time::creation_time (void) const
00044 {
00045 return &this->time_stamp_;
00046 }
00047
00048 ACE_INLINE bool
00049 Creation_Time::operator== (const Creation_Time &rhs) const
00050 {
00051 #if (POA_NO_TIMESTAMP == 1)
00052 ACE_UNUSED_ARG (rhs);
00053 return true;
00054 #else
00055 return ACE_OS::memcmp (&this->time_stamp_,
00056 &rhs.time_stamp_,
00057 Creation_Time::creation_time_length ()) == 0;
00058 #endif
00059 }
00060
00061 ACE_INLINE bool
00062 Creation_Time::operator!= (const Creation_Time &rhs) const
00063 {
00064 #if (POA_NO_TIMESTAMP == 1)
00065 ACE_UNUSED_ARG (rhs);
00066 return false;
00067 #else
00068 return ACE_OS::memcmp (&this->time_stamp_,
00069 &rhs.time_stamp_,
00070 Creation_Time::creation_time_length ()) != 0;
00071 #endif
00072 }
00073
00074 ACE_INLINE bool
00075 Temporary_Creation_Time::operator== (const Creation_Time &rhs) const
00076 {
00077 #if (POA_NO_TIMESTAMP == 1)
00078 ACE_UNUSED_ARG (rhs);
00079 return true;
00080 #else
00081 return ACE_OS::memcmp (this->time_stamp_,
00082 rhs.creation_time (),
00083 Creation_Time::creation_time_length ()) == 0;
00084 #endif
00085 }
00086
00087 ACE_INLINE bool
00088 Temporary_Creation_Time::operator!= (const Creation_Time &rhs) const
00089 {
00090 #if (POA_NO_TIMESTAMP == 1)
00091 ACE_UNUSED_ARG (rhs);
00092 return false;
00093 #else
00094 return ACE_OS::memcmp (this->time_stamp_,
00095 rhs.creation_time (),
00096 Creation_Time::creation_time_length ()) != 0;
00097 #endif
00098 }
00099
00100 ACE_INLINE bool
00101 Creation_Time::operator== (const Temporary_Creation_Time &rhs) const
00102 {
00103 return rhs == *this;
00104 }
00105
00106 ACE_INLINE bool
00107 Creation_Time::operator!= (const Temporary_Creation_Time &rhs) const
00108 {
00109 return rhs != *this;
00110 }
00111
00112 ACE_INLINE
00113 Temporary_Creation_Time::Temporary_Creation_Time (void)
00114 : time_stamp_ (0)
00115 {
00116 }
00117
00118 ACE_INLINE void
00119 Temporary_Creation_Time::creation_time (const void *creation_time)
00120 {
00121 this->time_stamp_ = (void *) creation_time;
00122 }
00123 }
00124 }
00125
00126 TAO_END_VERSIONED_NAMESPACE_DECL