MAK RTIspy API Documentation for HLA 1.3
metadataFederateHostInformation.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2008 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: metadataFederateHostInformation.h,v $ $Revision: 1.4 $ $State: Exp $
00007 *********************************************************************/
00008 
00009 #ifndef DtRtiMtdFederateHostInformation_H_
00010 #define DtRtiMtdFederateHostInformation_H_
00011 
00016 
00017 #include "metadata.h"
00018 #include "RIDparams.h"
00019 
00020 #if defined(DtIFSPEC1516) || defined(DtIFSPEC1516E)
00021 #include <RTI/Handle.h>
00022 #else
00023 #ifdef DtIFSPEC13DLC
00024 #include "RTI13.h"
00025 #else
00026 #include "RTI.hh"
00027 #endif
00028 #endif
00029 
00032 class DT_DLL_LRC DtRtiMtdFederateHostInformation : public DtRtiMetadata
00033 {
00034 
00035 public:
00036 
00037    struct DtFederateHostInformation
00038    {
00039       DtRIDParameters::DtAsynchronousIOModeEnum asyncMode;
00040       MAKRti::DtString federateName;
00041       float averageTickTime;
00042       //TODO: populate this with other federate host info
00043 
00044       unsigned int size() const
00045       {
00046          unsigned int actualSizeOfString = federateName.size() + 1;
00047          // increment by the size of the asyncIO type.
00048          unsigned int sizeToUse = sizeof(DtNetU32);         
00049          // increment by the value of the size of the string
00050          sizeToUse += sizeof(DtNetU32);
00051          // increment by the size of the string
00052          sizeToUse += actualSizeOfString;
00053          // We need 32 bit alignment.
00054          unsigned int differenceFrom32Bit = actualSizeOfString % 4;
00055          if ( differenceFrom32Bit != 0 )
00056          {
00057             sizeToUse += (4 - differenceFrom32Bit);
00058          }
00059          //Increment the sizeToUse by the size of the float
00060          sizeToUse += sizeof(DtNetFloat32);
00061 
00062          assert(sizeToUse % 4 == 0);
00063          return sizeToUse;
00064       }
00065    };
00066 
00068    DtRtiMtdFederateHostInformation( caddr_t msg );
00069    DtRtiMtdFederateHostInformation( DtRtiMsg* msg );
00070 
00072    virtual ~DtRtiMtdFederateHostInformation();
00073 
00074 private:
00075 
00077    DtRtiMtdFederateHostInformation(const DtRtiMtdFederateHostInformation &);
00078 
00080    DtRtiMtdFederateHostInformation& operator=(const DtRtiMtdFederateHostInformation &);
00081    
00082 public:
00083 
00087    virtual bool get( DtFederateHostInformation& federateHostInformation ) const;
00088 
00092    virtual bool set( const DtFederateHostInformation& federateHostInformation  );
00093 
00094    
00095 protected:
00096 
00097    const unsigned int  myPayloadAlignment;
00098    
00099 };
00100 
00101 #endif //! DtRtiMtdFederateHostInformation_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)