MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
metadataFederateHostInformation.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2008 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: metadataFederateHostInformation.h,v $ $Revision: 1.4 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef DtRtiMtdFederateHostInformation_H_
10 #define DtRtiMtdFederateHostInformation_H_
11 
16 
17 #include "metadata.h"
18 #include "RIDparams.h"
19 
20 #if defined(DtIFSPEC1516) || defined(DtIFSPEC1516E)
21 #include <RTI/Handle.h>
22 #else
23 #ifdef DtIFSPEC13DLC
24 #include "RTI13.h"
25 #else
26 #include "RTI.hh"
27 #endif
28 #endif
29 
33 {
34 
35 public:
36 
38  {
40  MAKRti::DtString federateName;
42  //TODO: populate this with other federate host info
43 
44  unsigned int size() const
45  {
46  unsigned int actualSizeOfString = federateName.size() + 1;
47  // increment by the size of the asyncIO type.
48  unsigned int sizeToUse = sizeof(DtNetU32);
49  // increment by the value of the size of the string
50  sizeToUse += sizeof(DtNetU32);
51  // increment by the size of the string
52  sizeToUse += actualSizeOfString;
53  // We need 32 bit alignment.
54  unsigned int differenceFrom32Bit = actualSizeOfString % 4;
55  if ( differenceFrom32Bit != 0 )
56  {
57  sizeToUse += (4 - differenceFrom32Bit);
58  }
59  //Increment the sizeToUse by the size of the float
60  sizeToUse += sizeof(DtNetFloat32);
61 
62  assert(sizeToUse % 4 == 0);
63  return sizeToUse;
64  }
65  };
66 
68  DtRtiMtdFederateHostInformation( caddr_t msg );
70 
73 
74 private:
75 
78 
81 
82 public:
83 
87  virtual bool get( DtFederateHostInformation& federateHostInformation ) const;
88 
92  virtual bool set( const DtFederateHostInformation& federateHostInformation );
93 
94 
95 protected:
96 
97  const unsigned int myPayloadAlignment;
98 
99 };
100 
101 #endif

Document ID: Generated on Mon Mar 21 09:41:37 EDT 2016 from SVN revision 163228
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)