MAK RTIspy API Documentation for HLA Evolved
DataElement.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: DataElement.h
00012 ***********************************************************************/
00013 #ifndef RTI_DataElement_h_
00014 #define RTI_DataElement_h_
00015 
00016 #include <RTI/SpecificConfig.h>
00017 #include <RTI/encoding/EncodingConfig.h>
00018 #include <RTI/encoding/EncodingExceptions.h>
00019 #include <memory>
00020 
00021 
00022 namespace rti1516e
00023 {
00024    // Forward Declarations
00025    class VariableLengthData;
00026 
00027    // Interface provided by all HLA data elements.
00028    class RTI_EXPORT DataElement
00029    {
00030    public:
00031 
00032       // Destructor
00033       virtual ~DataElement () = 0;
00034 
00035       // Return a new copy of the DataElement
00036       virtual std::auto_ptr<DataElement> clone () const = 0;
00037 
00038       // Encode this element into a new VariableLengthData
00039       virtual VariableLengthData encode () const
00040          throw (EncoderException) = 0;
00041 
00042       // Encode this element into an existing VariableLengthData
00043       virtual void encode (
00044          VariableLengthData& inData) const
00045          throw (EncoderException) = 0;
00046 
00047       // Encode this element and append it to a buffer
00048       virtual void encodeInto (
00049          std::vector<Octet>& buffer) const
00050          throw (EncoderException) = 0;
00051 
00052       // Decode this element from the RTI's VariableLengthData.
00053       virtual void decode (
00054          VariableLengthData const & inData)
00055          throw (EncoderException) = 0;
00056 
00057       // Decode this element starting at the index in the provided buffer
00058       virtual size_t decodeFrom (
00059          std::vector<Octet> const & buffer,
00060          size_t index)
00061          throw (EncoderException) = 0;
00062 
00063       // Return the size in bytes of this element's encoding.
00064       virtual size_t getEncodedLength () const
00065          throw (EncoderException) = 0;
00066 
00067       // Return the octet boundary of this element.
00068       virtual unsigned int getOctetBoundary () const = 0;
00069 
00070       // Return true if given element is same type as this; otherwise, false.
00071       virtual bool isSameTypeAs(
00072          DataElement const& inData ) const;
00073 
00074       // Return a hash of the encoded data
00075       // Provides mechanism to map DataElement discriminants to variants
00076       // in VariantRecord.
00077       virtual Integer64 hash() const;
00078 
00079    };
00080 }
00081 
00082 #endif // RTI_DataElement_h_
00083 

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)