9 #ifndef DtRtiTemplateMsg_H_
10 #define DtRtiTemplateMsg_H_
68 virtual int minSize()
const;
96 static const char theName[] =
"Header";
136 #define DtDECLARE_STANDARD_MSG_METHODS(ClassName) \
138 typedef void (*ClassName##Cb)(const ClassName& msg, void* usr); \
139 ClassName(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); \
140 ClassName(const DtNetMsgHeader* netHeader, \
141 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); \
142 virtual ~ClassName(); \
143 void addAllParameters(); \
144 virtual DtRtiMsg* clone(bool copy = true) const; \
145 static DtRtiMsg* create(const DtNetMsgHeader* initial, \
146 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); \
147 static DtRtiMsg* create( \
148 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); \
149 static void addCallback(DtConnectionMgr* conn, \
150 ClassName##Cb cb, void* usr); \
151 static void removeCallback(DtConnectionMgr* conn, \
152 ClassName##Cb cb, void* usr); \
154 ClassName* self() const \
155 { return const_cast<ClassName*>( this ); }
159 #define DtDEFINE_STANDARD_MSG_METHODS(ClassName) \
160 ClassName::ClassName(DtBufferPtr buffer) \
161 : DtRtiTemplateMsg(ClassName##Kind) \
163 addAllParameters(); \
164 initDtRtiMsg(minSize(), internalDtRtiMsgKind(), buffer); \
166 ClassName::ClassName(const DtNetMsgHeader* netHdr, \
167 DtBufferPtr buffer) \
168 : DtRtiTemplateMsg(ClassName##Kind) \
170 addAllParameters(); \
171 initDtRtiMsg(netHdr, buffer); \
173 ClassName::~ClassName() {} \
174 DtRtiMsg* ClassName::clone(bool copy) const \
178 return new ClassName(this->netHeader()); \
182 return new ClassName(); \
185 DtRtiMsg* ClassName::create(DtBufferPtr buffer) \
187 return new ClassName(buffer); \
189 DtRtiMsg* ClassName::create(const DtNetMsgHeader* initial, \
190 DtBufferPtr buffer) \
192 return new ClassName(initial, buffer); \
194 void ClassName::addCallback(DtConnectionMgr* conn, \
195 ClassName##Cb cb, void* usr) \
197 conn->addMsgCallback(ClassName##Kind, \
198 (DtRtiMsgCbMgr::DtCallbackFcn) cb, usr); \
200 void ClassName::removeCallback(DtConnectionMgr* conn, \
201 ClassName##Cb cb, void* usr) \
203 conn->removeMsgCallback(ClassName##Kind, \
204 (DtRtiMsgCbMgr::DtCallbackFcn) cb, usr); \
int myMinSize
The minimum size needed for this message.
Definition: rtiTemplateMsg.h:84
DtRtiMsgKind
Definition: rtiMsgKind.h:9
!DtIFSPEC1516
Definition: fedTimeFactory.h:190
std::vector< DtRtiBaseMsgParam * > myMsgParams
The list of other message parameters.
Definition: rtiTemplateMsg.h:78
virtual void printData(DtLogicalTimeFactory *logicalTimeFactory) const
unsigned myOctetBoundary
Octet boundary of this parameter.
Definition: rtiTemplateMsgParams.h:87
This file contains the declaration of the Connection Manager.
This file defines the DtRtiMsgParam template which can be used to produce template based message clas...
The base class for all templated RTI message parameters.
Definition: rtiTemplateMsgParams.h:32
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:45
virtual DtNetMsgHeader * netHeader() const
Get header of network representation.
Definition: rtiMsg.h:336
virtual DtRtiMsgKind internalDtRtiMsgKind()=0
DtRtiMsgKind myMsgKind
The message kind.
Definition: rtiTemplateMsg.h:81
#define DT_DLL_LRC
Definition: rtiMsConfig.h:126
DtRtiTemplateMsg defines a base class which can be subclassed to quickly produce a new RTI messages b...
Definition: rtiTemplateMsg.h:43
DtNetMsgHeaderParam * myHeaderParam
The parameter which points to the message header.
Definition: rtiTemplateMsg.h:75