Revision: 8893
http://playerstage.svn.sourceforge.net/playerstage/?rev=8893&view=rev
Author: hsujohnhsu
Date: 2010-09-10 23:50:57 +0000 (Fri, 10 Sep 2010)
Log Message:
-----------
adding type_cast overload for time
Modified Paths:
--------------
code/gazebo/branches/wg/server/Time.cc
code/gazebo/branches/wg/server/Time.hh
Modified: code/gazebo/branches/wg/server/Time.cc
===================================================================
--- code/gazebo/branches/wg/server/Time.cc 2010-09-10 22:42:00 UTC (rev
8892)
+++ code/gazebo/branches/wg/server/Time.cc 2010-09-10 23:50:57 UTC (rev
8893)
@@ -313,6 +313,11 @@
return *this > Time(time);
}
+bool Time::operator>( int time ) const
+{
+ return *this > Time((double)time);
+}
+
bool Time::operator>=( const struct timeval &tv ) const
{
return *this >= Time(tv);
@@ -328,7 +333,12 @@
return *this >= Time(time);
}
+bool Time::operator>=( int time ) const
+{
+ return *this >= Time((double)time);
+}
+
void Time::Correct()
{
// Make any corrections
Modified: code/gazebo/branches/wg/server/Time.hh
===================================================================
--- code/gazebo/branches/wg/server/Time.hh 2010-09-10 22:42:00 UTC (rev
8892)
+++ code/gazebo/branches/wg/server/Time.hh 2010-09-10 23:50:57 UTC (rev
8893)
@@ -138,6 +138,9 @@
/// \brief Division operators
public: const Time &operator /=( const Time &time );
+ /// \brief Division operators
+ public: operator double() {return (const double)this->Double();};
+
/// \brief Equality operators
public: bool operator==( const struct timeval &tv ) const;
/// \brief Equality operators
@@ -169,11 +172,15 @@
/// \brief Equality operators
public: bool operator>( double time ) const;
/// \brief Equality operators
+ public: bool operator>( int time ) const;
+ /// \brief Equality operators
public: bool operator>=( const struct timeval &tv ) const;
/// \brief Equality operators
public: bool operator>=( const Time &time ) const;
/// \brief Equality operators
public: bool operator>=( double time ) const;
+ /// \brief Equality operators
+ public: bool operator>=( int time ) const;
/// Stream operators
public: friend std::ostream &operator<<(std::ostream &out, const
gazebo::Time &time)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit