Home Hierarchy Members Alphabetical Related Pages

sftime.h

Go to the documentation of this file.
00001 #ifndef XDKWRL_SFTIME_H
00002 #define XDKWRL_SFTIME_H
00003 
00004 #include <xdkwrl/fieldtypes.h>
00005 #include <iostream>
00006 
00007 namespace wrl
00008 {
00009   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00010   // Interface of SFTime
00011   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00012   /*! \ingroup fieldtypes
00013    *
00014    * Represents a time value as a (float) number of seconds. Below is
00015    * included the documentation for this field type from the ISO standard.   
00016    * \htmlinclude sftime.html
00017    */
00018   class SFTime 
00019   {
00020   public:
00021     inline SFTime();
00022     inline SFTime(const double b);
00023     inline double nbSeconds() const;
00024     inline void setNbSeconds(const double n);
00025     static inline const char* typeName();
00026     static inline FieldTypeId typeId();
00027     inline bool operator==(const SFTime& t) const;
00028     friend std::ostream& operator<<(std::ostream& s,const SFTime& t);
00029   protected:
00030   private:
00031     long double value_;
00032   };
00033   //************************************************************
00034   // Implementation of SFTime
00035   //************************************************************
00036   /*!
00037    * Creates a SFTime with default value 0.0f. 
00038    */
00039   inline
00040   SFTime::SFTime()
00041     : value_(0)
00042   {
00043   }
00044   inline
00045   SFTime::SFTime(const double b)
00046     : value_(b)
00047   {
00048   } 
00049   inline double
00050   SFTime::nbSeconds() const
00051   {
00052     return value_;
00053   }
00054   inline void
00055   SFTime::setNbSeconds(const double n)
00056   {
00057     value_ = n;
00058   }
00059   inline const char*
00060   SFTime::typeName()
00061   {
00062     return "SFTime";
00063   }
00064   inline FieldTypeId
00065   SFTime::typeId()
00066   {
00067     return sfTime;
00068   }  
00069   inline bool
00070   SFTime::operator==(const SFTime& t) const
00071   {
00072     return value_ == t.value_;
00073   }
00074   inline std::ostream& operator<<(std::ostream& s,const SFTime& t)
00075   {
00076     return s<<t.value_;
00077   }
00078 };
00079 
00080 #endif // XDKWRL_SFTIME_H

Generated on 24 Feb 2005 with doxygen version 1.3.9.1. Valid HTML 4.0! Valid CSS!