VR-Link API Documentation for HLA 1516
rtiCompatibility.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 #pragma once
00006 
00007 #if DtHLA
00008 
00009 
00010 
00011 #include <vlutil/vlMachineTypes.h>
00012 #include <iosfwd>
00013 
00020 
00021 #if DtHLA_1516
00022 
00023    #if DtHLA_1516_EVOLVED
00024 
00025       #include <RTI/RTI1516.h>
00026 
00027 
00029       DT_DLL_VL std::ostream& operator<<
00030          (std::ostream& os, const rti1516e::ObjectInstanceHandle& handle);
00031 
00033       DT_DLL_VL std::ostream& operator<<
00034          (std::ostream& os, const rti1516e::ObjectClassHandle& handle);
00035 
00037       DT_DLL_VL std::ostream& operator<<
00038          (std::ostream& os, const rti1516e::InteractionClassHandle& handle);
00039 
00041       DT_DLL_VL std::ostream& operator<<
00042          (std::ostream& os, const rti1516e::AttributeHandle& handle);
00043 
00045       DT_DLL_VL std::ostream& operator<<
00046          (std::ostream& os, const rti1516e::ParameterHandle& handle);
00047 
00049       DT_DLL_VL std::ostream& operator<<
00050          (std::ostream& os, const rti1516e::Exception& exception);
00051 
00054       namespace rti1516e {
00055 
00066          template <typename HandleType, typename MapType>
00067          class CompatibleHandleValuePairSet 
00068          {
00069          public:
00070    
00071             CompatibleHandleValuePairSet(MapType *AHVM);  
00072             CompatibleHandleValuePairSet(const MapType *AHVM);
00073             ~CompatibleHandleValuePairSet();
00074 
00075             unsigned long size() const ;
00076             HandleType getHandle( unsigned long i) const ;
00077             unsigned long getValueLength( unsigned long i) const ;
00078             void getValue(unsigned long  i, char* buffer, unsigned long  &valueLength) const ;
00079             char *getValuePointer(unsigned long i, unsigned long &valueLength) const ;
00080             void add(HandleType h, const char* buffer, unsigned long valueLength);
00081             void remove(HandleType h);
00082             void empty();
00083 
00084          protected:
00085 
00086             void updateCachedIterator(unsigned long i) const;
00087 
00088             MapType *myMap;
00089             mutable int myLastPlace;
00090             mutable typename MapType::iterator myLastMapPosition;
00091          };
00092 
00093 
00096          typedef CompatibleHandleValuePairSet<AttributeHandle, AttributeHandleValueMap>
00097             AttributeHandleValuePairSet;
00098 
00099          typedef CompatibleHandleValuePairSet<ParameterHandle, ParameterHandleValueMap>
00100             ParameterHandleValuePairSet;
00101 
00102 
00104          typedef unsigned long ULong;
00105          typedef ObjectInstanceHandle ObjectHandle;
00106 
00107       }; 
00108 
00109    #else
00110 
00111       #include <RTI/RTI1516.h>
00112 
00113 
00115       DT_DLL_VL std::ostream& operator<<
00116          (std::ostream& os, const rti1516::ObjectInstanceHandle& handle);
00117 
00119       DT_DLL_VL std::ostream& operator<<
00120          (std::ostream& os, const rti1516::ObjectClassHandle& handle);
00121 
00123       DT_DLL_VL std::ostream& operator<<
00124          (std::ostream& os, const rti1516::InteractionClassHandle& handle);
00125 
00127       DT_DLL_VL std::ostream& operator<<
00128          (std::ostream& os, const rti1516::AttributeHandle& handle);
00129 
00131       DT_DLL_VL std::ostream& operator<<
00132          (std::ostream& os, const rti1516::ParameterHandle& handle);
00133 
00135       DT_DLL_VL std::ostream& operator<<
00136          (std::ostream& os, const rti1516::Exception& exception);
00137 
00140       namespace rti1516 {
00141 
00152          template <typename HandleType, typename MapType>
00153          class CompatibleHandleValuePairSet 
00154          {
00155          public:
00156    
00157             CompatibleHandleValuePairSet(MapType *AHVM);  
00158             CompatibleHandleValuePairSet(const MapType *AHVM);
00159             ~CompatibleHandleValuePairSet();
00160 
00161             inline unsigned long size() const ;
00162             inline HandleType getHandle( unsigned long i) const ;
00163             inline unsigned long getValueLength( unsigned long i) const ;
00164             inline void getValue(unsigned long  i, char* buffer, unsigned long  &valueLength) const ;
00165             inline char *getValuePointer(unsigned long i, unsigned long &valueLength) const ;
00166             inline void add(HandleType h, const char* buffer, unsigned long valueLength);
00167             inline void remove(HandleType h);
00168             inline void empty();
00169 
00170          protected:
00171 
00172             void updateCachedIterator(unsigned long i) const;
00173 
00174             MapType *myMap;
00175             mutable int myLastPlace;
00176             mutable typename MapType::iterator myLastMapPosition;
00177          };
00178 
00179 
00182          typedef CompatibleHandleValuePairSet<AttributeHandle, AttributeHandleValueMap>
00183             AttributeHandleValuePairSet;
00184 
00185          typedef CompatibleHandleValuePairSet<ParameterHandle, ParameterHandleValueMap>
00186             ParameterHandleValuePairSet;
00187 
00188 
00190          typedef unsigned long ULong;
00191          typedef ObjectInstanceHandle ObjectHandle;
00192 
00193       }; 
00194 
00195    #endif //DtHLA_1516_EVOLVED
00196 
00197 #define INCLUDE_rtiCompataibility_inl_
00198    #include "rtiCompatibility.inl"
00199 #undef INCLUDE_rtiCompataibility_inl_
00200 
00201 #else // DtHLA_1516
00202 
00203    #include <RTI.hh>
00204 
00205    #if !defined(_WIN32) && !defined(RTI_USES_STD_FSTREAM) && !defined(__darwin__)
00206       DT_DLL_VL std::ostream& operator<< (std::ostream& os, const RTI::Exception& exception);
00207    #endif
00208 
00209 #endif // DtHLA_1516
00210 
00211 
00212 #endif // if DtHLA
00213 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)