MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
callbackResponseMessage.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2025 MAK Technologies
3 ** All rights reserved.
4 *********************************************************************/
5 #pragma once
6 
7 #include "fedproMessage.h"
8 
9 #include <map>
10 
11 namespace rti1516_2025
12 {
13  namespace fedpro
14  {
15  class CallbackResponse;
16  };
17 };
18 
19 namespace FedProSess
20 {
22  {
23  public:
24 
25  // Create a message from the response data
26  // Allocates memory for in place construction of the message to hold its fixed and variable length data.
27  // User is responsible for calling destroy to free memory
28  static DtCallbackResponseMessage* create(const rti1516_2025::fedpro::CallbackResponse& responseData = theDefaultResponse);
29 
30  // Create a message from the response data using the supplied buffer (resized if needed).
31  static DtCallbackResponseMessage* create(std::vector<char>& messageBuffer,
32  const rti1516_2025::fedpro::CallbackResponse& responseData = theDefaultResponse);
33 
34  // Clone the given message
35  // Allocates memory for in place construction of the message to hold its fixed and variable length data.
36  // User is responsible for calling destroy to free memory
37  static DtCallbackResponseMessage* clone(const DtCallbackResponseMessage* originalMessage);
38 
39  // Clone the given message using the supplied buffer (resized if needed).
40  static DtCallbackResponseMessage* clone(std::vector<char>& messageBuffer, const DtCallbackResponseMessage* originalMessage);
41 
42 
43  public:
44 
46 
47  DtCallbackResponseMessage* setRequestNumber(DtFedProU32 statusValue);
48  DtFedProU32 requestNumber() const;
49 
50  bool getResponse(rti1516_2025::fedpro::CallbackResponse& response) const;
51 
52  void printData() const;
53  const char* responseString() const;
54  static const char* responseString(const rti1516_2025::fedpro::CallbackResponse& response);
55  static const char* responseString(unsigned int responseType);
56 
57  protected:
58 
59  // Must use create
60  DtCallbackResponseMessage(unsigned long messageSize);
61 
62  // Set the message payload data
63  void setResponse(const rti1516_2025::fedpro::CallbackResponse& responseData);
64 
65  // Size of this message minus the data placeholder for variable length serialized data
66  static inline unsigned fixedMessageSize() {return sizeof(DtCallbackResponseMessage) - 1;}
67 
68  protected:
69 
71 
72  // Place holder for serialized data
73  char myData;
74 
75  static std::map <int, const char*> theResponseStrings;
77  };
78 };
static unsigned fixedMessageSize()
Definition: callbackResponseMessage.h:66
MAKRti::DtNetU32 DtFedProU32
Definition: fedproNetDatatypes.h:15
#define DT_DLL_FEDPRO
Definition: rtiMsConfig.h:156
Definition: callbackResponseMessage.h:21
DtFedProU32 myRequestNumber
Definition: callbackResponseMessage.h:70
char myData
Definition: callbackResponseMessage.h:73
static rti1516_2025::fedpro::CallbackResponse const & theDefaultResponse
Definition: callbackResponseMessage.h:76
static std::map< int, const char * > theResponseStrings
Definition: callbackResponseMessage.h:75
Definition: fedproMessage.h:18
Definition: FederateAmbassador.pb.h:12672

Document ID: Generated on Wed Jul 8 16:20:32 EDT 2026 from SVN revision 291616
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)