MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
connectMsg.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: connectMsg.h,v $ $Revision: 1.8 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtConnectMsg_H_
13 #define DtConnectMsg_H_
14 
15 #include "rtiMsg.h"
16 #include "netDesgFedMsg.h"
17 
20 
21 class DtConnectionMgr;
22 class DtConnectMsg;
23 typedef void (*DtConnectCb)(const DtConnectMsg& inter, void* usr);
24 
26 {
27 public:
28 
30  DtConnectMsg(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
31 
33  DtConnectMsg(const DtNetConnectMsg* netRep,
34  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
35 
37  DtConnectMsg(DtHandle handle,
38  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
39 
41  virtual ~DtConnectMsg();
42 
44  virtual DtRtiMsg* clone(bool copy = true) const;
45 
47  virtual void set(DtHandle handle);
48 
50  virtual DtHandle connectionHandle() const;
51  virtual void setConnectionHandle(DtHandle handle);
52 
54  virtual void printData(DtLogicalTimeFactory* logicalTimeFactory) const;
55 
56 public:
57 
59  static DtRtiMsg* create(const DtNetMsgHeader* initial,
60  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
61 
62  static DtRtiMsg* create(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
63 
65  static void addCallback(DtConnectionMgr* conn,
66  DtConnectCb cb, void* usr, bool isMomCallback=false);
67  static void removeCallback(DtConnectionMgr* conn,
68  DtConnectCb cb, void* usr, bool isMomCallback=false);
69 
70  // Encode a connection handle using the forwarder handle and an offset
71  static unsigned long encodeConnectionHandle(DtU16 forwarderHandle, DtU16 connectOffset);
72 
73  // Decode the forwarder handle from a connection handle
74  static unsigned long decodeForwarderHandle(unsigned long connectionHandle);
75 
76 protected:
77 
79  virtual DtNetConnectMsg* netConnectMsg();
80  virtual const DtNetConnectMsg* netConnectMsg() const;
81 
84 
86  virtual int minSize() const;
87 
89  virtual DtConnectMsg* self() const;
90 
91 protected:
92 
93 };
94 
95 
97 {
98  return const_cast<DtConnectMsg*>( this );
99 }
100 
101 #endif
102 
DtRtiMsgKind
Definition: rtiMsgKind.h:9
Definition: netRtiMsgHdr.h:23
!DtIFSPEC1516
Definition: fedTimeFactory.h:190
virtual void printData(DtLogicalTimeFactory *logicalTimeFactory) const
Instances of DtConnectionMgr manage the communication objects that the RTI will use to either communi...
Definition: connectMgr.h:60
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:45
Definition: netDesgFedMsg.h:19
Definition: connectMsg.h:25
virtual DtRtiMsg * clone(bool copy=true) const =0
Return a copy/empty object of the same type as this.
virtual DtRtiMsgKind internalDtRtiMsgKind()=0
virtual DtConnectMsg * self() const
Casts away const-ness.
Definition: connectMsg.h:96
void(* DtConnectCb)(const DtConnectMsg &inter, void *usr)
Definition: connectMsg.h:23
unsigned long DtHandle
The internal types.
Definition: internalTypes.h:25
DtNetDesignatedFederateMsg DtNetConnectMsg
Quick fix for now, borrow designated federate message format.
Definition: connectMsg.h:19
#define DT_DLL_LRC
Definition: rtiMsConfig.h:126

Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)