VR-Link API Documentation for DIS
vlNetTypes.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00006 //lint -e740 -e732 
00007 
00010 
00011 #pragma once
00012 #include "vlMachineTypes.h"
00013 
00014 #include <string.h>
00015 
00016 #ifndef _WIN32
00017 #include <netinet/in.h>
00018 #else
00019 #if DtTENA
00020 // The TENA Middleware requires an expanded FD_SETSIZE; let ACE #define it
00021 // before <WinSock2.h> is #included as a side effect of one of the MFC headers
00022 #include <ACE/config.h>
00023 #endif
00024 #include <Winsock2.h>
00025 #endif
00026 
00027 #ifdef DtUSE_UTILITIES_NAMESPACE
00028 namespace DtUSE_UTILITIES_NAMESPACE
00029 {
00030 #endif
00031 
00034 typedef DtU8      DtNetU8;
00035 
00038 typedef DtInt8    DtNetInt8;
00039 
00042 typedef DtNetU8         DtNetBoolean;
00043 
00046 typedef DtNetU8           DtNet8Bits;
00047 
00048 typedef DtNetU8           DtNet16Bits[2];
00049 typedef DtNetU8           DtNet32Bits[4];
00050 typedef DtNetU8           DtNet64Bits[8];
00051 
00055 class DT_DLL_VLUTIL DtNetU16
00056 {
00057 public:
00058 
00061    DtNetU8 msbyte; 
00062 
00065    DtNetU8 lsbyte; 
00066 
00067    inline DtNetU16();
00068    inline DtNetU16(DtU16);
00069    inline DtNetU16(const DtNetU16&);
00070    inline DtNetU16& operator=(const DtNetU16& u);
00071    inline DtNetU16& operator=(const DtU16& u);
00072    inline operator DtU16() const;
00073 };
00074 
00078 class DT_DLL_VLUTIL DtNetInt16
00079 {
00080 public:
00081 
00084    DtNetInt8  msbyte; 
00085    
00088    DtNetInt8  lsbyte; 
00089 
00090    inline DtNetInt16();
00091    inline DtNetInt16(const DtInt16&);
00092    inline DtNetInt16(const DtNetInt16&);
00093    inline DtNetInt16& operator=(const DtNetInt16&);
00094    inline DtNetInt16& operator=(const DtInt16&);
00095    inline operator DtInt16() const;
00096 };
00097 
00098 
00102 class DT_DLL_VLUTIL DtNetU32
00103 {
00104 public:
00105 
00108    DtNetU16    msword;  
00109 
00112    DtNetU16    lsword;  
00113 
00114    inline DtNetU32();
00115    inline DtNetU32(const DtU32&);
00116    inline DtNetU32(const DtNetU32&);
00117    inline DtNetU32& operator=(const DtNetU32&);
00118    inline DtNetU32& operator=(const DtU32&);
00119    inline operator DtU32() const;
00120 };
00121 
00122 
00126 class DT_DLL_VLUTIL DtNetInt32
00127 {
00128 public:
00129 
00132    DtNetInt16     msword;  
00133 
00136    DtNetInt16     lsword;  
00137 
00138    inline DtNetInt32();
00139    inline DtNetInt32(const DtInt32& );
00140    inline DtNetInt32(const DtNetInt32&);
00141    inline DtNetInt32& operator=(const DtNetInt32&);
00142    inline DtNetInt32& operator=(const DtInt32&);
00143    inline operator DtInt32() const;
00144 };
00145 
00146 
00150 class DT_DLL_VLUTIL DtNetFloat32
00151 {
00152 public:
00153 
00154    DtNetU32 bits;
00155 
00156    inline DtNetFloat32();
00157    inline DtNetFloat32(const DtFloat32 &);
00158    inline DtNetFloat32(const DtNetFloat32&);
00159    inline DtNetFloat32& operator=(const DtNetFloat32 &);
00160    inline DtNetFloat32& operator=(const DtFloat32 &);
00161    inline operator DtFloat32() const;
00162 
00163 protected:
00164 
00165    union TempLayout
00166    {
00167       DtFloat32 flt;
00168       DtU32 bits;
00169    }; 
00170 
00171 };
00172 
00176 class DT_DLL_VLUTIL DtNetFloat64
00177 {
00178 public:
00179 
00182    DtNetU32 mslong;
00185    DtNetU32 lslong; 
00186 
00187    inline DtNetFloat64();
00188    inline DtNetFloat64(const DtFloat64&);
00189    inline DtNetFloat64(const DtNetFloat64&);
00190    inline DtNetFloat64& operator=(const DtNetFloat64&);
00191    inline DtNetFloat64& operator=(const DtFloat64&);
00192    inline operator DtFloat64() const;
00193 
00194 protected:
00195 
00197    union TempLayout
00198    {
00199       DtFloat64 flt;
00200       struct{
00201          DtU32 mslong;
00202          DtU32 lslong;
00203       } bits;
00204    };
00205 };
00206 
00211 class DT_DLL_VLUTIL DtNetU64
00212 {
00213 public:
00214 
00217    DtNetU32 mslong; 
00218 
00221    DtNetU32 lslong; 
00222 
00223    inline DtNetU64();
00224    inline DtNetU64(const DtU64& f);
00225    inline DtNetU64(const DtNetU64& f);
00226    inline DtNetU64&  operator=(const DtNetU64& other);
00227    inline DtNetU64&  operator=(const DtU64& other);
00228    inline operator DtU64() const;
00229 
00230 protected:
00231 
00233    union TempLayout
00234    {
00235       DtU64 flt;
00236       struct{
00237          DtU32 mslong;
00238          DtU32 lslong;
00239       } bits;
00240    };
00241 };
00242 
00247 class DT_DLL_VLUTIL DtNetInt64
00248 {
00249 public:
00250 
00253    DtNetInt32 mslong; 
00254 
00257    DtNetInt32 lslong; 
00258 
00259    inline DtNetInt64();
00260    inline DtNetInt64(const DtInt64& f);
00261    inline DtNetInt64(const DtNetInt64& f);
00262    inline DtNetInt64&  operator=(const DtNetInt64& other);
00263    inline DtNetInt64&  operator=(const DtInt64& other);
00264    inline operator DtInt64() const;
00265 
00266 protected:
00267 
00269    union TempLayout
00270    {
00271       DtInt64 flt;
00272       struct{
00273          DtInt32 mslong;
00274          DtInt32 lslong;
00275       } bits;
00276    };
00277 };
00278 
00281 enum DtNetworkByteOrderType {
00282    DtLittleEndian  = 0,
00283    DtBigEndian = 1
00284 };
00285 
00286  
00289 DT_DLL_VLUTIL DtNetworkByteOrderType  DtNetworkByteOrdering();
00290 
00294 DT_DLL_VLUTIL void DtSetNetworkByteOrdering(DtNetworkByteOrderType bigOrLittle);
00295 
00296 #ifdef DtUSE_UTILITIES_NAMESPACE
00297 }     
00298 #endif
00299 
00301 #define vlNetTypes_inl
00302 #include "vlNetTypes.inl"
00303 #undef vlNetTypes_inl
00304 

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)