MAK RTIspy API Documentation for HLA 1516
LogicalTime.h
Go to the documentation of this file.
00001 /***********************************************************************
00002    The IEEE hereby grants a general, royalty-free license to copy, distribute,
00003    display and make derivative works from this material, for all purposes,
00004    provided that any use of the material contains the following
00005    attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010".
00006    Should you require additional information, contact the Manager, Standards
00007    Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org).
00008 ***********************************************************************/
00009 /***********************************************************************
00010    IEEE 1516.1 High Level Architecture Interface Specification C++ API
00011    File: RTI/LogicalTime.h
00012 ***********************************************************************/
00013 
00014 #ifndef RTI_LogicalTime_h
00015 #define RTI_LogicalTime_h
00016 
00017 // The classes associated with logical time allow a federation to provide their
00018 // own representation for logical time and logical time interval. The federation
00019 // is responsible to inherit from the abstract classes declared below. The
00020 // encoded time classes are used to hold the arbitrary bit representation of the
00021 // logical time and logical time intervals.
00022 
00023 namespace rti1516e
00024 {
00025    class LogicalTimeInterval;
00026 }
00027 
00028 #include <RTI/SpecificConfig.h>
00029 #include <RTI/Exception.h>
00030 #include <string>
00031 #include <RTI/VariableLengthData.h>
00032 
00033 namespace rti1516e
00034 {
00035    class RTI_EXPORT LogicalTime
00036    {
00037    public:
00038       // Destructor
00039       virtual ~LogicalTime ()
00040          throw () = 0;
00041 
00042       // Basic accessors/mutators
00043 
00044       virtual void setInitial () = 0;
00045 
00046       virtual bool isInitial () const = 0;
00047 
00048       virtual void setFinal () = 0;
00049 
00050       virtual bool isFinal () const = 0;
00051 
00052       // Operators
00053 
00054       virtual LogicalTime & operator= (
00055          LogicalTime const & value)
00056          throw (
00057             InvalidLogicalTime) = 0;
00058 
00059       virtual LogicalTime & operator+= (
00060          LogicalTimeInterval const & addend)
00061          throw (
00062             IllegalTimeArithmetic,
00063             InvalidLogicalTimeInterval) = 0;
00064 
00065       virtual LogicalTime & operator-= (
00066          LogicalTimeInterval const & subtrahend)
00067          throw (
00068             IllegalTimeArithmetic,
00069             InvalidLogicalTimeInterval) = 0;
00070 
00071       virtual bool operator> (
00072          LogicalTime const & value) const
00073          throw (
00074             InvalidLogicalTime) = 0;
00075 
00076       virtual bool operator< (
00077          LogicalTime const & value) const
00078          throw (
00079             InvalidLogicalTime) = 0;
00080 
00081       virtual bool operator== (
00082          LogicalTime const & value) const
00083          throw (
00084             InvalidLogicalTime) = 0;
00085 
00086       virtual bool operator>= (
00087          LogicalTime const & value) const
00088          throw (
00089             InvalidLogicalTime) = 0;
00090 
00091       virtual bool operator<= (
00092          LogicalTime const & value) const
00093          throw (
00094             InvalidLogicalTime) = 0;
00095 
00096       // Generates an encoded value that can be used to send
00097       // LogicalTimes to other federates in updates or interactions
00098       virtual VariableLengthData encode () const = 0;
00099 
00100       // Alternate encode for directly filling a buffer
00101       virtual size_t encode (
00102          void* buffer,
00103          size_t bufferSize) const
00104          throw (
00105             CouldNotEncode) = 0;
00106 
00107       // The length of the encoded data
00108       virtual size_t encodedLength () const = 0;
00109 
00110       // Decode encodedLogicalTime into self
00111       virtual void decode (
00112          VariableLengthData const & encodedLogicalTime)
00113          throw (
00114             InternalError,
00115             CouldNotDecode) = 0;
00116 
00117       // Alternate decode that reads directly from a buffer
00118       virtual void decode (
00119          void* buffer,
00120          size_t bufferSize)
00121          throw (
00122             InternalError,
00123             CouldNotDecode) = 0;
00124 
00125       // Diagnostic string representation of time
00126       virtual std::wstring toString () const = 0;
00127 
00128       // Return the name of the implementation, as needed by
00129       // createFederationExecution.
00130       virtual std::wstring implementationName () const = 0;
00131    };
00132 
00133    // Output operator for LogicalTime
00134    std::wostream RTI_EXPORT & operator << (
00135       std::wostream &,
00136       LogicalTime const &);
00137 }
00138 
00139 #endif // RTI_LogicalTime_h

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)